Skip to content

Commit 612ac33

Browse files
committed
edit pass: comm-services-samples-tutorials
1 parent d26105d commit 612ac33

File tree

7 files changed

+42
-42
lines changed

7 files changed

+42
-42
lines changed

articles/communication-services/how-tos/call-automation/actions-for-call-control.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ services: azure-communication-services
1414

1515
# Control and steer calls with Call Automation
1616

17-
Call Automation uses a REST API interface to receive requests for actions and provide responses to notify whether the request was successfully submitted or not. Because of the asynchronous nature of calling, most actions have corresponding events that are triggered when the action completes successfully or fails. This article covers the actions that are available for steering calls, like `CreateCall`, `Transfer`, and `Redirect`, and managing participants. Sample code shows how to invoke the particular action. Sequence diagrams describe the events that are expected after you invoke an action. The diagrams help you visualize how to program your service application with Call Automation.
17+
Call Automation uses a REST API interface to receive requests for actions and provide responses to notify whether the request was successfully submitted or not. Because of the asynchronous nature of calling, most actions have corresponding events that are triggered when the action finishes successfully or fails. This article covers the actions that are available for steering calls, like `CreateCall`, `Transfer`, and `Redirect`, and managing participants. Sample code shows how to invoke the particular action. Sequence diagrams describe the events that are expected after you invoke an action. The diagrams help you visualize how to program your service application with Call Automation.
1818

1919
Call Automation supports other actions to manage call media and recording that have separate articles.
2020

