Skip to content

Commit e0387c3

Browse files
authored
Update call recording documentation for Python
1 parent bea0bbf commit e0387c3

1 file changed

Lines changed: 18 additions & 16 deletions

File tree

articles/communication-services/quickstarts/voice-video-calling/includes/call-recording-samples/call-recording-python.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,25 @@ You can download the sample app from [GitHub](https://github.com/Azure-Samples/c
2020

2121
## Before you start
2222

23-
Call Recording APIs use exclusively the `serverCallId`to initiate recording. There are a couple of methods you can use to fetch the `serverCallId` depending on your scenario:
23+
Call Recording APIs use the `callConnectionId` or `serverCallId`to initiate recording. There are a couple of methods you can use to fetch the these IDs depending on your scenario:
2424

25-
### Call Automation scenarios
25+
### How to fetch callConnectionId
2626

27-
- When using [Call Automation](../../../call-automation/callflows-for-customer-interactions.md), you have two options to get the `serverCallId`:
28-
1) Once a call is created, a `serverCallId` is returned as a property of the `CallConnected` event after a call is established. Learn how to [Get CallConnected event](../../../call-automation/callflows-for-customer-interactions.md?pivots=programming-language-python#update-programcs) from Call Automation SDK.
29-
2) Once you answer the call or a call is created, it returns the `serverCallId` as a property of the `AnswerCallResult` or `CreateCallResult` API responses respectively.
27+
When using [Call Automation](../../../call-automation/callflows-for-customer-interactions.md), you will receive the `callConnectionId` from the response event from a `createCall`, `answer`, or `connect` requests when initiating the call.
3028

31-
### Calling SDK scenarios
29+
### How to fetch serverCallId
3230

33-
- When using [Calling Client SDK](../../get-started-with-video-calling.md), you can retrieve the `serverCallId` by using the `server_call_id` variable on the call.
34-
Use this example to learn how to [Get serverCallId](../../get-server-call-id.md) from the Calling Client SDK.
31+
When using [Call Automation](../../../call-automation/callflows-for-customer-interactions.md), you have two options to get the `serverCallId`:
3532

33+
1. When you establish a call, it returns a `serverCallId` as a property of the `CallConnected` event after a call is established. Learn how to [Get CallConnected event](../../../call-automation/callflows-for-customer-interactions.md?pivots=programming-language-csharp#update-programcs) from Call Automation SDK.
3634

35+
2. When you answer the call or a call is created, it returns the `serverCallId` as a property of the `AnswerCallResult` or `CreateCallResult` API responses respectively.
3736

38-
Let's get started with a few simple steps!
3937

38+
When using [Calling Client SDK](../../get-started-with-video-calling.md), you can retrieve the `serverCallId` by using the `getServerCallId` method on the call.
39+
Use this example to learn how to [Get serverCallId](../../get-server-call-id.md) from the Calling Client SDK.
40+
41+
Let's get started with a few simple steps.
4042

4143

4244
## 1. Create a Call Automation client
@@ -51,13 +53,13 @@ call_automation_client = CallAutomationClient.from_connection_string("<ACSConnec
5153

5254
## 2. Start recording session start_recording API
5355

54-
Use the `serverCallId` received during initiation of the call.
56+
Use the `callConnectionId` or `serverCallId` received during initiation of the call.
5557
- Use `RecordingContent` to pass the recording content type. Use `AUDIO`.
5658
- Use `RecordingChannel` to pass the recording channel type. Use `MIXED` or `UNMIXED`.
5759
- Use `RecordingFormat` to pass the format of the recording. Use `WAV`.
5860

5961
```python
60-
response = call_automation_client.start_recording(call_locator=ServerCallLocator(server_call_id),
62+
response = call_automation_client.start_recording(call_locator=ServerCallLocator(callConnectionId or server_call_id),
6163
recording_content_type = RecordingContent.Audio,
6264
recording_channel_type = RecordingChannel.Unmixed,
6365
recording_format_type = RecordingFormat.Wav,
@@ -69,7 +71,7 @@ response = call_automation_client.start_recording(call_locator=ServerCallLocator
6971
Start Recording with your own Azure Blob Storage defined to store the recording file once recording is complete.
7072

7173
```python
72-
response = call_automation_client.start_recording(call_locator=ServerCallLocator(server_call_id),
74+
response = call_automation_client.start_recording(call_locator=ServerCallLocator(callConnectionId or server_call_id),
7375
recording_content_type = RecordingContent.Audio,
7476
recording_channel_type = RecordingChannel.Unmixed,
7577
recording_format_type = RecordingFormat.Wav,
@@ -82,7 +84,7 @@ response = call_automation_client.start_recording(call_locator=ServerCallLocator
8284
> **Recordings will need to be resumed for recording file to be generated.**
8385
8486
```python
85-
response = call_automation_client.start_recording(call_locator=ServerCallLocator(server_call_id),
87+
response = call_automation_client.start_recording(call_locator=ServerCallLocator(callConnectionId or server_call_id),
8688
recording_content_type = RecordingContent.Audio,
8789
recording_channel_type = RecordingChannel.Unmixed,
8890
recording_format_type = RecordingFormat.Wav,
@@ -95,7 +97,7 @@ response = call_automation_client.start_recording(call_locator=ServerCallLocator
9597
To produce unmixed audio recording files, you can use the `AudioChannelParticipantOrdering` functionality to specify which user you want to record on channel 0. The rest of the participants are assigned to a channel as they speak. If you use `RecordingChannel.Unmixed` but don't use `AudioChannelParticipantOrdering`, Call Recording assigns channel 0 to the first participant speaking.
9698

9799
```python
98-
response = call_automation_client.start_recording(call_locator=ServerCallLocator(server_call_id),
100+
response = call_automation_client.start_recording(call_locator=ServerCallLocator(callConnectionId or server_call_id),
99101
recording_content_type = RecordingContent.Audio,
100102
recording_channel_type = RecordingChannel.Unmixed,
101103
recording_format_type = RecordingFormat.Wav,
@@ -108,7 +110,7 @@ response = call_automation_client.start_recording(call_locator=ServerCallLocato
108110
```python
109111
_channel_affinity = ChannelAffinity(target_participant=CommunicationUserIdentifier("<ACS_USER_MRI>"), channel=0)
110112

111-
response = call_automation_client.start_recording(call_locator=ServerCallLocator(server_call_id),
113+
response = call_automation_client.start_recording(call_locator=ServerCallLocator(callConnectionId or server_call_id),
112114
recording_content_type = RecordingContent.Audio,
113115
recording_channel_type = RecordingChannel.Unmixed,
114116
recording_format_type = RecordingFormat.Wav,
@@ -154,7 +156,7 @@ The following code is an example of the event schema.
154156
{
155157
"id": string, // Unique guid for event
156158
"topic": string, // /subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}
157-
"subject": string, // /recording/call/{call-id}/serverCallId/{serverCallId}
159+
"subject": string, // /recording/call/{call-id}/callConnectionId/{callConnectionId}
158160
"data": {
159161
"recordingStorageInfo": {
160162
"recordingChunks": [

0 commit comments

Comments
 (0)