تسجيل المكالمات: قم بإحضار التشغيل السريع لتخزين Azure الخاص بك

تساعدك هذه البداية السريعة على بدء استخدام إحضار مساحة تخزين Azure الخاصة بك لتسجيل المكالمات. لبدء استخدام وظيفة إحضار Azure Storage الخاصة بك، تأكد من أنك على دراية بواجهات برمجة تطبيقات تسجيل المكالمات.

المتطلبات المسبقة: إعداد تعيينات دور عناصر التحكم في الوصول المستندة إلى الدور والهوية المدارة (RBAC)

1. تمكين الهوية المدارة المعينة من قبل النظام لخدمات اتصالات Azure

رسم تخطيطي يوضح مورد خدمة اتصال مع تعطيل الهوية المدارة

  1. افتح مورد Azure Communication Services. انتقل إلى Identity على اليسار.
  2. تمكين الهوية المدارة المعينة من قبل النظام وانقر فوق حفظ.
  3. بمجرد الانتهاء، يمكنك رؤية معرف الكائن الأساسي للهوية التي تم إنشاؤها حديثا.

رسم تخطيطي يوضح مورد خدمة اتصال مع تمكين الهوية المدارة

  1. بمجرد إنشاء الهوية بنجاح، انقر فوق تعيينات دور Azure لبدء إضافة تعيينات الأدوار.

2. إضافة تعيين دور

  1. انقر فوق "إضافة تعيين دور"

رسم تخطيطي يوضح هوية مدارة لمورد خدمة الاتصال تضيف تعيين دور

  1. في لوحة "إضافة تعيين دور" ، حدد القيم التالية
    1. النطاق: التخزين
    2. الاشتراك: اختر اشتراكك
    3. المورد: اختر حساب التخزين الخاص بك
    4. الدور: تحتاج Azure Communication Services إلى "Storage Blob Data Contributor" لتتمكن من الكتابة إلى حساب التخزين الخاص بك.

رسم تخطيطي يوضح هوية مدارة لمورد خدمة الاتصال تضيف تفاصيل تعيين الدور

  1. انقر فوق "Save".
  2. بمجرد الانتهاء، سترى تعيين الدور المضاف حديثا في نافذة "تعيين دور Azure".

رسم تخطيطي يوضح نجاح تعيين دور الهوية المدارة لمورد خدمة الاتصالات

بدء تسجيل جلسة العمل مع تحديد التخزين الخارجي

استخدم معرف مكالمة الخادم الذي تم استلامه أثناء بدء المكالمة.

استخدام تخزين 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، أو إجراء آخر تم تشغيله، لإعلام خدماتك عندما تكون الوسائط المسجلة جاهزة ويتم تصديرها إلى موقع التخزين الخارجي.

راجع هذا المثال لمخطط الحدث.

{
    "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 + '-' + guid/[chunk-id]-acsmetadata.documentId.json
  • /YYYYMMDD/callId/first_8_of_recordingId + '-' + guid/[chunk-id]-audiomp3.documentId.mp3

رسم تخطيطي يوضح بنية مجلد تسجيل المكالمات

الخطوات التالية

لمزيد من المعلومات، راجع المقالات التالية: