Skip to content

Commit b848c90

Browse files
committed
Added Rooms recordings into a list of supported actions
1 parent 6d330fe commit b848c90

File tree

1 file changed

+99
-0
lines changed

1 file changed

+99
-0
lines changed

articles/communication-services/quickstarts/rooms/manage-rooms-call.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,105 @@ result = call_connection_client.send_dtmf_tones(
215215
```
216216
-----
217217

218+
### Call Recording
219+
ACS Rooms supports recording capabilities (start, stop, pause, resume, etc.) provided by Call Automation. The following code snippets are used to start/stop/pause/resume a recording in a room call. However, please refer to [Call Automation recording](../../concepts/voice-video-calling/call-recording#get-full-control-over-your-recordings-with-our-call-recording-apis) for a complete list of actions.
220+
221+
### [csharp](#tab/csharp)
222+
```csharp
223+
// Start recording
224+
StartRecordingOptions recordingOptions = new StartRecordingOptions(new ServerCallLocator("<ServerCallId>"))
225+
{
226+
RecordingContent = RecordingContent.Audio,
227+
RecordingChannel = RecordingChannel.Unmixed,
228+
RecordingFormat = RecordingFormat.Wav,
229+
RecordingStateCallbackUri = new Uri("<CallbackUri>"),
230+
RecordingStorage = RecordingStorage.CreateAzureBlobContainerRecordingStorage(new Uri("<YOUR_STORAGE_CONTAINER_URL>"))
231+
};
232+
Response<RecordingStateResult> response = await callAutomationClient.GetCallRecording()
233+
.StartAsync(recordingOptions);
234+
235+
// Stop recording using recordingId received in response of start recording.
236+
var stopRecording = await callAutomationClient.GetCallRecording().StopAsync(recordingId);
237+
238+
// Pause recording using recordingId received in response of start recording.
239+
var pauseRecording = await callAutomationClient.GetCallRecording ().PauseAsync(recordingId);
240+
241+
// Resume recording using recordingId received in response of start recording.
242+
var resumeRecording = await callAutomationClient.GetCallRecording().ResumeAsync(recordingId);
243+
244+
```
245+
### [Java](#tab/java)
246+
```java
247+
// Start recording
248+
StartRecordingOptions recordingOptions = new StartRecordingOptions(new ServerCallLocator("<serverCallId>"))
249+
.setRecordingChannel(RecordingChannel.UNMIXED)
250+
.setRecordingFormat(RecordingFormat.WAV)
251+
.setRecordingContent(RecordingContent.AUDIO)
252+
.setRecordingStateCallbackUrl("<recordingStateCallbackUrl>");
253+
254+
Response<RecordingStateResult> response = callAutomationClient.getCallRecording()
255+
.startWithResponse(recordingOptions, null);
256+
257+
// Stop recording using recordingId received in response of start recording
258+
Response<Void> response = callAutomationClient.getCallRecording()
259+
.stopWithResponse(recordingId, null);
260+
261+
// Pause recording using recordingId received in response of start recording
262+
Response<Void> response = callAutomationClient.getCallRecording()
263+
.pauseWithResponse(recordingId, null);
264+
265+
// Resume recording using recordingId received in response of start recording
266+
Response<Void> response = callAutomationClient.getCallRecording()
267+
.resumeWithResponse(recordingId, null);
268+
269+
```
270+
### [JavaScript](#tab/javascript)
271+
```javascript
272+
// Start recording
273+
var locator: CallLocator = { id: "<ServerCallId>", kind: "serverCallLocator" };
274+
275+
var options: StartRecordingOptions =
276+
{
277+
callLocator: locator,
278+
recordingContent: "audio",
279+
recordingChannel:"unmixed",
280+
recordingFormat: "wav",
281+
recordingStateCallbackEndpointUrl: "<CallbackUri>"
282+
};
283+
var response = await callAutomationClient.getCallRecording().start(options);
284+
285+
// Stop recording using recordingId received in response of start recording
286+
var stopRecording = await callAutomationClient.getCallRecording().stop(recordingId);
287+
288+
// Pause recording using recordingId received in response of start recording
289+
var pauseRecording = await callAutomationClient.getCallRecording().pause(recordingId);
290+
291+
// Resume recording using recordingId received in response of start recording.
292+
var resumeRecording = await callAutomationClient.getCallRecording().resume(recordingId);
293+
294+
```
295+
### [Python](#tab/python)
296+
```python
297+
# Start recording
298+
response = call_automation_client.start_recording(call_locator=ServerCallLocator(server_call_id),
299+
recording_content_type = RecordingContent.Audio,
300+
recording_channel_type = RecordingChannel.Unmixed,
301+
recording_format_type = RecordingFormat.Wav,
302+
recording_state_callback_url = "<CallbackUri>")
303+
304+
# Stop recording using recording_id received in response of start recording
305+
stop_recording = call_automation_client.stop_recording(recording_id = recording_id)
306+
307+
# Pause recording using recording_id received in response of start recording
308+
pause_recording = call_automation_client.pause_recording(recording_id = recording_id)
309+
310+
# Resume recording using recording_id received in response of start recording
311+
resume_recording = call_automation_client.resume_recording(recording_id = recording_id)
312+
```
313+
-----
314+
315+
316+
218317
### Terminate a Call
219318
Call Automation SDKs provides Hang Up action which can be used to terminate a call. CallDisconnected event is published once the Hang Up action has completed successfully.
220319

0 commit comments

Comments
 (0)