Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API review feedback fixes #22330

Merged
merged 40 commits into from
Jun 22, 2021
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
39ed5c7
first commit
arifsaikat-microsoft Jun 14, 2021
3430944
apply new name changes (#22298)
arifsaikat-microsoft Jun 15, 2021
c58e85b
fix(test): increase branch coverage, change groupId generation
chrwhit Jun 15, 2021
761c02a
pull feature/communication-servercalling-public-preview
chrwhit Jun 15, 2021
3f69404
fix(*): remove test connection string
chrwhit Jun 15, 2021
1a259c1
fix(test): raise branch coverage
chrwhit Jun 15, 2021
acb491b
apiview review fix (#22304)
arifsaikat-microsoft Jun 16, 2021
909253d
live test fixes (#22312)
arifsaikat-microsoft Jun 16, 2021
2fde4dd
fix links (#22318)
arifsaikat-microsoft Jun 16, 2021
8537065
skip test refactor (#22324)
arifsaikat-microsoft Jun 16, 2021
9ea3e40
skip test refactor (#22327)
arifsaikat-microsoft Jun 16, 2021
5e8a756
skip test refactor (#22328)
arifsaikat-microsoft Jun 16, 2021
3c64ae8
api version fix
arifsaikat-microsoft Jun 16, 2021
d4174e3
Making ProgressReporter private. (#22331)
cochi2 Jun 16, 2021
54d4194
apiview feedback fix (#22337)
arifsaikat-microsoft Jun 17, 2021
6ad9449
apiview feedback fixes (#22338)
arifsaikat-microsoft Jun 17, 2021
466a910
Merge branch 'master' into feature/communication-servercalling-apireview
arifsaikat-microsoft Jun 17, 2021
3c0b60e
apiview feedback fixes
arifsaikat-microsoft Jun 17, 2021
c6880e7
Moving ProgressReceiver interface to models pacakge (#22345)
cochi2 Jun 17, 2021
01f6725
Multiple changes. (#22346)
cochi2 Jun 17, 2021
9f6131a
Fixing method name (#22347)
cochi2 Jun 17, 2021
0112611
apiview feedback fixes
arifsaikat-microsoft Jun 17, 2021
eaec46b
apiview feedback fixes
arifsaikat-microsoft Jun 17, 2021
09f2161
update api spec permUrl point to new swagger
zihzhan-msft Jun 18, 2021
c7d61c5
live test fix
arifsaikat-microsoft Jun 18, 2021
e6fc54e
fix(livetest): add env variables
chrwhit Jun 18, 2021
b21fb63
Merge branch 'feature/communication-servercalling-apireview' of https…
chrwhit Jun 18, 2021
2e17314
fix(*): change back resource name var
chrwhit Jun 18, 2021
4b3cb9c
fix(*): fix issues caused by merge
chrwhit Jun 18, 2021
3ddc175
fix(*): switch live test disable var
chrwhit Jun 18, 2021
651764c
use latest swagger (#22394)
arifsaikat-microsoft Jun 19, 2021
029c7af
use latest swagger
arifsaikat-microsoft Jun 19, 2021
8a06136
use latest swagger (#22395)
arifsaikat-microsoft Jun 19, 2021
e87c920
fix(live-test): disable downloadContentStreamFailure because it is fa…
chrwhit Jun 19, 2021
4bb12bd
Merge branch 'feature/communication-servercalling-apireview' of https…
chrwhit Jun 19, 2021
7612080
fix(test): update codecoverage settings
chrwhit Jun 21, 2021
f8d469c
Multiple changes. (#22421)
cochi2 Jun 21, 2021
a3852e6
Merge branch 'feature/communication-servercalling-apireview' of https…
arifsaikat-microsoft Jun 21, 2021
0370f03
skip code coverage
arifsaikat-microsoft Jun 21, 2021
31f85b4
enable code coverage
arifsaikat-microsoft Jun 22, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions sdk/communication/azure-communication-callingserver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Based on if the Contoso app join a call or not, APIs can be divided into two cat


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 -->
<!-- embedme src/samples/java/com/azure/communication/callingserver/ReadmeSamples.java#L31-L37 -->
```java
// Your connectionString retrieved from your Azure Communication Service
String connectionString = "endpoint=https://<resource-name>.communication.azure.com/;accesskey=<access-key>";
Expand All @@ -60,22 +60,21 @@ CallingServerClient callingServerClient = builder.buildClient();
### Create call, Add participant and Hangup a call

#### Create a Call:
<!-- embedme src/samples/java/com/azure/communication/callingserver/ReadmeSamples.java#L46-L66 -->
<!-- embedme src/samples/java/com/azure/communication/callingserver/ReadmeSamples.java#L49-L68 -->
```java
CommunicationIdentifier source = new CommunicationUserIdentifier("<acs-user-identity>");
CommunicationIdentifier firstCallee = new CommunicationUserIdentifier("<acs-user-identity-1>");
CommunicationIdentifier secondCallee = new CommunicationUserIdentifier("<acs-user-identity-2>");

CommunicationIdentifier[] targets = new CommunicationIdentifier[] { firstCallee, secondCallee };
List<CommunicationIdentifier> targets = Arrays.asList(firstCallee, secondCallee);

String callbackUri = "<callback-uri-for-notification>";

MediaType[] requestedMediaTypes = new MediaType[] { MediaType.AUDIO, MediaType.VIDEO };
List<MediaType> requestedMediaTypes = Arrays.asList(MediaType.AUDIO, MediaType.VIDEO);

EventSubscriptionType[] requestedCallEvents = new EventSubscriptionType[] {
List<EventSubscriptionType> requestedCallEvents = Arrays.asList(
EventSubscriptionType.DTMF_RECEIVED,
EventSubscriptionType.PARTICIPANTS_UPDATED
};
EventSubscriptionType.PARTICIPANTS_UPDATED);

CreateCallOptions createCallOptions = new CreateCallOptions(
callbackUri,
Expand All @@ -86,14 +85,14 @@ CallConnection callConnection = callingServerClient.createCallConnection(source,
```

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

#### Hangup a Call:
<!-- embedme src/samples/java/com/azure/communication/callingserver/ReadmeSamples.java#L76-L76 -->
<!-- embedme src/samples/java/com/azure/communication/callingserver/ReadmeSamples.java#L78-L78 -->
```java
callConnection.hangup();
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,39 +72,6 @@ public PlayAudioResult playAudio(String audioFileUri, PlayAudioOptions playAudio
return callConnectionAsync.playAudioInternal(audioFileUri, playAudioOptions).block();
}

/**
* Play audio in a call.
*
* @param audioFileUri The media resource uri of the play audio request. Currently only Wave file (.wav) format
* audio prompts are supported. More specifically, the audio content in the wave file must
* be mono (single-channel), 16-bit samples with a 16,000 (16KHz) sampling rate.
* @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. This is used to co-relate other
* communications related to this operation
* @param context A {@link Context} representing the request context.
* @return the response payload for play audio operation.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<PlayAudioResult> playAudioWithResponse(
String audioFileUri,
boolean loop,
String audioFileId,
String callbackUri,
String operationContext,
final Context context) {
return callConnectionAsync
.playAudioWithResponseInternal(
audioFileUri,
loop,
audioFileId,
callbackUri,
operationContext,
context)
.block();
}

/**
* Play audio in a call.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,35 +139,6 @@ Mono<PlayAudioResult> playAudioInternal(PlayAudioRequest playAudioRequest) {
}
}

/**
* Play audio in a call.
*
* @param audioFileUri The media resource uri of the play audio request. Currently only Wave file (.wav) format
* audio prompts are supported. More specifically, the audio content in the wave file must
* be mono (single-channel), 16-bit samples with a 16,000 (16KHz) sampling rate.
* @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. This is used to co-relate other
* communications related to this operation
* @return the response payload for play audio operation.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<PlayAudioResult>> playAudioWithResponse(
String audioFileUri,
boolean loop,
String audioFileId,
String callbackUri,
String operationContext) {
return playAudioWithResponseInternal(
audioFileUri,
loop,
audioFileId,
callbackUri,
operationContext,
null);
}

/**
* Play audio in a call.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import java.nio.file.Path;
import java.nio.file.StandardOpenOption;
import java.util.HashSet;
import java.util.List;
import java.util.Objects;
import java.util.Set;

Expand Down Expand Up @@ -82,7 +83,7 @@ public final class CallingServerAsyncClient {
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<CallConnectionAsync> createCallConnection(
CommunicationIdentifier source,
CommunicationIdentifier[] targets,
List<CommunicationIdentifier> targets,
CreateCallOptions createCallOptions) {
try {
Objects.requireNonNull(source, "'source' cannot be null.");
Expand All @@ -108,7 +109,7 @@ public Mono<CallConnectionAsync> createCallConnection(
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<CallConnectionAsync>> createCallConnectionWithResponse(
CommunicationIdentifier source,
CommunicationIdentifier[] targets,
List<CommunicationIdentifier> targets,
CreateCallOptions createCallOptions) {
try {
Objects.requireNonNull(source, "'source' cannot be null.");
Expand All @@ -125,7 +126,7 @@ public Mono<Response<CallConnectionAsync>> createCallConnectionWithResponse(

Mono<CallConnection> createCallConnectionInternal(
CommunicationIdentifier source,
CommunicationIdentifier[] targets,
List<CommunicationIdentifier> targets,
CreateCallOptions createCallOptions) {
try {
Objects.requireNonNull(source, "'source' cannot be null.");
Expand All @@ -142,7 +143,7 @@ Mono<CallConnection> createCallConnectionInternal(

Mono<Response<CallConnection>> createCallConnectionWithResponseInternal(
CommunicationIdentifier source,
CommunicationIdentifier[] targets,
List<CommunicationIdentifier> targets,
CreateCallOptions createCallOptions,
Context context) {
try {
Expand Down Expand Up @@ -171,7 +172,7 @@ Mono<Response<CallConnection>> createCallConnectionWithResponseInternal(
* @return response for a successful join request.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<CallConnectionAsync> join(
public Mono<CallConnectionAsync> joinCall(
String serverCallId,
CommunicationIdentifier source,
JoinCallOptions joinCallOptions) {
Expand All @@ -196,7 +197,7 @@ public Mono<CallConnectionAsync> join(
* @return response for a successful join request.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<CallConnectionAsync>>joinWithResponse(
public Mono<Response<CallConnectionAsync>> joinCallWithResponse(
String serverCallId,
CommunicationIdentifier source,
JoinCallOptions joinCallOptions) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import java.io.OutputStream;
import java.nio.file.Path;
import java.util.List;
import java.util.Objects;


Expand Down Expand Up @@ -51,7 +52,7 @@ public final class CallingServerClient {
@ServiceMethod(returns = ReturnType.SINGLE)
public CallConnection createCallConnection(
CommunicationIdentifier source,
CommunicationIdentifier[] targets,
List<CommunicationIdentifier> targets,
CreateCallOptions createCallOptions) {
return callingServerAsyncClient.createCallConnectionInternal(source, targets, createCallOptions).block();
}
Expand All @@ -68,7 +69,7 @@ public CallConnection createCallConnection(
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<CallConnection> createCallConnectionWithResponse(
CommunicationIdentifier source,
CommunicationIdentifier[] targets,
List<CommunicationIdentifier> targets,
CreateCallOptions createCallOptions,
final Context context) {
return callingServerAsyncClient
Expand All @@ -84,7 +85,7 @@ public Response<CallConnection> createCallConnectionWithResponse(
* @return CallConnection for a successful Join request.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public CallConnection join(
public CallConnection joinCall(
String serverCallId,
CommunicationIdentifier source,
JoinCallOptions joinCallOptions) {
Expand All @@ -101,7 +102,7 @@ public CallConnection join(
* @return response for a successful Join request.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<CallConnection> joinWithResponse(
public Response<CallConnection> joinCallWithResponse(
String serverCallId,
CommunicationIdentifier source,
JoinCallOptions joinCallOptions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
* The versions of CallingServer Service supported by this client library.
*/
public enum CallingServerServiceVersion implements ServiceVersion {
V2021_06_015("2021-06-15"),
V2021_06_15_preview("2021-06-15-preview");
V2021_06_15_PREVIEW("2021-06-15-preview");

private final String version;

Expand All @@ -32,6 +31,6 @@ public String getVersion() {
* @return the latest {@link CallingServerServiceVersion}
*/
public static CallingServerServiceVersion getLatest() {
return V2021_06_15_preview;
return V2021_06_15_PREVIEW;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.azure.communication.callingserver.implementation.Constants;
import com.azure.communication.callingserver.models.CallingServerErrorException;
import com.azure.communication.callingserver.models.ParallelDownloadOptions;
import com.azure.communication.callingserver.models.ProgressReporter;
import com.azure.core.http.HttpMethod;
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.HttpRange;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.communication.callingserver.models;
package com.azure.communication.callingserver;

import com.azure.communication.callingserver.models.ParallelDownloadOptions;
import reactor.core.publisher.Flux;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.communication.callingserver.models;
package com.azure.communication.callingserver;

import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
Expand All @@ -13,7 +13,7 @@
/**
* {@code ProgressReporter} offers a convenient way to add progress tracking to a given Flux.
*/
public final class ProgressReporter {
final class ProgressReporter {

private abstract static class ProgressReporterImpl implements ProgressReceiver {
long blockProgress;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,35 +249,6 @@ public PlayAudioResult playAudio(String audioFileUri, PlayAudioOptions playAudio
return serverCallAsync.playAudioInternal(audioFileUri, playAudioOptions).block();
}

/**
* Play audio in a call.
*
* @param audioFileUri The media resource uri of the play audio request. Currently only Wave file (.wav) format
* audio prompts are supported. More specifically, the audio content in the wave file must
* be mono (single-channel), 16-bit samples with a 16,000 (16KHz) sampling rate.
* @param audioFileId An id for the media in the AudioFileUri, using which we cache the media.
* @param callbackUri The callback Uri to receive PlayAudio status notifications.
* @param operationContext The value to identify context of the operation. This is used to co-relate other
* communications related to this operation
* @param context A {@link Context} representing the request context.
* @return the response payload for play audio operation.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<PlayAudioResult> playAudioWithResponse(
String audioFileUri,
String audioFileId,
String callbackUri,
String operationContext,
final Context context) {
return serverCallAsync
.playAudioWithResponseInternal(
audioFileUri,
audioFileId,
callbackUri,
operationContext,
context).block();
}

/**
* Play audio in a call.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -492,27 +492,6 @@ Mono<PlayAudioResult> playAudioInternal(PlayAudioRequest playAudioRequest) {
}
}

/**
* Play audio in a call.
*
* @param audioFileUri The media resource uri of the play audio request. Currently only Wave file (.wav) format
* audio prompts are supported. More specifically, the audio content in the wave file must
* be mono (single-channel), 16-bit samples with a 16,000 (16KHz) sampling rate.
* @param audioFileId Tne id for the media in the AudioFileUri, using which we cache the media resource.
* @param callbackUri The callback Uri to receive PlayAudio status notifications.
* @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)
public Mono<Response<PlayAudioResult>> playAudioWithResponse(
String audioFileUri,
String audioFileId,
String callbackUri,
String operationContext) {
return playAudioWithResponseInternal(audioFileUri, audioFileId, callbackUri, operationContext, null);
}

/**
* Play audio in a call.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
import com.azure.communication.callingserver.models.MediaType;
import com.azure.communication.common.CommunicationIdentifier;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;
Expand All @@ -26,16 +24,16 @@ public final class CallConnectionRequestConverter {
*/
public static CreateCallRequest convert(
CommunicationIdentifier source,
CommunicationIdentifier[] targets,
List<CommunicationIdentifier> targets,
CreateCallOptions createCallOptions) {
if (source == null || targets == null || targets.length == 0) {
if (source == null || targets == null || targets.size() == 0) {
return null;
}

CreateCallRequest createCallRequest =
new CreateCallRequest()
.setSource(CommunicationIdentifierConverter.convert(source))
.setTargets(new ArrayList<>(Arrays.asList(targets))
.setTargets(targets
.stream()
.map(CommunicationIdentifierConverter::convert)
.collect(Collectors.toList()));
Expand Down
Loading