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 all 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
27 changes: 18 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 Expand Up @@ -134,6 +133,16 @@ serverCall.stopRecording(recordingId);
CallRecordingStateResult callRecordingStateResult = serverCall.getRecordingState(recordingId);
```

#### Download a Recording into a file:
<!-- embedme src/samples/java/com/azure/communication/callingserver/ReadmeSamples.java#L100-L100 -->
```java
callingServerClient.downloadTo(
recordingUrl,
Paths.get(filePath),
null,
true
);
```
### Play Audio in Call

#### Play Audio:
Expand Down
27 changes: 26 additions & 1 deletion sdk/communication/azure-communication-callingserver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
</dependency>
</dependencies>
<build>
<plugins>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
Expand All @@ -134,6 +134,15 @@
<include>com/azure/communication/callingserver/*.class</include>
</includes>
</configuration>
<executions>
<execution>
<id>coverage-report</id>
<phase>verify</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -149,6 +158,22 @@
</rules>
</configuration>
</plugin>
<plugin>
<groupId>org.revapi</groupId>
<artifactId>revapi-maven-plugin</artifactId>
<version>0.11.2</version> <!-- {x-version-update;org.revapi:revapi-maven-plugin;external_dependency} -->
<configuration>
<analysisConfiguration>
<revapi.ignore>
<item>
<code>java.method.added</code>
<class>com.azure.core.util.HttpClientOptions</class>
<justification>Transitive from Core. Not our problem</justification>
</item>
</revapi.ignore>
</analysisConfiguration>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package com.azure.communication.callingserver;

import com.azure.communication.callingserver.models.AddParticipantResult;
import com.azure.communication.callingserver.models.CallingServerErrorException;
import com.azure.communication.callingserver.models.CancelAllMediaOperationsResult;
import com.azure.communication.callingserver.models.PlayAudioOptions;
import com.azure.communication.callingserver.models.PlayAudioResult;
Expand Down Expand Up @@ -45,6 +46,8 @@ public String getCallConnectionId() {
* @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
* @throws CallingServerErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response payload for play audio operation.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Expand All @@ -65,46 +68,15 @@ public PlayAudioResult playAudio(
* 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 playAudioOptions Options for play audio.
* @throws CallingServerErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response payload for play audio operation.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public PlayAudioResult playAudio(String audioFileUri, PlayAudioOptions playAudioOptions) {
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 All @@ -113,6 +85,8 @@ public Response<PlayAudioResult> playAudioWithResponse(
* be mono (single-channel), 16-bit samples with a 16,000 (16KHz) sampling rate.
* @param playAudioOptions Options for play audio.
* @param context A {@link Context} representing the request context.
* @throws CallingServerErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response payload for play audio operation.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Expand All @@ -127,6 +101,9 @@ public Response<PlayAudioResult> playAudioWithResponse(

/**
* Disconnect the current caller in a group-call or end a p2p-call.
*
* @throws CallingServerErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void hangup() {
Expand All @@ -137,6 +114,8 @@ public void hangup() {
* Disconnect the current caller in a group-call or end a p2p-call.
*
* @param context A {@link Context} representing the request context.
* @throws CallingServerErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for a successful hangup request.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Expand All @@ -149,6 +128,8 @@ public Response<Void> hangupWithResponse(final Context context) {
*
* @param operationContext The value to identify context of the operation. This is used to co-relate other
* communications related to this operation
* @throws CallingServerErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for a successful cancel all media operations request.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Expand All @@ -162,6 +143,8 @@ public CancelAllMediaOperationsResult cancelAllMediaOperations(String operationC
* @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.
* @throws CallingServerErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for a successful cancel all media operations request.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Expand All @@ -178,6 +161,8 @@ public Response<CancelAllMediaOperationsResult> cancelAllMediaOperationsWithResp
* @param alternateCallerId The phone number to use when adding a phone number participant.
* @param operationContext The value to identify context of the operation. This is used to co-relate other
* communications related to this operation
* @throws CallingServerErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for a successful add participant request.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Expand All @@ -196,6 +181,8 @@ public AddParticipantResult addParticipant(
* @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.
* @throws CallingServerErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for a successful add participant request.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Expand All @@ -212,6 +199,8 @@ public Response<AddParticipantResult> addParticipantWithResponse(
* Remove a participant from the call.
*
* @param participantId Participant id.
* @throws CallingServerErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void removeParticipant(String participantId) {
Expand All @@ -223,6 +212,8 @@ public void removeParticipant(String participantId) {
*
* @param participantId Participant id.
* @param context A {@link Context} representing the request context.
* @throws CallingServerErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for a successful remove participant request.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Expand Down
Loading