Class CallConnection

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

public class CallConnection extends Object
CallConnection for mid-call actions
  • Method Details

    • getCallProperties

      public CallConnectionProperties getCallProperties()
      Get call connection properties.
      Returns:
      Response payload for a successful get call connection request.
      Throws:
      CallingServerErrorException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getCallPropertiesWithResponse

      public com.azure.core.http.rest.Response<CallConnectionProperties> getCallPropertiesWithResponse(com.azure.core.util.Context context)
      Get call connection properties.
      Parameters:
      context - A Context representing the request context.
      Returns:
      Response payload for a successful get call connection request.
      Throws:
      CallingServerErrorException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • hangUp

      public Void hangUp(boolean isForEveryone)
      Hangup a call.
      Parameters:
      isForEveryone - determine if the call is handed up for all participants.
      Returns:
      Response for a successful hangup request.
      Throws:
      CallingServerErrorException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • hangUpWithResponse

      public com.azure.core.http.rest.Response<Void> hangUpWithResponse(HangUpOptions hangUpOptions, com.azure.core.util.Context context)
      Hangup a call.
      Parameters:
      hangUpOptions - options to hang up
      context - A Context representing the request context.
      Returns:
      Response for a successful hangup request.
      Throws:
      CallingServerErrorException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getParticipant

      public CallParticipant getParticipant(String participantMri)
      Get a specific participant.
      Parameters:
      participantMri - The participant.
      Returns:
      Response payload for a successful get call connection request.
      Throws:
      CallingServerErrorException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getParticipantWithResponse

      public com.azure.core.http.rest.Response<CallParticipant> getParticipantWithResponse(String participantMri, com.azure.core.util.Context context)
      Get all participants.
      Parameters:
      participantMri - The participant.
      context - A Context representing the request context.
      Returns:
      Response payload for a successful get call connection request.
      Throws:
      CallingServerErrorException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • listParticipants

      public ListParticipantsResult listParticipants()
      Get all participants.
      Returns:
      Response payload for a successful get call connection request.
      Throws:
      CallingServerErrorException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • listParticipantsWithResponse

      public com.azure.core.http.rest.Response<ListParticipantsResult> listParticipantsWithResponse(com.azure.core.util.Context context)
      Get all participants.
      Parameters:
      context - A Context representing the request context.
      Returns:
      Response payload for a successful get call connection request.
      Throws:
      CallingServerErrorException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • transferToParticipantCall

      public TransferCallResult transferToParticipantCall(com.azure.communication.common.CommunicationIdentifier targetParticipant)
      Transfer the call to a participant.
      Parameters:
      targetParticipant - A CommunicationIdentifier representing the target participant of this transfer.
      Returns:
      Response payload for a successful call termination request.
      Throws:
      CallingServerErrorException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • transferToParticipantCallWithResponse

      public com.azure.core.http.rest.Response<TransferCallResult> transferToParticipantCallWithResponse(TransferToParticipantCallOptions transferToParticipantCallOptions, com.azure.core.util.Context context)
      Transfer the call to a participant.
      Parameters:
      transferToParticipantCallOptions - Options bag for transferToParticipantCall
      context - A Context representing the request context.
      Returns:
      Response for a successful call termination request.
      Throws:
      CallingServerErrorException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • addParticipants

      public AddParticipantsResult addParticipants(List<com.azure.communication.common.CommunicationIdentifier> participants)
      Add a participant to the call.
      Parameters:
      participants - The list of participants to invite.
      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.
    • addParticipantsWithResponse

      public com.azure.core.http.rest.Response<AddParticipantsResult> addParticipantsWithResponse(AddParticipantsOptions addParticipantsOptions, com.azure.core.util.Context context)
      Add a participant to the call.
      Parameters:
      addParticipantsOptions - Options bag for addParticipants
      context - A Context representing the request context.
      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.
    • removeParticipants

      public RemoveParticipantsResult removeParticipants(List<com.azure.communication.common.CommunicationIdentifier> participantsToRemove)
      Remove a list of participants from the call.
      Parameters:
      participantsToRemove - The identifier list of the participant to be removed.
      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.
    • removeParticipantsWithResponse

      public com.azure.core.http.rest.Response<RemoveParticipantsResult> removeParticipantsWithResponse(RemoveParticipantsOptions removeParticipantsOptions, com.azure.core.util.Context context)
      Remove a list of participant from the call.
      Parameters:
      removeParticipantsOptions - The options for removing participants.
      context - A Context representing the request context.
      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.
    • getCallMedia

      public CallMedia getCallMedia()
      Returns an object of CallContent
      Returns:
      a CallContentAsync.