Interface CallController

  • All Implemented Interfaces:

    
    public interface CallController
    
                        

    CallController provides the entry point to the calling functionality of the Sinch SDK.

    • Constructor Detail

    • Method Detail

      • callUser

         abstract Call callUser(String userId, MediaConstraints mediaConstraints)

        Makes a call to the user with the given id.

        Parameters:
        userId - The app specific id of the user to call.
        mediaConstraints - Media constraints for given user call.
        Returns:

        A Call instance.

      • callUser

         abstract Call callUser(String userId, MediaConstraints mediaConstraints, Map<String, String> callHeaders)

        Makes a call to the user with the given id.

        Parameters:
        userId - The app specific id of the user to call.
        mediaConstraints - Media constraints for given user call.
        callHeaders - Headers to pass with the call.
        Returns:

        A Call instance.

      • callPhoneNumber

         abstract Call callPhoneNumber(String phoneNumber, String cli)

        Calls a phone number and terminates the call to the PSTN-network (Publicly Switched Telephone Network).

        Parameters:
        phoneNumber - The phone number to call.
        cli - Identifier of the caller.
        Returns:

        A Call instance.

      • callPhoneNumber

         abstract Call callPhoneNumber(String phoneNumber, String cli, Map<String, String> callHeaders)

        Calls a phone number and terminates the call to the PSTN-network (Publicly Switched Telephone Network).

        Parameters:
        phoneNumber - The phone number to call.
        cli - Identifier of the caller.
        callHeaders - Headers to pass with the call.
        Returns:

        A Call instance.

      • dialPhoneNumber

        @SinchBetaApi() abstract Call dialPhoneNumber(String phoneNumber)

        Dials a phone number, placing an audio call routed through the Sinch Voice V2 platform and terminated to the PSTN-network (Publicly Switched Telephone Network).

        Parameters:
        phoneNumber - The phone number to dial.
        Returns:

        A Call instance.

      • dialPhoneNumber

        @SinchBetaApi() abstract Call dialPhoneNumber(String phoneNumber, DialPhoneNumberOptions options)

        Dials a phone number, placing an audio call routed through the Sinch Voice V2 platform and terminated to the PSTN (Public Switched Telephone Network).

        Parameters:
        phoneNumber - Phone number in E.
        options - Voice V2 phone dial options.
        Returns:

        A Call instance.

      • dialSip

        @SinchBetaApi() abstract Call dialSip(String sipUri)

        Dials a SIP endpoint, placing an audio call routed through the Sinch Voice V2 platform.

        Parameters:
        sipUri - SIP URI of the destination, for example sip:alice@example.com.
        Returns:

        A Call instance.

      • dialSip

        @SinchBetaApi() abstract Call dialSip(String sipUri, DialSipOptions options)

        Dials a SIP endpoint, placing an audio call routed through the Sinch Voice V2 platform.

        Parameters:
        sipUri - SIP URI of the destination, for example sip:alice@example.com.
        options - SIP destination and Voice V2 service options.
        Returns:

        A Call instance.

      • dialStream

        @SinchBetaApi() abstract Call dialStream(String endpoint)

        Dials an audio stream endpoint through the Sinch Voice V2 platform.

        Parameters:
        endpoint - Stream endpoint URL, for example wss://example.com/audio.
        Returns:

        A Call instance.

      • dialStream

        @SinchBetaApi() abstract Call dialStream(String endpoint, DialStreamOptions options)

        Dials an audio stream endpoint through the Sinch Voice V2 platform.

        Parameters:
        endpoint - Stream endpoint URL, for example wss://example.com/audio.
        options - Voice V2 stream destination options.
        Returns:

        A Call instance.

      • dialVoiceRelay

        @SinchBetaApi() abstract Call dialVoiceRelay(String endpoint, DialVoiceRelayOptions options)

        Dials a Voice Relay WebSocket endpoint through the Sinch Voice V2 platform.

        Parameters:
        endpoint - WebSocket URL of the Voice Relay server, for example wss://example.com/agent.
        options - Voice Relay Voice V2 options, including the required TTS voice and STT language.
        Returns:

        A Call instance.

      • callSip

         abstract Call callSip(String sipUri)

        Makes a SIP call to the user with the given sip uri. The identity should be in the form "user@server".

        Parameters:
        sipUri - SIP URI to dial in to.
        Returns:

        A Call instance.

      • callSip

         abstract Call callSip(String sipUri, Map<String, String> callHeaders)

        Makes a SIP call to the user with the given sip uri. The identity should be in the form "user@server".

        Parameters:
        sipUri - SIP URI to dial in to.
        callHeaders - Headers to pass with the call.
        Returns:

        A Call instance.

      • callSip

         abstract Call callSip(String sipUri, String cli)

        Makes a SIP call to the user with the given sip uri. The identity should be in the form "user@server".

        Parameters:
        sipUri - SIP URI to dial in to.
        cli - Identifier of the caller.
        Returns:

        A Call instance.

      • callSip

         abstract Call callSip(String sipUri, String cli, Map<String, String> callHeaders)

        Makes a SIP call to the user with the given sip uri. The identity should be in the form "user@server".

        Parameters:
        sipUri - SIP URI to dial in to.
        cli - Identifier of the caller.
        callHeaders - Headers to pass with the call.
        Returns:

        A Call instance.

      • callConference

         abstract Call callConference(String conferenceId)

        Calls the conference with the given id.

        Parameters:
        conferenceId - Conference ID to dial in to.
        Returns:

        A Call instance.

      • callConference

         abstract Call callConference(String conferenceId, String cli)

        Calls the conference with the given id.

        Parameters:
        conferenceId - Conference ID to dial in to.
        cli - Identifier of the caller.
        Returns:

        A Call instance.

      • callConference

         abstract Call callConference(String conferenceId, Map<String, String> callHeaders)

        Calls the conference with the given id.

        Parameters:
        conferenceId - Conference ID to dial in to.
        callHeaders - Headers to pass with the call.
        Returns:

        A Call instance.

      • callConference

         abstract Call callConference(String conferenceId, String cli, Map<String, String> callHeaders)

        Calls the conference with the given id.

        Parameters:
        conferenceId - Conference ID to dial in to.
        cli - Identifier of the caller.
        callHeaders - Headers to pass with the call.
        Returns:

        A Call instance.

      • setRespectNativeCalls

        @Deprecated(message = "Use setRespectNativeCalls(onIncomingSinchCall: Boolean, duringSinchCall: Boolean) instead", replaceWith = @ReplaceWith(expression = "setRespectNativeCalls(onIncomingSinchCall: Boolean, duringSinchCall: Boolean)")) abstract Unit setRespectNativeCalls(Boolean respectNativeCalls)

        Set whether or not the client should respect native calls. If this is set to true, answering native calls will hangup any ongoing Sinch calls. Also, if in a native calls, incoming Sinch calls will be denied automatically. If set to true, the app requires permissions android.permission.READ_PHONE_STATE.

      • setRespectNativeCalls

         abstract Unit setRespectNativeCalls(Boolean onIncomingSinchCall, Boolean duringSinchCall)

        Set whether or not the client should respect native (GSM) calls.

        Parameters:
        onIncomingSinchCall - Whether or not the client should respect native calls on incoming Sinch call.
        duringSinchCall - Whether or not the client should respect native (GSM) calls during ongoing Sinch call.
      • setRespectVoIPCalls

         abstract Unit setRespectVoIPCalls(Boolean onIncomingSinchCall, Boolean duringSinchCall)

        Set whether or not the client should respect other VoIP calls (eg. WhatsAPP, Messenger).

        Parameters:
        onIncomingSinchCall - Whether or not the client should respect other VoIP calls on incoming Sinch call.
        duringSinchCall - Whether or not the client should respect other VoIP calls during ongoing Sinch call.
      • getCall

         abstract Call getCall(String callId)

        Returns the Call object with the given callId.

        Parameters:
        callId - The call identifier string.
        Returns:

        A Call instance if one matches, otherwise null.

      • setWebRtcCallConfiguration

         abstract Unit setWebRtcCallConfiguration(WebRtcCallConfiguration webRtcCallConfiguration)

        Sets the WebRTC configuration for every call created by this CallController. For this method to have effect, it must be called before initiating any outgoing call or relying the push payload.

        Parameters:
        webRtcCallConfiguration - configuration to be used.