@@ -23,9 +23,9 @@ Call Automation supports other actions to manage call media and recording that h
2323
- Read the Call Automation [concepts article](../../concepts/call-automation/call-automation.md#call-actions) that describes the action-event programming model and event callbacks.
2424
- Learn about the [user identifiers](../../concepts/identifiers.md#the-communicationidentifier-type) like `CommunicationUserIdentifier` and `PhoneNumberIdentifier` that are used in this article.
2525

26-
For all the code samples, `client` is the `CallAutomationClient` object that you can create, as shown, and `callConnection` is the `CallConnection` object that you obtain from the `Answer` or `CreateCall` response. You can also obtain it from callback events that your application receives.
26+
For all the code samples, `client` is the `CallAutomationClient` object that you can create, as shown. Also, `callConnection` is the `CallConnection` object that you obtain from the `Answer` or `CreateCall` response. You can also obtain it from callback events that your application receives.
2727

28-
## [csharp](#tab/csharp)
28+
## [C#](#tab/csharp)
2929

3030
```csharp
3131
var client = new CallAutomationClient("<resource_connection_string>");
@@ -58,7 +58,7 @@ When you call a public-switched telephone network (PSTN) endpoint, you also need
5858

5959
To place a call to an Azure Communication Services user, you need to provide a `CommunicationUserIdentifier` object instead of `PhoneNumberIdentifier`.
6060

61-
### [csharp](#tab/csharp)
61+
### [C#](#tab/csharp)
6262

6363
```csharp
6464
Uri callbackUri = new Uri("https://<myendpoint>/Events"); //the callback endpoint where you want to receive subsequent events
@@ -104,7 +104,7 @@ call_connection_properties = client.create_call(call_invite, callback_uri)
104104
-----
105105
When you make a group call that includes a phone number, you must provide a phone number to use as a caller ID number for the PSTN endpoint.
106106

107-
### [csharp](#tab/csharp)
107+
### [C#](#tab/csharp)
108108

109109
```csharp
110110
Uri callbackUri = new Uri("https://<myendpoint>/Events"); //the callback endpoint where you want to receive subsequent events
@@ -175,7 +175,7 @@ If the call fails, you receive a `CallDisconnected` event and a `CreateCallFaile
175175
The connect action enables your service to establish a connection with an ongoing call and take actions on it. This capability is useful to manage a Rooms call or when client applications start a 1:1 or group call in which Call Automation isn't a part. Use the `CallLocator` property to establish the connection. The type options are `ServerCallLocator`, `GroupCallLocator`, and `RoomCallLocator`. You can find these IDs when the call is originally established or a Room is created, and can also be published as part of [CallStarted](./../../../event-grid/communication-services-voice-video-events.md#microsoftcommunicationcallstarted) event.
176176

177177
To connect to any 1:1 or group call, use `ServerCallLocator`. If you used `GroupCallId` to start a call, you can also use `GroupCallLocator`.
178-
### [csharp](#tab/csharp)
178+
### [C#](#tab/csharp)
179179

180180
```csharp
181181
Uri callbackUri = new Uri("https://<myendpoint>/Events"); //the callback endpoint where you want to receive subsequent events
@@ -211,7 +211,7 @@ call_connection_properties = client.connect_call(call_locator=server_call_locato
211211

212212
To connect to a Rooms call, use `RoomCallLocator`, which takes `RoomId`. Learn more about [Rooms](./../../concepts/rooms/room-concept.md) and how you can use the Call Automation API to [manage an ongoing Rooms call](./../../quickstarts/rooms/manage-rooms-call.md).
213213

214-
### [csharp](#tab/csharp)
214+
### [C#](#tab/csharp)
215215

216216
```csharp
217217
Uri callbackUri = new Uri("https://<myendpoint>/Events"); //the callback endpoint where you want to receive subsequent events
@@ -258,7 +258,7 @@ At any point after a successful connection, if your service disconnects from thi
258258

259259
After you subscribe to receive [incoming call notifications](../../concepts/call-automation/incoming-call-notification.md) to your resource, you can answer an incoming call. When you answer a call, you need to provide a callback URL. Azure Communication Services posts all subsequent events about this call to that URL.
260260

261-
### [csharp](#tab/csharp)
261+
### [C#](#tab/csharp)
262262

263263
```csharp
264264
string incomingCallContext = "<IncomingCallContext_From_IncomingCall_Event>";
@@ -312,7 +312,7 @@ If the answer operation fails, you receive an `AnswerFailed` event with error co
312312

313313
You can reject an incoming call. Reasons for the rejection are `None`, `Busy`, or `Forbidden`. If nothing is provided, the default is `None`.
314314

315-
# [csharp](#tab/csharp)
315+
# [C#](#tab/csharp)
316316

317317
```csharp
318318
string incomingCallContext = "<IncomingCallContext_From_IncomingCall_Event>";
@@ -357,7 +357,7 @@ No events are published for the reject action.
357357

358358
You can redirect an incoming call to another endpoint without answering it. Redirecting a call removes your application's ability to control the call by using Call Automation.
359359

360-
# [csharp](#tab/csharp)
360+
# [C#](#tab/csharp)
361361

362362
```csharp
363363
string incomingCallContext = "<IncomingCallContext_From_IncomingCall_Event>";
@@ -397,7 +397,7 @@ client.redirect_call(
397397
-----
398398
To redirect the call to a phone number, construct the target and caller ID with `PhoneNumberIdentifier`.
399399

400-
# [csharp](#tab/csharp)
400+
# [C#](#tab/csharp)
401401

402402
```csharp
403403
var callerIdNumber = new PhoneNumberIdentifier("+16044561234"); // This is the Azure Communication Services provisioned phone number for the caller
@@ -440,7 +440,7 @@ No events are published for redirect. If the target is an Azure Communication Se
440440

441441
When your application answers a call or places an outbound call to an endpoint, your app can transfer the endpoint to another destination endpoint. Transferring a 1:1 call removes your application from the call and removes its ability to control the call by using Call Automation. The call invite to the target shows the caller ID of the endpoint being transferred. Providing a custom caller ID isn't supported.
442442

443-
# [csharp](#tab/csharp)
443+
# [C#](#tab/csharp)
444444

445445
```csharp
446446
var transferDestination = new CommunicationUserIdentifier("<user_id>");
@@ -499,7 +499,7 @@ result = call_connection_client.transfer_call_to_participant(
499499
-----
500500
When your application answers a group call, places an outbound group call to an endpoint, or adds a participant to a 1:1 call, the app can transfer the endpoint from the call to another destination endpoint, except for the Call Automation endpoint. Transferring a participant in a group call removes the endpoint being transferred from the call. The call invite to the target shows the caller ID of the endpoint being transferred. Providing a custom caller ID isn't supported.
501501

502-
# [csharp](#tab/csharp)
502+
# [C#](#tab/csharp)
503503

504504
```csharp
505505
// Transfer User
@@ -640,7 +640,7 @@ The sequence diagram shows the expected flow when your application places an out
640640

641641
You can add a participant such as an Azure Communication Services user or a phone number to an existing call. When you add a phone number, it's mandatory to provide a caller ID. This caller ID is shown on call notification to the added participant.
642642

643-
# [csharp](#tab/csharp)
643+
# [C#](#tab/csharp)
644644

645645
```csharp
646646
// Add user
@@ -772,7 +772,7 @@ Next, `AddParticipant` publishes an `AddParticipantSucceeded` or `AddParticipant
772772

773773
## Cancel an add participant request
774774

775-
# [csharp](#tab/csharp)
775+
# [C#](#tab/csharp)
776776

777777
```csharp
778778
// add a participant
@@ -840,7 +840,7 @@ call_connection_client.cancel_add_participant_operation(result.invitation_id, op
840840

841841
## Remove a participant from a call
842842

843-
# [csharp](#tab/csharp)
843+
# [C#](#tab/csharp)
844844

845845
```csharp
846846
var removeThisUser = new CommunicationUserIdentifier("<user_id>");
@@ -894,7 +894,7 @@ result = call_connection_client.remove_participant(remove_this_user, operation_c
894894

895895
You can use the `hangUp` action to remove your application from the call or to terminate a group call by setting the `forEveryone` parameter to `true`. For a 1:1 call, `hangUp` terminates the call with the other participant by default.
896896

897-
# [csharp](#tab/csharp)
897+
# [C#](#tab/csharp)
898898

899899
```csharp
900900
_ = await callConnection.HangUpAsync(forEveryone: true);
@@ -919,11 +919,11 @@ call_connection_client.hang_up(is_for_everyone=True)
919919
```
920920

921921
-----
922-
The `CallDisconnected` event is published after the `hangUp` action successfully completes.
922+
The `CallDisconnected` event is published after the `hangUp` action successfully finishes.
923923

924924
## Get information about a call participant
925925

926-
# [csharp](#tab/csharp)
926+
# [C#](#tab/csharp)
927927

928928
```csharp
929929
CallParticipant participantInfo = await callConnection.GetParticipantAsync(new CommunicationUserIdentifier("<user_id>"));
@@ -953,7 +953,7 @@ participant_info = call_connection_client.get_participant(
953953

954954
## Get information about all call participants
955955

956-
# [csharp](#tab/csharp)
956+
# [C#](#tab/csharp)
957957

958958
```csharp
959959
List<CallParticipant> participantList = (await callConnection.GetParticipantsAsync()).Value.ToList();
@@ -981,7 +981,7 @@ participant_list = call_connection_client.list_participants()
981981

982982
## Get the latest information about a call
983983

984-
# [csharp](#tab/csharp)
984+
# [C#](#tab/csharp)
985985

986986
```csharp
987987
CallConnectionProperties callConnectionProperties = await callConnection.GetCallConnectionPropertiesAsync();

articles/communication-services/how-tos/call-automation/control-mid-call-media-actions.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ services: azure-communication-services
1414

1515
# Control mid-call media actions with Call Automation
1616

17-
Call Automation uses a REST API interface to receive requests for actions and provide responses to notify whether the request was successfully submitted or not. Because of the asynchronous nature of calling, most actions have corresponding events that are triggered when the action completes successfully or fails. This article covers the actions that are available to developers during calls, like `SendDTMF` and `ContinuousDtmfRecognition`. Actions are accompanied with sample code on how to invoke the particular action.
17+
Call Automation uses a REST API interface to receive requests for actions and provide responses to notify whether the request was successfully submitted or not. Because of the asynchronous nature of calling, most actions have corresponding events that are triggered when the action finishes successfully or fails. This article covers the actions that are available to developers during calls, like `SendDTMF` and `ContinuousDtmfRecognition`. Actions are accompanied with sample code on how to invoke the particular action.
1818

1919
Call Automation supports other actions to manage calls and recordings that aren't included in this article.
2020

@@ -29,7 +29,7 @@ Call Automation supports other actions to manage calls and recordings that aren'
2929

3030
For all the code samples, `client` is the `CallAutomationClient` object that you can create, as shown, and `callConnection` is the `CallConnection` object that you obtain from the `Answer` or `CreateCall` response. You can also obtain it from callback events that your application receives.
3131

32-
### [csharp](#tab/csharp)
32+
### [C#](#tab/csharp)
3333

3434
```csharp
3535
var callAutomationClient = new CallAutomationClient("<Azure Communication Services connection string>");
@@ -67,7 +67,7 @@ You can send dual-tone multifrequency (DTMF) tones to an external participant. T
6767
6868
Send a list of DTMF tones to an external participant.
6969
70-
### [csharp](#tab/csharp)
70+
### [C#](#tab/csharp)
7171
7272
```csharp
7373
var tones =new DtmfTone[] { DtmfTone.One, DtmfTone.Two, DtmfTone.Three, DtmfTone.Pound };
@@ -124,7 +124,7 @@ When your application sends these DTMF tones, you receive event updates. You can
124124
125125
An example of a `SendDtmfTonesCompleted` event:
126126
127-
### [csharp](#tab/csharp)
127+
### [C#](#tab/csharp)
128128
129129
``` csharp
130130
if (acsEvent is SendDtmfTonesCompleted sendDtmfCompleted)
@@ -160,7 +160,7 @@ if event.type == "Microsoft.Communication.SendDtmfTonesCompleted":
160160
161161
An example of a `SendDtmfTonesFailed` event:
162162
163-
### [csharp](#tab/csharp)
163+
### [C#](#tab/csharp)
164164
165165
```csharp
166166
if (acsEvent is SendDtmfTonesFailed sendDtmfFailed)
@@ -206,7 +206,7 @@ You can subscribe to receive continuous DTMF tones throughout the call. Your app
206206
207207
Start detecting DTMF tones sent by a participant.
208208
209-
### [csharp](#tab/csharp)
209+
### [C#](#tab/csharp)
210210
211211
```csharp
212212
await callAutomationClient.GetCallConnection(callConnectionId)
@@ -258,7 +258,7 @@ When your application no longer wants to receive DTMF tones from the participant
258258
259259
Stop detecting DTMF tones sent by a participant.
260260
261-
### [csharp](#tab/csharp)
261+
### [C#](#tab/csharp)
262262
263263
```csharp
264264
var continuousDtmfRecognitionOptions =newContinuousDtmfRecognitionOptions(newPhoneNumberIdentifier(callerPhonenumber))
@@ -312,7 +312,7 @@ Your application receives event updates when these actions either succeed or fai
312312
313313
An example of how you can handle a DTMF tone that was successfully detected.
314314
315-
### [csharp](#tab/csharp)
315+
### [C#](#tab/csharp)
316316
317317
``` csharp
318318
if (acsEvent is ContinuousDtmfRecognitionToneReceived continuousDtmfRecognitionToneReceived)
@@ -362,7 +362,7 @@ Azure Communication Services provides you with `SequenceId` as part of the `Cont
362362
363363
An example of what to do when DTMF tone detection fails.
364364
365-
### [csharp](#tab/csharp)
365+
### [C#](#tab/csharp)
366366
367367
``` csharp
368368
if (acsEvent is ContinuousDtmfRecognitionToneFailed continuousDtmfRecognitionToneFailed)
@@ -407,7 +407,7 @@ if event.type == "Microsoft.Communication.ContinuousDtmfRecognitionToneFailed":
407407
408408
An example of what to do when continuous DTMF recognition stops. Maybe your application invoked the `StopContinuousDtmfRecognitionAsync` event or the call ended.
409409
410-
### [csharp](#tab/csharp)
410+
### [C#](#tab/csharp)
411411
412412
``` csharp
413413
if (acsEvent is ContinuousDtmfRecognitionStopped continuousDtmfRecognitionStopped)
@@ -445,7 +445,7 @@ if event.type == "Microsoft.Communication.ContinuousDtmfRecognitionStopped":
445445
446446
The hold action allows developers to temporarily pause a conversation between a participant and a system or agent. This capability is useful in scenarios where the participant needs to be transferred to another agent or department or when the agent needs to consult a supervisor before continuing the conversation. During this time, you can choose to play audio to the participant who is on hold.
447447
448-
### [csharp](#tab/csharp)
448+
### [C#](#tab/csharp)
449449
450450
```csharp
451451
// Option 1: Hold without additional options
@@ -468,7 +468,7 @@ await callMedia.HoldAsync(holdOptions);
468468
*/
469469
```
470470
471-
### [java](#tab/java)
471+
### [Java](#tab/java)
472472
473473
```java
474474
// Option 1: Hold with options
@@ -524,7 +524,7 @@ call_connection_client.hold(
524524
525525
The unhold action allows developers to resume a conversation between a participant and a system or agent that was previously paused. When the participant is taken off hold, they can hear the system or agent again.
526526
527-
### [csharp](#tab/csharp)
527+
### [C#](#tab/csharp)
528528
529529
``` csharp
530530
var unHoldOptions = new UnholdOptions(target)
@@ -541,7 +541,7 @@ var UnHoldParticipant = await callMedia.UnholdAsync(target);
541541
*/
542542
```
543543
544-
### [java](#tab/java)
544+
### [Java](#tab/java)
545545
546546
``` java
547547
// Option 1

articles/communication-services/how-tos/call-automation/custom-context.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ The maximum length of a VoIP header key is 64 characters. These headers can be s
4141

4242
## Add custom context when you invite a participant
4343

44-
### [csharp](#tab/csharp)
44+
### [C#](#tab/csharp)
4545

4646
```csharp
4747
// Invite an Azure Communication Services user and include one VOIP header
@@ -126,7 +126,7 @@ result = call_connection_client.add_participant(
126126
-----
127127
## Add a custom context during a call transfer
128128

129-
### [csharp](#tab/csharp)
129+
### [C#](#tab/csharp)
130130

131131
```csharp
132132
//Transfer to an Azure Communication Services user and include one VOIP header
@@ -219,7 +219,7 @@ Currently, transfer of a VoIP call to a phone number isn't supported.
219219
-----
220220
## Read custom context from an incoming call event
221221

222-
### [csharp](#tab/csharp)
222+
### [C#](#tab/csharp)
223223

224224
```csharp
225225
AcsIncomingCallEventData incomingEvent = <incoming call event from Event Grid>;

articles/communication-services/how-tos/call-automation/includes/secure-webhook-endpoint-csharp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ms.author: richardcho
1515

1616
Each mid-call webhook callback sent by Call Automation uses a signed JSON Web Token (JWT) in the Authentication header of the inbound HTTPS request. You can use standard OpenID Connect (OIDC) JWT validation techniques to ensure the integrity of the token. The lifetime of the JWT is five minutes, and a new token is created for every event sent to the callback URI.
1717

18-
1. Obtain the OpenID configuration URL: <https://acscallautomation.communication.azure.com/calling/.well-known/acsopenidconfiguration>
18+
1. Obtain the OpenID configuration URL: `<https://acscallautomation.communication.azure.com/calling/.well-known/acsopenidconfiguration>`
1919
1. Install the [Microsoft.AspNetCore.Authentication.JwtBearer NuGet](https://www.nuget.org/packages/Microsoft.AspNetCore.Authentication.JwtBearer) package.
2020
1. Configure your application to validate the JWT by using the NuGet package and the configuration of your Azure Communication Services resource. You need the `audience` value as it appears in the JWT payload.
2121
1. Validate the issuer, the audience, and the JWT:

articles/communication-services/how-tos/call-automation/includes/secure-webhook-endpoint-java.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ms.author: richardcho
1515

1616
Each mid-call webhook callback sent by Call Automation uses a signed JSON Web Token (JWT) in the Authentication header of the inbound HTTPS request. You can use standard OpenID Connect (OIDC) JWT validation techniques to ensure the integrity of the token. The lifetime of the JWT is five minutes, and a new token is created for every event sent to the callback URI.
1717

18-
1. Obtain the OpenID configuration URL: <https://acscallautomation.communication.azure.com/calling/.well-known/acsopenidconfiguration>
18+
1. Obtain the OpenID configuration URL: `<https://acscallautomation.communication.azure.com/calling/.well-known/acsopenidconfiguration>`
1919
1. The following sample uses the Spring framework, which is created by using [spring initializr](https://start.spring.io/) with Maven as the project build tool.
2020
1. Add the following dependencies in your `pom.xml`:
2121

articles/communication-services/how-tos/call-automation/includes/secure-webhook-endpoint-javascript.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ms.author: richardcho
1515

1616
Each mid-call webhook callback sent by Call Automation uses a signed JSON Web Token (JWT) in the Authentication header of the inbound HTTPS request. You can use standard OpenID Connect (OIDC) JWT validation techniques to ensure the integrity of the token. The lifetime of the JWT is five minutes, and a new token is created for every event sent to the callback URI.
1717

18-
1. Obtain the OpenID configuration URL: <https://acscallautomation.communication.azure.com/calling/.well-known/acsopenidconfiguration>
18+
1. Obtain the OpenID configuration URL: `<https://acscallautomation.communication.azure.com/calling/.well-known/acsopenidconfiguration>`
1919
1. Install the following packages:
2020
- [express npm](https://www.npmjs.com/package/express)
2121
- [jwks-rsa npm](https://www.npmjs.com/package/jwks-rsa)

0 commit comments

Comments
 (0)