Skip to content

Commit b052dd9

Browse files
authored
Merge pull request #210344 from dbasantes/main
Unmixed Audio Private Preview updates (9/6)
2 parents 3c1241b + 1a13259 commit b052dd9

File tree

4 files changed

+129
-168
lines changed

4 files changed

+129
-168
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
ms.date: 09/07/2022
3+
ms.topic: quickstart
4+
author: dbasantes
5+
title: How to find immutable azure resource id
6+
ms.author: dbasantes
7+
ms.service: azure-communication-services
8+
description: how to find the immutable Azure Resource ID.
9+
---
10+
11+
12+
# How to get your Azure Resource ID
13+
14+
In order to get your Resource ID allowlisted, send your Immutable Azure Resource ID to the Call Recording Team. For reference, see the image below.
15+
16+
![Screenshot of Azure Resource ID.](media/call-recording/immutable-resource-id.png)
17+
18+
## See Also
19+
20+
For more information, see the following articles:
21+
22+
- Check out our [web calling sample](../../samples/web-calling-sample.md)
23+
- Learn about [Calling SDK capabilities](./getting-started-with-calling.md?pivots=platform-web)
24+
- Learn more about [how calling works](../../concepts/voice-video-calling/about-call-types.md)
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
ms.date: 09/07/2022
3+
ms.topic: quickstart
4+
author: dbasantes
5+
title: Get server Call Id
6+
ms.author: dbasantes
7+
ms.service: azure-communication-services
8+
description: This section describes how to get the serverCallid from a JavaScript server app
9+
---
10+
11+
12+
# Get serverCallId as a requirement for call recording server APIs from JavaScript application
13+
14+
In a peer to peer calling scenario using the [Calling client SDK](get-started-with-video-calling.md), in order to use Call Recording from Azure Communications you'll have to get the `serverCallId`.
15+
The following example shows you how to get the `serverCallId` from a JavaScript server application.
16+
17+
Call recording is an extended feature of the core Call API. You first need to import calling Features from the Calling SDK.
18+
19+
```JavaScript
20+
import { Features} from "@azure/communication-calling";
21+
```
22+
Then you can get the recording feature API object from the call instance:
23+
24+
```JavaScript
25+
const callRecordingApi = call.feature(Features.Recording);
26+
```
27+
Subscribe to recording changes:
28+
29+
```JavaScript
30+
const recordingStateChanged = () => {
31+
let recordings = callRecordingApi.recordings;
32+
33+
let state = SDK.RecordingState.None;
34+
if (recordings.length > 0) {
35+
state = recordings.some(r => r.state == SDK.RecordingState.Started)
36+
? SDK.RecordingState.Started
37+
: SDK.RecordingState.Paused;
38+
}
39+
40+
console.log(`RecordingState: ${state}`);
41+
}
42+
43+
const recordingsChangedHandler = (args: { added: SDK.RecordingInfo[], removed: SDK.RecordingInfo[]}) => {
44+
args.added?.forEach(a => {
45+
a.on('recordingStateChanged', recordingStateChanged);
46+
});
47+
48+
args.removed?.forEach(r => {
49+
r.off('recordingStateChanged', recordingStateChanged);
50+
});
51+
52+
recordingStateChanged();
53+
};
54+
55+
callRecordingApi.on('recordingsUpdated', recordingsChangedHandler);
56+
```
57+
Get `servercallId`, which can be used to start/stop/pause/resume recording sessions.
58+
Once the call is connected, use the `getServerCallId` method to get the server call ID.
59+
60+
```JavaScript
61+
callAgent.on('callsUpdated', (e: { added: Call[]; removed: Call[] }): void => {
62+
e.added.forEach((addedCall) => {
63+
addedCall.on('stateChanged', (): void => {
64+
if (addedCall.state === 'Connected') {
65+
addedCall.info.getServerCallId().then(result => {
66+
dispatch(setServerCallId(result));
67+
}).catch(err => {
68+
console.log(err);
69+
});
70+
}
71+
});
72+
});
73+
});
74+
```
75+
76+
## See also
77+
78+
For more information, see the following articles:
79+
80+
- Learn about [Calling SDK capabilities]()
81+
- Learn more about [how calling works](../../concepts/voice-video-calling/about-call-types.md)

