Class ServerCallAsync
java.lang.Object
com.azure.communication.callingserver.ServerCallAsync
Asynchronous client that supports server call operations.
-
Method Summary
Modifier and TypeMethodDescriptionaddParticipant
(CommunicationIdentifier participant, String callBackUri, String alternateCallerId, String operationContext) Add a participant to the call.addParticipantWithResponse
(CommunicationIdentifier participant, String callBackUri, String alternateCallerId, String operationContext) Add a participant to the call.getRecordingState
(String recordingId) Get current recording state by recording id.getRecordingStateWithResponse
(String recordingId) Get current recording state by recording id.Get server call id propertypauseRecording
(String recordingId) Pause recording of the call.pauseRecordingWithResponse
(String recordingId) Pause recording of the call.playAudio
(String audioFileUri, PlayAudioOptions playAudioOptions) Play audio in a call.Play audio in a call.playAudioWithResponse
(String audioFileUri, PlayAudioOptions playAudioOptions) Play audio in a call.removeParticipant
(String participantId) Remove a participant from the call.removeParticipantWithResponse
(String participantId) Remove a participant from the call.resumeRecording
(String recordingId) Resume recording of the call.resumeRecordingWithResponse
(String recordingId) Resume recording of the call.startRecording
(String recordingStateCallbackUri) Start recording of the call.startRecordingWithResponse
(String recordingStateCallbackUri, StartRecordingOptions startRecordingOptions, Context context) Start recording of the call.stopRecording
(String recordingId) Stop recording of the call.stopRecordingWithResponse
(String recordingId) Stop recording of the call.
-
Method Details
-
getServerCallId
Get server call id property- Returns:
- Server call id value.
-
addParticipant
public Mono<AddParticipantResult> addParticipant(CommunicationIdentifier participant, String callBackUri, String alternateCallerId, String operationContext) Add a participant to the call.- Parameters:
participant
- Added participant.callBackUri
- callBackUri to get notifications.alternateCallerId
- Phone number to use when adding a phone number participant.operationContext
- Value to identify context of the operation. This is used to co-relate other communications related to this operation- Returns:
- Response for a successful add participant request.
- Throws:
CallingServerErrorException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
addParticipantWithResponse
public Mono<Response<AddParticipantResult>> addParticipantWithResponse(CommunicationIdentifier participant, String callBackUri, String alternateCallerId, String operationContext) Add a participant to the call.- Parameters:
participant
- Added participant.callBackUri
- callBackUri to get notifications.alternateCallerId
- Phone number to use when adding a phone number participant.operationContext
- Value to identify context of the operation. This is used to co-relate other communications related to this operation- Returns:
- Response for a successful add participant request.
- Throws:
CallingServerErrorException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
removeParticipant
Remove a participant from the call.- Parameters:
participantId
- Participant id.- Returns:
- Response for a successful remove participant request.
- Throws:
CallingServerErrorException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
removeParticipantWithResponse
Remove a participant from the call.- Parameters:
participantId
- Participant id.- Returns:
- Response for a successful remove participant request.
- Throws:
CallingServerErrorException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
startRecording
Start recording of the call.- Parameters:
recordingStateCallbackUri
- Uri to send state change callbacks.- Returns:
- Response for a successful start recording request.
- Throws:
InvalidParameterException
- is recordingStateCallbackUri is absolute uri.CallingServerErrorException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
startRecordingWithResponse
public Mono<Response<StartCallRecordingResult>> startRecordingWithResponse(String recordingStateCallbackUri, StartRecordingOptions startRecordingOptions, Context context) Start recording of the call.- Parameters:
recordingStateCallbackUri
- Uri to send state change callbacks.startRecordingOptions
- StartRecordingOptions custom options.context
- AContext
representing the request context.- Returns:
- Response for a successful start recording request.
- Throws:
InvalidParameterException
- is recordingStateCallbackUri is absolute uri.CallingServerErrorException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
stopRecording
Stop recording of the call.- Parameters:
recordingId
- Recording id to stop.- Returns:
- Response for a successful stop recording request.
- Throws:
CallingServerErrorException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
stopRecordingWithResponse
Stop recording of the call.- Parameters:
recordingId
- Recording id to stop.- Returns:
- Response for a successful stop recording request.
- Throws:
CallingServerErrorException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
pauseRecording
Pause recording of the call.- Parameters:
recordingId
- Recording id to stop.- Returns:
- Response for a successful pause recording request.
- Throws:
CallingServerErrorException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
pauseRecordingWithResponse
Pause recording of the call.- Parameters:
recordingId
- Recording id to stop.- Returns:
- Response for a successful pause recording request.
- Throws:
CallingServerErrorException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
resumeRecording
Resume recording of the call.- Parameters:
recordingId
- Recording id to stop.- Returns:
- response for a successful resume recording request.
- Throws:
CallingServerErrorException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
resumeRecordingWithResponse
Resume recording of the call.- Parameters:
recordingId
- Recording id to stop.- Returns:
- response for a successful resume recording request.
- Throws:
CallingServerErrorException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
getRecordingState
Get current recording state by recording id.- Parameters:
recordingId
- Recording id to stop.- Returns:
- Response for a successful get recording state request.
- Throws:
CallingServerErrorException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
getRecordingStateWithResponse
Get current recording state by recording id.- Parameters:
recordingId
- Recording id to stop.- Returns:
- Response for a successful get recording state request.
- Throws:
CallingServerErrorException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
playAudio
public Mono<PlayAudioResult> playAudio(String audioFileUri, String audioFileId, String callbackUri, String operationContext) Play audio in a call.- Parameters:
audioFileUri
- 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.audioFileId
- Id for the media in the AudioFileUri, using which we cache the media resource.callbackUri
- Callback Uri to receive PlayAudio status notifications.operationContext
- The value to identify context of the operation. This is used to co-relate other communications related to this operation- Returns:
- Response payload for play audio operation.
- Throws:
CallingServerErrorException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
playAudio
Play audio in a call.- Parameters:
audioFileUri
- 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.playAudioOptions
- Options for play audio.- Returns:
- Response payload for play audio operation.
- Throws:
CallingServerErrorException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-
playAudioWithResponse
public Mono<Response<PlayAudioResult>> playAudioWithResponse(String audioFileUri, PlayAudioOptions playAudioOptions) Play audio in a call.- Parameters:
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.playAudioOptions
- Options for play audio.- Returns:
- the response payload for play audio operation.
- Throws:
CallingServerErrorException
- thrown if the request is rejected by server.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-