Skip to content

Commit

Permalink
PR review fixes (#22265)
Browse files Browse the repository at this point in the history
* pr review fixes

* pr review fixes
  • Loading branch information
arifsaikat-microsoft authored Jun 13, 2021
1 parent 860531c commit 49a0b17
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 43 deletions.
Original file line number Diff line number Diff line change
@@ -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.

<!-- LINKS -->
Expand Down
54 changes: 21 additions & 33 deletions sdk/communication/azure-communication-callingserver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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.
<!-- embedme src/samples/java/com/azure/communication/callingserver/ReadmeSamples.java#L28-L34 -->
```java
// Your connectionString retrieved from your Azure Communication Service
Expand All @@ -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:
<!-- embedme src/samples/java/com/azure/communication/callingserver/ReadmeSamples.java#L46-L66 -->
```java
CommunicationIdentifier source = new CommunicationUserIdentifier("<acs-user-identity>");
Expand All @@ -83,34 +84,22 @@ CreateCallOptions createCallOptions = new CreateCallOptions(
CallConnection callConnection = callingServerClient.createCallConnection(source, targets, createCallOptions);
```

Add a participant to a Call:
#### Add a participant to a Call:
<!-- embedme src/samples/java/com/azure/communication/callingserver/ReadmeSamples.java#L86-L87 -->
```java
CommunicationIdentifier thirdCallee = new CommunicationUserIdentifier("<acs-user-identity-2>");
callConnection.addParticipant(thirdCallee, "ACS User 2", "<string-for-tracing-responses>");
CommunicationIdentifier thirdCallee = new CommunicationUserIdentifier("<acs-user-identity-3>");
callConnection.addParticipant(thirdCallee, "ACS User 3", "<string-for-tracing-responses>");
```

Hangup a Call:
#### Hangup a Call:
<!-- embedme src/samples/java/com/azure/communication/callingserver/ReadmeSamples.java#L76-L76 -->
```java
callConnection.hangup();
```

### Start, Stop, Pause, Resume, and Get a recording

Create a ConverationClient:
<!-- embedme src/samples/java/com/azure/communication/callingserver/ConversationClientReadmeSamples.java#L29-L35 -->
```java
// Your connectionString retrieved from your Azure Communication Service
String connectionString = "endpoint=https://<resource-name>.communication.azure.com/;accesskey=<access-key>";

// Initialize the calling server client
final CallingServerClientBuilder builder = new CallingServerClientBuilder();
builder.endpoint(endpoint).connectionString(connectionString);
CallingServerClient callingServerClient = builder.buildClient();
```
### Start, Pause, Resume, Stop and Get a recording

Start a Recording:
#### Start a Recording:
<!-- embedme src/samples/java/com/azure/communication/callingserver/ConversationClientReadmeSamples.java#L47-L51 -->
```java
String serverCallId = "<serverCallId received from starting call>";
Expand All @@ -120,35 +109,34 @@ StartCallRecordingResponse response = serverCall.startRecording(recordingStateCa
String recordingId = response.getRecordingId();
```

Pause a Recording:
#### Pause a Recording:
<!-- embedme src/samples/java/com/azure/communication/callingserver/ConversationClientReadmeSamples.java#L65-L65 -->
```java
serverCall.pauseRecording(recordingId);
```

Resume a Recording:
#### Resume a Recording:
<!-- embedme src/samples/java/com/azure/communication/callingserver/ConversationClientReadmeSamples.java#L78-L78 -->
```java
serverCall.resumeRecording(recordingId);
```

Stop a Recording:
#### Stop a Recording:
<!-- embedme src/samples/java/com/azure/communication/callingserver/ConversationClientReadmeSamples.java#L91-L91 -->
```java
serverCall.stopRecording(recordingId);
```

Get the Recording State:
<!-- embedme src/samples/java/com/azure/communication/callingserver/ConversationClientReadmeSamples.java#L105-L106 -->
#### Get the Recording State:
<!-- embedme src/samples/java/com/azure/communication/callingserver/ConversationClientReadmeSamples.java#L105-L105 -->
```java
CallRecordingStateResponse callRecordingStateResponse =
conversationClient.getRecordingState(conversationId, recordingId);
CallRecordingStateResult callRecordingStateResult = serverCall.getRecordingState(recordingId);
```

### Play Audio Notification in Call
### Play Audio in Call

Play Audio:
<!-- embedme src/samples/java/com/azure/communication/callingserver/ConversationClientReadmeSamples.java#L125-L130 -->
#### Play Audio:
<!-- embedme src/samples/java/com/azure/communication/callingserver/ConversationClientReadmeSamples.java#L122-L127 -->
```java
String audioFileUri = "<uri of the file to play>";
String audioFileId = "<a name to use for caching the audio file>";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ Mono<PlayAudioResult> 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)
Expand Down Expand Up @@ -284,7 +285,8 @@ Mono<Response<Void>> 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)
Expand All @@ -303,7 +305,8 @@ public Mono<CancelAllMediaOperationsResult> 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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void addParticipant() {
String callConnectionId = "callId";
CallingServerClient callingServerClient = createCallingServerClient();
CallConnection callConnection = callingServerClient.getCallConnection(callConnectionId);
CommunicationIdentifier thirdCallee = new CommunicationUserIdentifier("<acs-user-identity-2>");
callConnection.addParticipant(thirdCallee, "ACS User 2", "<string-for-tracing-responses>");
CommunicationIdentifier thirdCallee = new CommunicationUserIdentifier("<acs-user-identity-3>");
callConnection.addParticipant(thirdCallee, "ACS User 3", "<string-for-tracing-responses>");
}
}

0 comments on commit 49a0b17

Please sign in to comment.