From 3b5a4822851de068208d219eb2c612254e60ff1d Mon Sep 17 00:00:00 2001 From: Arif Saikat <71465659+arifsaikat-microsoft@users.noreply.github.com> Date: Sun, 13 Jun 2021 03:37:01 -0700 Subject: [PATCH 1/2] pr review fixes --- .../CHANGELOG.md | 8 +-- .../README.md | 52 +++++++------------ .../callingserver/CallConnectionAsync.java | 9 ++-- .../ConversationClientReadmeSamples.java | 2 +- .../callingserver/ReadmeSamples.java | 4 +- 5 files changed, 33 insertions(+), 42 deletions(-) diff --git a/sdk/communication/azure-communication-callingserver/CHANGELOG.md b/sdk/communication/azure-communication-callingserver/CHANGELOG.md index 4c3dbd241a61..8661754c510b 100644 --- a/sdk/communication/azure-communication-callingserver/CHANGELOG.md +++ b/sdk/communication/azure-communication-callingserver/CHANGELOG.md @@ -1,16 +1,16 @@ # Release History ## 1.0.0-beta.1 (Unreleased) -This is the first release of Azure Communication Calling Server Service. For more information, please see the [README][read_me]. +This is the first release of Azure Communication Calling Server SDK. For more information, please see the [README][read_me]. This is a Public Preview version, so breaking changes are possible in subsequent releases as we improve the product. To provide feedback, please submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). ### Features Added -- Create outbound call to an Azure Communication Service User or a phone number. +- Create outbound call to an Azure Communication Service user or a phone number. - Hangup and delete the existing call. - Play audio in the call. -- Outbound apis for Call Recording including start, pause, resume and stop. -- Subscribe to tone and receive dtmf via events. +- Outbound APIs for call recording including start, pause, resume and stop. +- Subscribe to tone and receive tone selection via events. - Invite and remove participants from the call. diff --git a/sdk/communication/azure-communication-callingserver/README.md b/sdk/communication/azure-communication-callingserver/README.md index d20018b3ead5..6e993e33f682 100644 --- a/sdk/communication/azure-communication-callingserver/README.md +++ b/sdk/communication/azure-communication-callingserver/README.md @@ -28,7 +28,7 @@ This package contains a Java SDK for Azure Communication CallingServer Service. ## Key concepts -At a high level the Azure Communication CallingServer API will support 2 kinds of scenarios: +At a high level the Azure Communication CallingServer API will support two kinds of scenarios: - In-call app: Contoso server app is a participant in the call. @@ -42,9 +42,10 @@ Based on if the Contoso app join a call or not, APIs can be divided into two cat ## Examples -### Create CallClient +### Authenticate the client -Once you initialized a `CallClient` class, you can do the following server calling operations: + +You can provide the connection string using the connectionString() function of `CallingServerClientBuilder`. Once you initialized a `CallingServerClient` class, you can do the different server calling operations. ```java // Your connectionString retrieved from your Azure Communication Service @@ -56,9 +57,9 @@ builder.connectionString(connectionString); CallingServerClient callingServerClient = builder.buildClient(); ``` -### Create, AddParticipant, Hangup and Delete a call +### Create call, Add participant and Hangup a call -Create a Call: +#### Create a Call: ```java CommunicationIdentifier source = new CommunicationUserIdentifier(""); @@ -83,14 +84,14 @@ CreateCallOptions createCallOptions = new CreateCallOptions( CallConnection callConnection = callingServerClient.createCallConnection(source, targets, createCallOptions); ``` -Add a participant to a Call: +#### Add a participant to a Call: ```java -CommunicationIdentifier thirdCallee = new CommunicationUserIdentifier(""); -callConnection.addParticipant(thirdCallee, "ACS User 2", ""); +CommunicationIdentifier thirdCallee = new CommunicationUserIdentifier(""); +callConnection.addParticipant(thirdCallee, "ACS User 3", ""); ``` -Hangup a Call: +#### Hangup a Call: ```java callConnection.hangup(); @@ -98,19 +99,7 @@ callConnection.hangup(); ### Start, Stop, Pause, Resume, and Get a recording -Create a ConverationClient: - -```java -// Your connectionString retrieved from your Azure Communication Service -String connectionString = "endpoint=https://.communication.azure.com/;accesskey="; - -// Initialize the calling server client -final CallingServerClientBuilder builder = new CallingServerClientBuilder(); -builder.endpoint(endpoint).connectionString(connectionString); -CallingServerClient callingServerClient = builder.buildClient(); -``` - -Start a Recording: +#### Start a Recording: ```java String serverCallId = ""; @@ -120,35 +109,34 @@ StartCallRecordingResponse response = serverCall.startRecording(recordingStateCa String recordingId = response.getRecordingId(); ``` -Pause a Recording: +#### Pause a Recording: ```java serverCall.pauseRecording(recordingId); ``` -Resume a Recording: +#### Resume a Recording: ```java serverCall.resumeRecording(recordingId); ``` -Stop a Recording: +#### Stop a Recording: ```java serverCall.stopRecording(recordingId); ``` -Get the Recording State: - +#### Get the Recording State: + ```java -CallRecordingStateResponse callRecordingStateResponse = - conversationClient.getRecordingState(conversationId, recordingId); +CallRecordingStateResult callRecordingStateResult = serverCall.getRecordingState(recordingId); ``` -### Play Audio Notification in Call +### Play Audio in Call -Play Audio: - +#### Play Audio: + ```java String audioFileUri = ""; String audioFileId = ""; diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallConnectionAsync.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallConnectionAsync.java index c4e50e5f26fd..faa4f1cf868d 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallConnectionAsync.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallConnectionAsync.java @@ -148,7 +148,8 @@ Mono playAudioInternal(PlayAudioRequest playAudioRequest) { * @param loop The flag indicating whether audio file needs to be played in loop or not. * @param audioFileId An id for the media in the AudioFileUri, using which we cache the media. * @param callbackUri call back uri to receive notifications. - * @param operationContext The value to identify context of the operation. + * @param operationContext The value to identify context of the operation. This is used to co-relate other + * communications related to this operation * @return the response payload for play audio operation. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -284,7 +285,8 @@ Mono> hangupWithResponse(Context context) { /** * Cancel all media operations in the call. * - * @param operationContext operationContext + * @param operationContext The value to identify context of the operation. This is used to co-relate other + * communications related to this operation * @return the response payload of the cancel media operations. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -303,7 +305,8 @@ public Mono cancelAllMediaOperations(String oper /** * Cancel all media operations in the call. * - * @param operationContext operationContext + * @param operationContext The value to identify context of the operation. This is used to co-relate other + * communications related to this operation * @return the response payload of the cancel media operations. */ @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/sdk/communication/azure-communication-callingserver/src/samples/java/com/azure/communication/callingserver/ConversationClientReadmeSamples.java b/sdk/communication/azure-communication-callingserver/src/samples/java/com/azure/communication/callingserver/ConversationClientReadmeSamples.java index 283afe0a8fa2..aeb77e4a1f0f 100644 --- a/sdk/communication/azure-communication-callingserver/src/samples/java/com/azure/communication/callingserver/ConversationClientReadmeSamples.java +++ b/sdk/communication/azure-communication-callingserver/src/samples/java/com/azure/communication/callingserver/ConversationClientReadmeSamples.java @@ -31,7 +31,7 @@ public CallingServerClient createCallingServerClient() { // Initialize the calling server client final CallingServerClientBuilder builder = new CallingServerClientBuilder(); - builder.endpoint(endpoint).connectionString(connectionString); + builder.connectionString(connectionString); CallingServerClient callingServerClient = builder.buildClient(); return callingServerClient; diff --git a/sdk/communication/azure-communication-callingserver/src/samples/java/com/azure/communication/callingserver/ReadmeSamples.java b/sdk/communication/azure-communication-callingserver/src/samples/java/com/azure/communication/callingserver/ReadmeSamples.java index 6fd7c63fecfa..e177dfebeb89 100644 --- a/sdk/communication/azure-communication-callingserver/src/samples/java/com/azure/communication/callingserver/ReadmeSamples.java +++ b/sdk/communication/azure-communication-callingserver/src/samples/java/com/azure/communication/callingserver/ReadmeSamples.java @@ -83,7 +83,7 @@ public void addParticipant() { String callConnectionId = "callId"; CallingServerClient callingServerClient = createCallingServerClient(); CallConnection callConnection = callingServerClient.getCallConnection(callConnectionId); - CommunicationIdentifier thirdCallee = new CommunicationUserIdentifier(""); - callConnection.addParticipant(thirdCallee, "ACS User 2", ""); + CommunicationIdentifier thirdCallee = new CommunicationUserIdentifier(""); + callConnection.addParticipant(thirdCallee, "ACS User 3", ""); } } From a2ed41c993d4117cb5e0cacdd6c8433cd83b28c3 Mon Sep 17 00:00:00 2001 From: Arif Saikat <71465659+arifsaikat-microsoft@users.noreply.github.com> Date: Sun, 13 Jun 2021 03:40:31 -0700 Subject: [PATCH 2/2] pr review fixes --- sdk/communication/azure-communication-callingserver/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/communication/azure-communication-callingserver/README.md b/sdk/communication/azure-communication-callingserver/README.md index 6e993e33f682..28ad4c684c2e 100644 --- a/sdk/communication/azure-communication-callingserver/README.md +++ b/sdk/communication/azure-communication-callingserver/README.md @@ -97,7 +97,7 @@ callConnection.addParticipant(thirdCallee, "ACS User 3", "