Class CallAutomationClient

java.lang.Object
com.azure.communication.callautomation.CallAutomationClient

public final class CallAutomationClient extends Object
Synchronous client that supports calling server operations.

Instantiating a synchronous Calling Server Client

View this for additional ways to construct the client.

See Also:
  • Method Details

    • getSourceIdentity

      public CommunicationUserIdentifier getSourceIdentity()
      Get Source Identity that is used for create and answer call
      Returns:
      CommunicationUserIdentifier represent source
    • createCall

      public CreateCallResult createCall(CallInvite targetParticipant, String callbackUrl)
      Create a call connection request from a source identity to a target identity.
      Parameters:
      targetParticipant - call invitee's information
      callbackUrl - The call back url for receiving events.
      Returns:
      Result of creating the call.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • createGroupCall

      public CreateCallResult createGroupCall(List<CommunicationIdentifier> targetParticipants, String callbackUrl)
      Create a call connection request from a source identity to a list of target identity.
      Parameters:
      targetParticipants - The list of targetParticipants.
      callbackUrl - The call back url for receiving events.
      Returns:
      Result of creating the call.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • createCallWithResponse

      public com.azure.core.http.rest.Response<CreateCallResult> createCallWithResponse(CreateCallOptions createCallOptions, com.azure.core.util.Context context)
      Create a call connection request from a source identity to a target identity.
      Parameters:
      createCallOptions - Options bag for creating a new call.
      context - The context to associate with this operation.
      Returns:
      Response with result of creating the call.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • createGroupCallWithResponse

      public com.azure.core.http.rest.Response<CreateCallResult> createGroupCallWithResponse(CreateGroupCallOptions createGroupCallOptions, com.azure.core.util.Context context)
      Create a group call connection request from a source identity to multiple identities.
      Parameters:
      createGroupCallOptions - Options bag for creating a new group call.
      context - The context to associate with this operation.
      Returns:
      Response with result of creating the call.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • answerCall

      public AnswerCallResult answerCall(String incomingCallContext, String callbackUrl)
      Answer an incoming call
      Parameters:
      incomingCallContext - The incoming call context.
      callbackUrl - The call back url.
      Returns:
      Result of answering the call.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • answerCallWithResponse

      public com.azure.core.http.rest.Response<AnswerCallResult> answerCallWithResponse(AnswerCallOptions answerCallOptions, com.azure.core.util.Context context)
      Create a call connection request from a source identity to a target identity.
      Parameters:
      answerCallOptions - The options of answering the call.
      context - The context to associate with this operation.
      Returns:
      Response with result of answering the call.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • redirectCall

      public void redirectCall(String incomingCallContext, CallInvite targetParticipant)
      Redirect a call
      Parameters:
      incomingCallContext - The incoming call context.
      targetParticipant - CallInvite represent redirect targetParticipant
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • redirectCallWithResponse

      public com.azure.core.http.rest.Response<Void> redirectCallWithResponse(RedirectCallOptions redirectCallOptions, com.azure.core.util.Context context)
      Redirect a call
      Parameters:
      redirectCallOptions - options of redirecting a call
      context - The context to associate with this operation.
      Returns:
      Response with Void.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • rejectCall

      public void rejectCall(String incomingCallContext)
      Reject a call
      Parameters:
      incomingCallContext - The incoming call context.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • rejectCallWithResponse

      public com.azure.core.http.rest.Response<Void> rejectCallWithResponse(RejectCallOptions rejectCallOptions, com.azure.core.util.Context context)
      Reject a call
      Parameters:
      rejectCallOptions - The options of rejecting the call.
      context - The context to associate with this operation.
      Returns:
      Response with Void.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • connectCall

      public ConnectCallResult connectCall(CallLocator callLocator, String callbackUrl)
      Create a connect request
      Parameters:
      callLocator - call locator.
      callbackUrl - The call back url for receiving events.
      Returns:
      Result of connect.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • connectCallWithResponse

      public com.azure.core.http.rest.Response<ConnectCallResult> connectCallWithResponse(ConnectCallOptions connectCallOptions, com.azure.core.util.Context context)
      Create a connect request.
      Parameters:
      connectCallOptions - Options for connect request.
      context - The context to associate with this operation.
      Returns:
      Response with result of connect.
      Throws:
      com.azure.core.exception.HttpResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getCallConnection

      public CallConnection getCallConnection(String callConnectionId)
      Returns an object of CallConnection
      Parameters:
      callConnectionId - the id of the call connection
      Returns:
      a CallConnection.
    • getCallRecording

      public CallRecording getCallRecording()
      Returns an object of CallRecording
      Returns:
      a CallRecording.