Class CallingServerAsyncClient
java.lang.Object
com.azure.communication.callingserver.CallingServerAsyncClient
Asynchronous client that supports calling server operations.
Instantiating a asynchronous CallingServer client
HttpPipeline pipeline = new HttpPipelineBuilder() .policies(/* add policies */) .build(); CallingServerAsyncClient callingServerAsyncClient = new CallingServerClientBuilder() .pipeline(pipeline) .connectionString(connectionString) .buildAsyncClient();
View this
for additional ways to construct the client.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioncreateCallConnection
(CommunicationIdentifier source, List<CommunicationIdentifier> targets, CreateCallOptions createCallOptions) Create a call connection request from a source identity to targets identity.createCallConnectionWithResponse
(CommunicationIdentifier source, List<CommunicationIdentifier> targets, CreateCallOptions createCallOptions) Create a Call Connection Request from source identity to targets identity.downloadStream
(String sourceEndpoint) Download the recording content, e.g.downloadStream
(String sourceEndpoint, HttpRange httpRange) Download the recording content, e.g.downloadStreamWithResponse
(String sourceEndpoint, HttpRange range) Download the recording content, (e.g.downloadTo
(String sourceEndpoint, Path destinationPath, ParallelDownloadOptions parallelDownloadOptions, boolean overwrite) Download the content located inendpoint
into a file marked bypath
.downloadToWithResponse
(String sourceEndpoint, Path destinationPath, ParallelDownloadOptions parallelDownloadOptions, boolean overwrite) Download the content located inendpoint
into a file marked bypath
.getCallConnection
(String callConnectionId) Get CallConnection objectinitializeServerCall
(String serverCallId) Get ServerCall object.joinCall
(String serverCallId, CommunicationIdentifier source, JoinCallOptions joinCallOptions) Join a CalljoinCallWithResponse
(String serverCallId, CommunicationIdentifier source, JoinCallOptions joinCallOptions) Join a call
-
Method Details
-
createCallConnection
public Mono<CallConnectionAsync> createCallConnection(CommunicationIdentifier source, List<CommunicationIdentifier> targets, CreateCallOptions createCallOptions) Create a call connection request from a source identity to targets identity.- Parameters:
source
- The source identity.targets
- The target identities.createCallOptions
- The call options.- Returns:
- Response for a successful CreateCallConnection request.
List<CommunicationIdentifier> targets = Arrays.asList(firstCallee, secondCallee); List<MediaType> requestedMediaTypes = Arrays.asList(MediaType.AUDIO, MediaType.VIDEO); List<EventSubscriptionType> requestedCallEvents = Arrays.asList( EventSubscriptionType.DTMF_RECEIVED, EventSubscriptionType.PARTICIPANTS_UPDATED); CreateCallOptions createCallOptions = new CreateCallOptions( callbackUri, requestedMediaTypes, requestedCallEvents); CallConnectionAsync callAsyncConnection = callingServerAsyncClient .createCallConnection(source, targets, createCallOptions).block();
- Throws:
CallingServerErrorException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
createCallConnectionWithResponse
public Mono<Response<CallConnectionAsync>> createCallConnectionWithResponse(CommunicationIdentifier source, List<CommunicationIdentifier> targets, CreateCallOptions createCallOptions) Create a Call Connection Request from source identity to targets identity.- Parameters:
source
- The source identity.targets
- The target identities.createCallOptions
- The call options.- Returns:
- Response for a successful CreateCallConnection request.
- Throws:
CallingServerErrorException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
joinCall
public Mono<CallConnectionAsync> joinCall(String serverCallId, CommunicationIdentifier source, JoinCallOptions joinCallOptions) Join a Call- Parameters:
serverCallId
- Server call id.source
- Source identity.joinCallOptions
- Join call options.- Returns:
- Response for a successful join request.
- Throws:
CallingServerErrorException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
joinCallWithResponse
public Mono<Response<CallConnectionAsync>> joinCallWithResponse(String serverCallId, CommunicationIdentifier source, JoinCallOptions joinCallOptions) Join a call- Parameters:
serverCallId
- Server call id.source
- Source identity.joinCallOptions
- Join call options.- Returns:
- Response for a successful join request.
- Throws:
CallingServerErrorException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
getCallConnection
Get CallConnection object- Parameters:
callConnectionId
- Call connection id.- Returns:
- CallConnection object.
-
initializeServerCall
Get ServerCall object.- Parameters:
serverCallId
- Server call id.- Returns:
- ServerCall object.
-
downloadStream
Download the recording content, e.g. Recording's metadata, Recording video, from the ACS endpoint passed as parameter.- Parameters:
sourceEndpoint
- - URL where the content is located.- Returns:
- A
Flux
object containing the byte stream of the content requested.
-
downloadStream
Download the recording content, e.g. Recording's metadata, Recording video, from the ACS endpoint passed as parameter. -
downloadStreamWithResponse
public Mono<Response<Flux<ByteBuffer>>> downloadStreamWithResponse(String sourceEndpoint, HttpRange range) Download the recording content, (e.g. Recording's metadata, Recording video, etc.) from theendpoint
. -
downloadTo
public Mono<Void> downloadTo(String sourceEndpoint, Path destinationPath, ParallelDownloadOptions parallelDownloadOptions, boolean overwrite) Download the content located inendpoint
into a file marked bypath
. This download will be done using parallel workers.- Parameters:
sourceEndpoint
- - ACS URL where the content is located.destinationPath
- - File location.parallelDownloadOptions
- - an optionalParallelDownloadOptions
object to modify how the parallel download will work.overwrite
- - True to overwrite the file if it exists.- Returns:
- Response for a successful downloadTo request.
-
downloadToWithResponse
public Mono<Response<Void>> downloadToWithResponse(String sourceEndpoint, Path destinationPath, ParallelDownloadOptions parallelDownloadOptions, boolean overwrite) Download the content located inendpoint
into a file marked bypath
. This download will be done using parallel workers.- Parameters:
sourceEndpoint
- - ACS URL where the content is located.destinationPath
- - File location.parallelDownloadOptions
- - an optionalParallelDownloadOptions
object to modify how the parallel download will work.overwrite
- - True to overwrite the file if it exists.- Returns:
- Response containing the http response information from the download.
-