Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ This is a Public Preview version, so breaking changes are possible in subsequent

### Features Added
- Create outbound call to an Azure Communication Service user or a phone number.
- Hangup and delete the existing call.
- Hangup the existing call.
- Play audio in the call.
- Outbound APIs for call recording including start, pause, resume and stop.
- Subscribe to tone and receive tone selection via events.
- Subscribe to tone and receive tone selections via events.
- Invite and remove participants from the call.

<!-- LINKS -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,20 +125,20 @@ public Response<PlayAudioResult> playAudioWithResponse(
}

/**
* Disconnect the current caller in a Group-call or end a p2p-call.
* Disconnect the current caller in a group-call or end a p2p-call.
*
* @return response for a successful Hangup request.
* @return response for a successful hangup request.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Void hangup() {
return callConnectionAsync.hangup().block();
}

/**
* Disconnect the current caller in a Group-call or end a p2p-call.
* Disconnect the current caller in a group-call or end a p2p-call.
*
* @param context A {@link Context} representing the request context.
* @return response for a successful HangupCall request.
* @return response for a successful hangup request.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<Void> hangupWithResponse(Context context) {
Expand All @@ -150,7 +150,7 @@ public Response<Void> hangupWithResponse(Context context) {
*
* @param operationContext The value to identify context of the operation. This is used to co-relate other
* communications related to this operation
* @return response for a successful CancelMediaOperations request.
* @return response for a successful cancel all media operations request.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public CancelAllMediaOperationsResult cancelAllMediaOperations(String operationContext) {
Expand All @@ -163,7 +163,7 @@ 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.
* @return response for a successful CancelMediaOperations request.
* @return response for a successful cancel all media operations request.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<CancelAllMediaOperationsResult> cancelAllMediaOperationsWithResponse(
Expand All @@ -179,7 +179,7 @@ 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
* @return response for a successful addParticipant request.
* @return response for a successful add participant request.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Void addParticipant(
Expand All @@ -197,7 +197,7 @@ public Void 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.
* @return response for a successful addParticipant request.
* @return response for a successful add participant request.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<Void> addParticipantWithResponse(
Expand All @@ -213,7 +213,7 @@ public Response<Void> addParticipantWithResponse(
* Remove a participant from the call.
*
* @param participantId Participant id.
* @return response for a successful removeParticipant request.
* @return response for a successful remove participant request.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Void removeParticipant(String participantId) {
Expand All @@ -225,7 +225,7 @@ public Void removeParticipant(String participantId) {
*
* @param participantId Participant id.
* @param context A {@link Context} representing the request context.
* @return response for a successful removeParticipant request.
* @return response for a successful remove participant request.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<Void> removeParticipantWithResponse(String participantId, Context context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ Mono<Response<PlayAudioResult>> playAudioWithResponseInternal(
/**
* Hangup a call.
*
* @return response for a successful Hangup request.
* @return response for a successful hangup request.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Void> hangup() {
Expand All @@ -263,7 +263,7 @@ public Mono<Void> hangup() {
/**
* Hangup a call.
*
* @return response for a successful Hangup request.
* @return response for a successful hangup request.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<Void>> hangupWithResponse() {
Expand All @@ -287,7 +287,7 @@ Mono<Response<Void>> hangupWithResponse(Context context) {
*
* @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.
* @return the response payload of the cancel all media operations.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<CancelAllMediaOperationsResult> cancelAllMediaOperations(String operationContext) {
Expand All @@ -307,7 +307,7 @@ public Mono<CancelAllMediaOperationsResult> cancelAllMediaOperations(String oper
*
* @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.
* @return the response payload of the cancel all media operations.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<CancelAllMediaOperationsResult>> cancelAllMediaOperationsWithResponse(String operationContext) {
Expand All @@ -322,7 +322,8 @@ Mono<Response<CancelAllMediaOperationsResult>> cancelAllMediaOperationsWithRespo
request.setOperationContext(operationContext);
return withContext(contextValue -> {
contextValue = context == null ? contextValue : context;
return callConnectionInternal.cancelAllMediaOperationsWithResponseAsync(callConnectionId, request, contextValue)
return callConnectionInternal
.cancelAllMediaOperationsWithResponseAsync(callConnectionId, request, contextValue)
.onErrorMap(CommunicationErrorException.class, CallingServerErrorConverter::translateException)
.map(response ->
new SimpleResponse<>(response, CancelAllMediaOperationsResultConverter.convert(response.getValue())));
Expand All @@ -337,8 +338,9 @@ Mono<Response<CancelAllMediaOperationsResult>> cancelAllMediaOperationsWithRespo
*
* @param participant Invited participant.
* @param alternateCallerId The phone number to use when adding a phone number participant.
* @param operationContext operationContext.
* @return response for a successful addParticipant request.
* @param operationContext The value to identify context of the operation. This is used to co-relate other
* communications related to this operation
* @return response for a successful add participant request.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Void> addParticipant(
Expand All @@ -363,8 +365,9 @@ public Mono<Void> addParticipant(
*
* @param participant Invited participant.
* @param alternateCallerId The phone number to use when adding a phone number participant.
* @param operationContext operationContext.
* @return response for a successful addParticipant request.
* @param operationContext The value to identify context of the operation. This is used to co-relate other
* communications related to this operation
* @return response for a successful add participant request.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<Void>> addParticipantWithResponse(
Expand All @@ -381,10 +384,13 @@ Mono<Response<Void>> addParticipantWithResponse(
Context context) {
try {
Objects.requireNonNull(participant, "'participant' cannot be null.");
InviteParticipantsRequest request = InviteParticipantRequestConverter.convert(participant, alternateCallerId, operationContext, null);
InviteParticipantsRequest request =
InviteParticipantRequestConverter
.convert(participant, alternateCallerId, operationContext, null);
return withContext(contextValue -> {
contextValue = context == null ? contextValue : context;
return callConnectionInternal.inviteParticipantsWithResponseAsync(callConnectionId, request, contextValue)
return callConnectionInternal
.inviteParticipantsWithResponseAsync(callConnectionId, request, contextValue)
.onErrorMap(CommunicationErrorException.class, CallingServerErrorConverter::translateException);
});
} catch (RuntimeException ex) {
Expand All @@ -396,7 +402,7 @@ Mono<Response<Void>> addParticipantWithResponse(
* Remove a participant from the call.
*
* @param participantId Participant id.
* @return response for a successful removeParticipant request.
* @return response for a successful remove participant request.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Void> removeParticipant(String participantId) {
Expand All @@ -413,22 +419,20 @@ public Mono<Void> removeParticipant(String participantId) {
* Remove a participant from the call.
*
* @param participantId Participant id.
* @return response for a successful removeParticipant request.
* @return response for a successful remove participant request.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<Void>> removeParticipantWithResponse(String participantId) {
return removeParticipantWithResponse(participantId, Context.NONE);
}

/**
* Remove participant from the call.
*/
Mono<Response<Void>> removeParticipantWithResponse(String participantId, Context context) {
try {
Objects.requireNonNull(participantId, "'participantId' cannot be null.");
return withContext(contextValue -> {
contextValue = context == null ? contextValue : context;
return callConnectionInternal.removeParticipantWithResponseAsync(callConnectionId, participantId, contextValue)
return callConnectionInternal
.removeParticipantWithResponseAsync(callConnectionId, participantId, contextValue)
.onErrorMap(CommunicationErrorException.class, CallingServerErrorConverter::translateException);
});
} catch (RuntimeException ex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public final class CallingServerClient {
}

/**
* Create a Call Connection Request from source identity to targets identity.
* Create a call connection request from source identity to targets identity.
*
* @param source The source of the call.
* @param targets The targets of the call.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ public CallingServerClientBuilder credential(AzureKeyCredential keyCredential) {
/**
* Set connectionString to use
*
* @param connectionString connection string to set endpoint and initialize AzureKeyCredential
* @return CallingServerClientBuilder
* @param connectionString connection string to set
* @return The updated {@link CallingServerClientBuilder} object.
*/
public CallingServerClientBuilder connectionString(String connectionString) {
Objects.requireNonNull(connectionString, "'connectionString' cannot be null.");
Expand All @@ -124,7 +124,7 @@ public CallingServerClientBuilder connectionString(String connectionString) {
* Sets the retry policy to use (using the RetryPolicy type).
*
* @param retryPolicy object to be applied
* @return CallingServerClientBuilder
* @return The updated {@link CallingServerClientBuilder} object.
*/
public CallingServerClientBuilder retryPolicy(RetryPolicy retryPolicy) {
this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null.");
Expand All @@ -137,7 +137,7 @@ public CallingServerClientBuilder retryPolicy(RetryPolicy retryPolicy) {
*
* @param configuration Configuration store used to retrieve environment
* configurations.
* @return the updated CallingServerClientBuilder object
* @return The updated {@link CallingServerClientBuilder} object.
*/
public CallingServerClientBuilder configuration(Configuration configuration) {
this.configuration = Objects.requireNonNull(configuration, "'configuration' cannot be null.");
Expand All @@ -149,7 +149,7 @@ public CallingServerClientBuilder configuration(Configuration configuration) {
*
* @param logOptions The logging configuration to use when sending and receiving
* HTTP requests/responses.
* @return the updated CallingServerClientBuilder object
* @return The updated {@link CallingServerClientBuilder} object.
*/
public CallingServerClientBuilder httpLogOptions(HttpLogOptions logOptions) {
this.httpLogOptions = Objects.requireNonNull(logOptions, "'logOptions' cannot be null.");
Expand Down Expand Up @@ -180,7 +180,7 @@ public CallingServerClientBuilder serviceVersion(CallingServerClientBuilder vers
* Set httpClient to use
*
* @param httpClient httpClient to use, overridden by the pipeline field.
* @return CallingServerClientBuilder
* @return The updated {@link CallingServerClientBuilder} object.
*/
public CallingServerClientBuilder httpClient(HttpClient httpClient) {
this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null.");
Expand All @@ -191,9 +191,8 @@ public CallingServerClientBuilder httpClient(HttpClient httpClient) {
* Apply additional HttpPipelinePolicy
*
* @param customPolicy HttpPipelinePolicy object to be applied after
* AzureKeyCredentialPolicy, UserAgentPolicy, RetryPolicy,
* and CookiePolicy
* @return CallingServerClientBuilder
* AzureKeyCredentialPolicy, UserAgentPolicy, RetryPolicy, and CookiePolicy
* @return The updated {@link CallingServerClientBuilder} object.
*/
public CallingServerClientBuilder addPolicy(HttpPipelinePolicy customPolicy) {
this.customPolicies.add(Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."));
Expand All @@ -205,7 +204,7 @@ public CallingServerClientBuilder addPolicy(HttpPipelinePolicy customPolicy) {
* UserAgentPolicy, RetryPolicy, and CookiePolicy. Additional HttpPolicies
* specified by additionalPolicies will be applied after them
*
* @return CallingServerAsyncClient instance
* @return The updated {@link CallingServerClientBuilder} object.
*/
public CallingServerAsyncClient buildAsyncClient() {
return new CallingServerAsyncClient(createServiceImpl());
Expand All @@ -216,7 +215,7 @@ public CallingServerAsyncClient buildAsyncClient() {
* RetryPolicy, and CookiePolicy. Additional HttpPolicies specified by
* additionalPolicies will be applied after them
*
* @return CallingServerClient instance
* @return The updated {@link CallingServerClientBuilder} object.
*/
public CallingServerClient buildClient() {
return new CallingServerClient(buildAsyncClient());
Expand Down Expand Up @@ -276,7 +275,7 @@ private AzureCommunicationCallingServerServiceImpl createServiceImpl() {
* user-agent string, headers, etc.
*
* @param clientOptions object to be applied
* @return CallingServerClientBuilder
* @return The updated {@link CallingServerClientBuilder} object.
*/
public CallingServerClientBuilder clientOptions(ClientOptions clientOptions) {
this.clientOptions = clientOptions;
Expand Down
Loading