Rate this page:

ICall

Interface that provides API for call operations like answer, reject, hang up, and mid-call operations like hold, start/stop video and others.

Methods

addCallListener

Copy URL

void

addCallListener(

ICallListener

listener
)

Adds an ICallListener listener to handle call events.

Parameters

Returns

  • type:

    void

answer

Copy URL

void

answer(

CallSettings

callSettings
)

Answers the incoming call.

Parameters

  • callSettings:

    CallSettings

    Call settings with additional call parameters, such as preferred video codec, custom data, extra headers etc.

Returns

  • type:

    void

Throws

CallException if the call is already answered or in case if RECORD_AUDIO (for audio and video call) or CAMERA (for video call) permissions are not granted.

getCallDuration

Copy URL

long

getCallDuration()

Gets the call duration.

Returns

  • type:

    long

getCallId

Copy URL

String

getCallId()

Gets the call's ID.

Returns

  • type:

    String

getCurrentQualityIssues

Since ver. 2.6.0
Copy URL

Map<QualityIssue, QualityIssueLevel>

getCurrentQualityIssues()

Gets the current status for all quality issues.

getEndpoints

Copy URL

List<IEndpoint>

getEndpoints()

Gets the list of endpoints associated with the call.

Returns

getLocalAudioStreams

Copy URL

List<ILocalAudioStream>

getLocalAudioStreams()

Gets all active local audio streams of the call.

Returns

getLocalVideoStreams

Copy URL

List<ILocalVideoStream>

getLocalVideoStreams()

Gets all active local video streams of the call.

Returns

hangup

Copy URL

void

hangup(

Map<String, String>

headers
)

Hangs up the call.

Parameters

  • headers:

    Map<String, String>

    Optional set of headers to be sent to the Voximplant cloud. Names should begin with "X-" to be processed by SDK

Returns

  • type:

    void

hold

Copy URL

void

hold(

boolean

enable,

ICallCompletionHandler

handler
)

Holds or unholds the call.

Starting with 2.23.0 hold functionality is not supported in conference calls. In case of conference call the API fails with CallError.INCORRECT_OPERATION

Parameters

Returns

  • type:

    void

isAudioSending

Since ver. 2.31.0
Copy URL

boolean

isAudioSending()

Whether audio is sent into the call.

Returns false if the call has ended, i.e. one of the following events has been triggered:

  1. ICallListener.onCallDisconnected(ICall, Map, boolean)
  2. ICallListener.onCallFailed(ICall, int, String, Map)

If the call is currently reconnecting, audio sending status is not changed to false.

To start or stop sending audio in the call, ICall.sendAudio(boolean) API should be used.

Returns

  • type:

    boolean

isVideoEnabled

Copy URL

boolean

isVideoEnabled()

Whether video is enabled in the call.

Returns

  • type:

    boolean

receiveVideo

Copy URL

void

receiveVideo(

ICallCompletionHandler

handler
)

Starts receiving video if video receiving has not been enabled on the call start. Stopping video receiving during the call is not supported.

Parameters

Returns

  • type:

    void

reject

Copy URL

void

reject(

RejectMode

mode,

Map<String, String>

headers
)

Rejects the incoming call.

Parameters

  • Specify RejectMode

  • headers:

    Map<String, String>

    Optional set of headers to be sent to the Voximplant cloud. Names should begin with "X-" to be processed by SDK

Returns

  • type:

    void

Throws

CallException if the call is already answered or ended

removeCallListener

Copy URL

void

removeCallListener(

ICallListener

listener
)

Removes a previously added ICallListener.

Parameters

Returns

  • type:

    void

sendAudio

Copy URL

void

sendAudio(

boolean

enable
)

Enables or disables audio transfer from the microphone into the call.

Parameters

  • enable:

    boolean

    Whether audio should be sent

Returns

  • type:

    void

sendDTMF

Copy URL

void

sendDTMF(

String

tone
)

Sends DTMFs into the call. DTMFs are sent only if the call is established, i.e. ICallListener.onCallConnected(ICall, Map) is triggered.

Parameters

  • tone:

    String

    DTMFs

Returns

  • type:

    void

sendInfo

Copy URL

void

sendInfo(

String

mimeType,

String

content,

Map<String, String>

headers
)

Sends an INFO message within the call.

INFO message is sent if the call is establishing (i.e. ICall.start() or ICall.answer(CallSettings) are called) or is established (i.e. ICallListener.onCallConnected(ICall, Map) is triggered.

Parameters

  • mimeType:

    String

    MIME type of info

  • content:

    String

    Custom string data

  • headers:

    Map<String, String>

    Optional set of headers to be sent with message. Names should begin with "X-" to be processed by SDK

Returns

  • type:

    void

sendMessage

Copy URL

void

sendMessage(

String

text
)

Sends a message within the call.

Implemented atop SIP INFO for communication between call endpoint and Voximplant cloud, and is separated from Voximplant messaging API.

The message is sent if the call is establishing (i.e. ICall.start() or ICall.answer(CallSettings) are called) or is established (i.e. ICallListener.onCallConnected(ICall, Map) is triggered.

Parameters

  • text:

    String

    Message text

Returns

  • type:

    void

sendVideo

Copy URL

void

sendVideo(

boolean

enable,

ICallCompletionHandler

handler
)

Starts or stops sending video into the call.

Other call participants receive IEndpointListener.onRemoteVideoStreamAdded(IEndpoint, IRemoteVideoStream) or IEndpointListener.onRemoteVideoStreamRemoved(IEndpoint, IRemoteVideoStream) events.

Starting with the version 2.20.4 the API behaves the same way for conference and video calls.

For the version 2.20.3 and below for the conference video call mutes or un-mutes video sending (video stream in the 'muted' state still consumes a small bandwidth).

Parameters

Returns

  • type:

    void

setQualityIssueListener

Since ver. 2.6.0
Copy URL

void

setQualityIssueListener(

IQualityIssueListener

listener
)

Sets an IQualityIssueListener to monitor issues that affect the call quality.

Parameters

Returns

  • type:

    void

start

Since ver. 2.6.0
Copy URL

void

start()

Starts the outgoing call.

Returns

  • type:

    void

Throws

CallException if the call is already started, if RECORD_AUDIO (for audio and video call) or CAMERA (for video call) permissions are not granted, if the method is called for incoming call

startScreenSharing

Since ver. 2.18.0
Copy URL

void

startScreenSharing(

Intent

permissionResultData,

ICallCompletionHandler

handler
)

Starts screen sharing.

Requires Android API 21.

Before calling this method, it is required to get user permission to start screen sharing via ScreenCaptureIntent.

Video of the screen is sent in HD quality (720p).

Use ICall.sendVideo(boolean, ICallCompletionHandler) to stop screen sharing:

  1. with "enable" parameter as "true" - starts sending video from camera or ICustomVideoSource
  2. with "enable" parameter as "false" - stops sending video within the call

Parameters

  • permissionResultData:

    Intent

    Intent that return result data of screen capture request

  • Object to receive the result of this operation.

Returns

  • type:

    void

useCustomVideoSource

Copy URL

void

useCustomVideoSource(

ICustomVideoSource

videoSource
)

Sets an ICustomVideoSource instance for the call to send video frames instead of the camera.

Parameters

Returns

  • type:

    void