articles/communication-services/quickstarts/voice-video-calling/includes/call-recording-samples/private-preview-unmixed-audio-recording-server-csharp.md

Lines changed: 8 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,14 @@ ms.author: bharat
1313

1414
## Prerequisites
1515

16-
Before you start testing Unmixed Audio recording, please make sure you complete the following steps:
16+
Before you start testing Unmixed Audio recording, make sure you complete the following steps:
1717

1818
- Create an Azure account with an active subscription. For details, see [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
1919
- Create an Azure Communication Services resource. For details, see [Create an Azure Communication Services resource](../../../create-communication-resource.md). You'll need to record your resource **connection string** for this quickstart.
20-
- Create an Azure storage account and container, for details, see [Create a storage account](../../../../../storage/common/storage-account-create.md?tabs=azure-portal). You'll need to record your storage **connection string** and **container name** for this quickstart.
2120
- Subscribe to events via an [Azure Event Grid](../../../../../event-grid/overview.md) Web hook.
2221
- Download the [.NET SDK](https://dev.azure.com/azure-sdk/public/_artifacts/feed/azure-sdk-for-net/NuGet/Azure.Communication.CallingServer/overview/1.0.0-alpha.20220829.1)
23-
- This Quickstart assumes you have some experience using the [Calling Client SDK](https://docs.microsoft.com/azure/communication-services/quickstarts/voice-video-calling/get-started-with-video-calling?pivots=platform-web). **Important**: To fetch serverCallId from Calling SDK, refer to the JavaScript example in the **Appendix** at the end of this document.
24-
- Make sure to provide the Azure Communication Services Call Recording team with your **immutable azure resource ID** to be whitelisted during the private preview tests.
22+
- This quickstart assumes you have some experience using the [Calling Client SDK](../../get-started-with-video-calling.md). **Important**: To fetch `serverCallId` from Calling SDK, refer to the [JavaScript](../../get-server-call-id.md) example.
23+
- Make sure to provide the Azure Communication Services Call Recording team with your [immutable Azure resource ID](../../get-resource-id.md) to be allowlisted during the **private preview** tests.
2524

2625

2726
## 1. Create a Call Automation client
@@ -35,9 +34,9 @@ CallAutomationClient callAutomationClient = new CallAutomationClient("<ACSConnec
3534
## 2. Start recording session with StartRecordingOptions using 'StartRecordingAsync' server API
3635

3736
Use the server call ID received during initiation of the call.
38-
RecordingContent is used to pass the recording content type. Use audio
39-
RecordingChannel is used to pass the recording channel type. Use unmixed.
40-
RecordingFormat is used to pass the format of the recording. Use wav.
37+
- RecordingContent is used to pass the recording content type. Use audio
38+
- RecordingChannel is used to pass the recording channel type. Use unmixed.
39+
- RecordingFormat is used to pass the format of the recording. Use wav.
4140

4241
```csharp
4342
StartRecordingOptions recordingOptions = new StartRecordingOptions(new ServerCallLocator("<ServerCallId>"))
@@ -112,7 +111,7 @@ Below is an example of the event schema.
112111
"recordingStorageInfo": {
113112
"recordingChunks": [
114113
{
115-
"documentId": string, // Document id for retrieving from AMS storage
114+
"documentId": string, // Document id for for the recording chunk
116115
"contentLocation": string, //Azure Communication Services URL where the content is located
117116
"metadataLocation": string, // Azure Communication Services URL where the metadata for this chunk is located
118117
"deleteLocation": string, // Azure Communication Services URL to use to delete all content, including recording and metadata.
@@ -142,81 +141,9 @@ The `downloadLocation` for the recording can be fetched from the `contentLocatio
142141

143142
## 7. Delete recording content using 'DeleteRecordingAsync' server API
144143

145-
Use `DeleteRecordingAsync` API for deleting the recording content (e.g. recorded media, metadata)
144+
Use `DeleteRecordingAsync` API for deleting the recording content (for example, recorded media, metadata)
146145

147146
```csharp
148147
var recordingDeleteUri = new Uri(deleteLocation);
149148
var response = await callAutomationClient.GetCallRecording().DeleteRecordingAsync(recordingDeleteUri);
150149
```
151-
152-
## Appendix
153-
154-
### A - Getting serverCallId as a requirement for call recording server APIs from JavaScript application
155-
156-
Call recording is an extended feature of the core Call API. You first need to import calling Features from the Calling SDK.
157-
158-
```JavaScript
159-
import { Features} from "@azure/communication-calling";
160-
```
161-
Then you can get the recording feature API object from the call instance:
162-
163-
```JavaScript
164-
const callRecordingApi = call.feature(Features.Recording);
165-
```
166-
Subscribe to recording changes:
167-
168-
```JavaScript
169-
const recordingStateChanged = () => {
170-
let recordings = callRecordingApi.recordings;
171-
172-
let state = SDK.RecordingState.None;
173-
if (recordings.length > 0) {
174-
state = recordings.some(r => r.state == SDK.RecordingState.Started)
175-
? SDK.RecordingState.Started
176-
: SDK.RecordingState.Paused;
177-
}
178-
179-
console.log(`RecordingState: ${state}`);
180-
}
181-
182-
const recordingsChangedHandler = (args: { added: SDK.RecordingInfo[], removed: SDK.RecordingInfo[]}) => {
183-
args.added?.forEach(a => {
184-
a.on('recordingStateChanged', recordingStateChanged);
185-
});
186-
187-
args.removed?.forEach(r => {
188-
r.off('recordingStateChanged', recordingStateChanged);
189-
});
190-
191-
recordingStateChanged();
192-
};
193-
194-
callRecordingApi.on('recordingsUpdated', recordingsChangedHandler);
195-
```
196-
Get server call ID which can be used to start/stop/pause/resume recording sessions.
197-
Once the call is connected, use the `getServerCallId` method to get the server call ID.
198-
199-
```JavaScript
200-
callAgent.on('callsUpdated', (e: { added: Call[]; removed: Call[] }): void => {
201-
e.added.forEach((addedCall) => {
202-
addedCall.on('stateChanged', (): void => {
203-
if (addedCall.state === 'Connected') {
204-
addedCall.info.getServerCallId().then(result => {
205-
dispatch(setServerCallId(result));
206-
}).catch(err => {
207-
console.log(err);
208-
});
209-
}
210-
});
211-
});
212-
});
213-
```
214-
215-
### B - How to find the Azure Resource ID
216-
217-
In order to get your Resource ID whitelisted, please send your Immutable Azure Resource ID to the Call Recording Team. For reference see the image below.
218-
219-
![Call recording how to get resource ID](../../media/call-recording/immutable-resource-id.png)
220-
221-
222-

articles/communication-services/quickstarts/voice-video-calling/includes/call-recording-samples/private-preview-unmixed-audio-recording-server-java.md

Lines changed: 16 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,19 @@ ms.author: bharat
88
---
99

1010
> [!NOTE]
11-
> Call Recording Unmixed audio is available in US only and may change based on feedback we receive during Private Preview.
11+
> Call Recording Unmixed audio is available in the US only and may change based on feedback we receive during the Private Preview stage.
1212
1313

1414
## Prerequisites
1515

16-
Before you start testing Unmixed Audio recording, please make sure you complete the following steps:
16+
Before you start testing Unmixed Audio recording, make sure you complete the following steps:
1717

1818
- Create an Azure account with an active subscription. For details, see [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
1919
- Create an Azure Communication Services resource. For details, see [Create an Azure Communication Services resource](../../../create-communication-resource.md). You'll need to record your resource **connection string** for this quickstart.
20-
- Create an Azure storage account and container, for details, see [Create a storage account](../../../../../storage/common/storage-account-create.md?tabs=azure-portal). You'll need to record your storage **connection string** and **container name** for this quickstart.
2120
- Subscribe to events via an [Azure Event Grid](../../../../../event-grid/overview.md) Web hook.
2221
- Download the [Java SDK](https://dev.azure.com/azure-sdk/public/_artifacts/feed/azure-sdk-for-java/maven/com.azure%2Fazure-communication-callingserver/overview/1.0.0-alpha.20220829.1 )
23-
- This Quickstart assumes you have some experience using the [Calling CLient SDK](https://docs.microsoft.com/azure/communication-services/quickstarts/voice-video-calling/get-started-with-video-calling?pivots=platform-web). **Important**: To fetch serverCallId from Calling SDK, refer to the JavaScript example in the **Appendix** at the end of this document.
24-
- Make sure to provide the Azure Communication Services Call Recording team with your **immutable azure resource ID** to be whitelisted during the private preview tests.
22+
- This quickstart assumes you have some experience using the [Calling Client SDK](../../get-started-with-video-calling.md). **Important**: To fetch `serverCallId` from Calling SDK, refer to the [JavaScript](../../get-server-call-id.md) example.
23+
- Make sure to provide the Azure Communication Services Call Recording team with your [immutable Azure resource ID](../../get-resource-id.md) to be allowlisted during the **private preview** tests.
2524

2625

2726
## 1. Create a Call Automation client
@@ -37,9 +36,9 @@ CallAutomationClient callAutomationClient = new CallAutomationClientBuilder()
3736
## 2. Start recording session with StartRecordingOptions using 'startRecordingWithResponse' server API
3837

3938
Use the server call ID received during initiation of the call.
40-
RecordingContent is used to pass the recording content type. Use AUDIO
41-
RecordingChannel is used to pass the recording channel type. Use UNMIXED.
42-
RecordingFormat is used to pass the format of the recording. Use WAV.
39+
- RecordingContent is used to pass the recording content type. Use AUDIO
40+
- RecordingChannel is used to pass the recording channel type. Use UNMIXED.
41+
- RecordingFormat is used to pass the format of the recording. Use WAV.
4342

4443
```java
4544
StartRecordingOptions recordingOptions = new StartRecordingOptions(new ServerCallLocator("<serverCallId>"))
@@ -111,7 +110,7 @@ Below is an example of the event schema.
111110
"recordingStorageInfo": {
112111
"recordingChunks": [
113112
{
114-
"documentId": string, // Document id for retrieving from AMS storage
113+
"documentId": string, // Document id for the recording chunk
115114
"contentLocation": string, //Azure Communication Services URL where the content is located
116115
"metadataLocation": string, // Azure Communication Services URL where the metadata for this chunk is located
117116
"deleteLocation": string, // Azure Communication Services URL to use to delete all content, including recording and metadata.
@@ -132,11 +131,11 @@ Below is an example of the event schema.
132131
```
133132

134133
Use `downloadToWithResponse` method of `CallRecording` class for downloading the recorded media. Following are the supported parameters for `downloadToWithResponse` method:
135-
`contentLocation`: Azure Communication Services URL where the content is located.
136-
`destinationPath` : File location.
137-
`parallelDownloadOptions`: An optional ParallelDownloadOptions object to modify how the - parallel download will work.
138-
`overwrite`: True to overwrite the file if it exists.
139-
`context`: A Context representing the request context.
134+
- `contentLocation`: Azure Communication Services URL where the content is located.
135+
- `destinationPath` : File location.
136+
- `parallelDownloadOptions`: An optional ParallelDownloadOptions object to modify how the - parallel download will work.
137+
- `overwrite`: True to overwrite the file if it exists.
138+
- `context`: A Context representing the request context.
140139

141140

142141
```java
@@ -154,80 +153,10 @@ The content location and document IDs for the recording files can be fetched fro
154153
## 7. Delete recording content using ‘deleteRecordingWithResponse’ server API.
155154

156155
Use `deleteRecordingWithResponse` method of `CallRecording` class for deleting the recorded media. Following are the supported parameters for `deleteRecordingWithResponse` method:
157-
`deleteLocation`: Azure Communication Services URL where the content to delete is located.
158-
`context`: A Context representing the request context.
156+
- `deleteLocation`: Azure Communication Services URL where the content to delete is located.
157+
- `context`: A Context representing the request context.
159158

160159
```
161160
Response<Void> deleteResponse = callAutomationClient.getCallRecording().deleteRecordingWithResponse(deleteLocation, context);
162161
```
163-
The delete location for the recording can be fetched from the `deleteLocation` field of the EventGrid event.
164-
165-
166-
## Appendix
167-
168-
### A - Getting serverCallId as a requirement for call recording server APIs from JavaScript application
169-
170-
Call recording is an extended feature of the core Call API. You first need to import calling Features from the Calling SDK.
171-
172-
```JavaScript
173-
import { Features} from "@azure/communication-calling";
174-
```
175-
Then you can get the recording feature API object from the call instance:
176-
177-
```JavaScript
178-
const callRecordingApi = call.feature(Features.Recording);
179-
```
180-
Subscribe to recording changes:
181-
182-
```JavaScript
183-
const recordingStateChanged = () => {
184-
let recordings = callRecordingApi.recordings;
185-
186-
let state = SDK.RecordingState.None;
187-
if (recordings.length > 0) {
188-
state = recordings.some(r => r.state == SDK.RecordingState.Started)
189-
? SDK.RecordingState.Started
190-
: SDK.RecordingState.Paused;
191-
}
192-
193-
console.log(`RecordingState: ${state}`);
194-
}
195-
196-
const recordingsChangedHandler = (args: { added: SDK.RecordingInfo[], removed: SDK.RecordingInfo[]}) => {
197-
args.added?.forEach(a => {
198-
a.on('recordingStateChanged', recordingStateChanged);
199-
});
200-
201-
args.removed?.forEach(r => {
202-
r.off('recordingStateChanged', recordingStateChanged);
203-
});
204-
205-
recordingStateChanged();
206-
};
207-
208-
callRecordingApi.on('recordingsUpdated', recordingsChangedHandler);
209-
```
210-
Get server call ID which can be used to start/stop/pause/resume recording sessions.
211-
Once the call is connected, use the `getServerCallId` method to get the server call ID.
212-
213-
```JavaScript
214-
callAgent.on('callsUpdated', (e: { added: Call[]; removed: Call[] }): void => {
215-
e.added.forEach((addedCall) => {
216-
addedCall.on('stateChanged', (): void => {
217-
if (addedCall.state === 'Connected') {
218-
addedCall.info.getServerCallId().then(result => {
219-
dispatch(setServerCallId(result));
220-
}).catch(err => {
221-
console.log(err);
222-
});
223-
}
224-
});
225-
});
226-
});
227-
```
228-
229-
### B - How to find the Azure Resource ID
230-
231-
In order to get your Resource ID whitelisted, please send your Immutable Azure Resource ID to the Call Recording Team. For reference see the image below.
232-
233-
![Call recording how to get resource ID](../../media/call-recording/immutable-resource-id.png)
162+
The delete location for the recording can be fetched from the `deleteLocation` field of the Event Grid event.

0 commit comments

Comments
 (0)