次の方法で共有


通話レコーディング: Azure ストレージ持ち込みのクイックスタート

このクイックスタートでは、通話レコーディングでの Azure ストレージ持ち込みの使用を開始します。 Azure Storage 持ち込みの機能の使用を開始するには、Call Recording API について理解している必要があります。

前提条件: マネージド ID とロールベースのアクセス制御 (RBAC) ロールの割り当ての設定

1. Azure Communication Services のシステム割り当てマネージド ID を有効にする

マネージド ID が無効になっている Communication Services リソースを示す図

  1. Azure Communication Services リソースを開きます。 左側の [ID] に移動します。
  2. システム割り当てマネージド ID を有効にし、[保存] を選択します。
  3. 完了すると、新しく作成された ID のオブジェクト プリンシパル ID を確認できます。

マネージド ID を有効にした Communication Services リソースを示す図

  1. ID が正常に作成されたら、[Azure ロールの割り当て] を選択して、ロールの割り当ての追加を開始します。

2. ロールの割り当てを追加する

  1. [ロールの割り当ての追加] をクリックします

ロールの割り当てを追加する Communication Services リソースのマネージド ID を示す図

  1. [ロールの割り当ての追加] パネルで、次の値を選択します
    1. スコープ:Storage
    2. サブスクリプション: ご自分のサブスクリプションを選択します
    3. リソース: ストレージ アカウントを選択します
    4. ロール: Azure Communication Services には、ストレージ アカウントに書き込める "ストレージ BLOB データ共同作成者" が必要です。

ロールの割り当ての詳細を追加する Communication Services リソースのマネージド ID を示す図

  1. [保存] をクリックします。
  2. 完了すると、新しく追加されたロールの割り当てが [Azure ロールの割り当て] ウィンドウに表示されます。

Communication Services リソースのマネージド ID ロールの割り当ての成功を示す図

外部ストレージを指定してレコーディング セッションを開始する

通話の開始中に受信したサーバー通話 ID を使用します。

外部ストレージに Azure BLOB ストレージを使用する

StartRecordingOptions recordingOptions = new StartRecordingOptions(new ServerCallLocator("<serverCallId>"))
{
    //...
    ExternalStorage = new BlobStorage(new Uri("<Insert Container / Blob Uri>"))
};
               
Response<RecordingStateResult> startRecordingWithResponse = await callAutomationClient.GetCallRecording()
        .StartRecordingAsync(options: recordingOptions);

外部ストレージに Azure BLOB ストレージを使用する

StartRecordingOptions recordingOptions = new StartRecordingOptions(new ServerCallLocator("<serverCallId>"))
                .setExternalStorage(new BlobStorage("<Insert Container / Blob Uri>"));

Response<StartCallRecordingResult> response = callAutomationClient.getCallRecording()
.startRecordingWithResponse(recordingOptions, null);

エクスポートが成功した場合の通知

Azure Event Grid Web hook またはその他のトリガーされたアクションを使用して、記録されたメディアの準備が整い、外部ストレージの場所にエクスポートされたときにサービスに通知します。

イベント スキーマのこの例を参照してください。

{
    "id": "string", // Unique guid for event
    "topic": "string", // /subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}
    "subject": "string", // /recording/call/{call-id}/serverCallId/{serverCallId}
    "data": {
        "storageType": "string", // AzureBlob etc.
        "recordingId": "string", // unique id for recording
        "recordingStorageInfo": {
            "recordingChunks": [
                {
                    "documentId": "string", // Document id for the recording chunk
                    "contentLocation": "string", //Azure Communication Services URL where the content is located
                    "metadataLocation": "string", // Azure Communication Services URL where the metadata for this chunk is located
                    "deleteLocation": "string", // Azure Communication Services URL to use to delete all content, including recording and metadata.
                    "index": "int", // Index providing ordering for this chunk in the entire recording
                    "endReason": "string", // Reason for chunk ending: "SessionEnded", "ChunkMaximumSizeExceeded”, etc.
                }
            ]
        },
        "recordingStartTime": "string", // ISO 8601 date time for the start of the recording
        "recordingDurationMs": "int", // Duration of recording in milliseconds
        "sessionEndReason": "string" // Reason for call ending: "CallEnded", "InitiatorLeft”, etc.
    },
    "eventType": "string", // "Microsoft.Communication.RecordingFileStatusUpdated"
    "dataVersion": "string", // "1.0"
    "metadataVersion": "string", // "1"
    "eventTime": "string" // ISO 8601 date time for when the event was created
}

通話レコーディングのフォルダー構造

レコーディングは、図に示すように次の形式で格納されます。

  • /YYYYMMDD/callId/first_8_of_recordingId + '-' + unique guid/[chunk-id]-acsmetadata.documentId.json
  • /YYYYMMDD/callId/first_8_of_recordingId + '-' + unique guid/[chunk-id]-audiomp3.documentId.mp3

通話レコーディングのフォルダー構造を示す図

次のステップ

詳細については、次の記事を参照してください。