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
addCallListener(listener: ): void
Adds an ICallListener listener to handle call events.
Parameters
listener:
ICallListener listener
Returns
type:
void
answer
answer(callSettings: ): void
Answers the incoming call.
Parameters
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
getCallDuration(): long
Gets the call duration.
Returns
type:
long
getCallId
getCallId(): String
Gets the call's ID.
Returns
type:
String
getCurrentQualityIssues
getCurrentQualityIssues(): Gets the current status for all quality issues.
Returns
type:
getEndpoints
getEndpoints(): List<IEndpoint>
Gets the list of endpoints associated with the call.
Returns
type:
List<IEndpoint>
getLocalAudioStreams
getLocalAudioStreams(): List<ILocalAudioStream>
Gets all active local audio streams of the call.
Returns
type:
List<ILocalAudioStream>
getLocalVideoStreams
getLocalVideoStreams(): List<ILocalVideoStream>
Gets all active local video streams of the call.
Returns
type:
List<ILocalVideoStream>
hangup
hangup(headers: Map<String, String>
): void
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
hold(enable: boolean
, handler: ): void
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
enable:
boolean
Whether the call should be put on hold
handler:
Object to receive the result of this operation. Starting Voximplant Android SDK 2.3.6 this operation fails if the call is not established, i.e. ICallListener.onCallConnected(ICall, Map) is not triggered
Returns
type:
void
isAudioSending
isAudioSending(): boolean
Whether audio is sent into the call.
Returns false if the call has ended, i.e. one of the following events has been triggered:
- ICallListener.onCallDisconnected(ICall, Map, boolean)
- 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
isVideoEnabled(): boolean
Whether video is enabled in the call.
Returns
type:
boolean
receiveVideo
receiveVideo(handler: ): void
Starts receiving video if video receiving has not been enabled on the call start. Stopping video receiving during the call is not supported.
Parameters
handler:
Object to receive the result of this operation. Starting Voximplant Android SDK 2.3.6 this operation fails if the call is not established, i.e. ICallListener.onCallConnected(ICall, Map) is not triggered
Returns
type:
void
reject
reject(mode: , headers: Map<String, String>
): void
Rejects the incoming call.
Parameters
mode:
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
removeCallListener(listener: ): void
Removes a previously added ICallListener.
Parameters
listener:
ICallListener listener
Returns
type:
void
sendAudio
sendAudio(enable: boolean
): void
Enables or disables audio transfer from the microphone into the call.
Parameters
enable:
boolean
Whether audio should be sent
Returns
type:
void
sendDTMF
sendDTMF(tone: String
): void
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
sendInfo(mimeType: String
, content: String
, headers: Map<String, String>
): void
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
sendMessage(text: String
): void
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
sendVideo(enable: boolean
, handler: ): void
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
enable:
boolean
Whether video should be sent
handler:
Object to receive the result of this operation. Starting Voximplant Android SDK 2.3.6 this operation fails if the call is not established, i.e. ICallListener.onCallConnected(ICall, Map) is not triggered
Returns
type:
void
setQualityIssueListener
setQualityIssueListener(listener: ): void
Sets an IQualityIssueListener to monitor issues that affect the call quality.
Parameters
listener:
IQualityListener instance or null
Returns
type:
void
start
start(): void
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
startScreenSharing(permissionResultData: Intent
, handler: ): void
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:
- with "enable" parameter as "true" - starts sending video from camera or ICustomVideoSource
- with "enable" parameter as "false" - stops sending video within the call
Parameters
permissionResultData:
Intent
Intent that return result data of screen capture request
handler:
Object to receive the result of this operation.
Returns
type:
void
useCustomVideoSource
useCustomVideoSource(videoSource: ): void
Sets an ICustomVideoSource instance for the call to send video frames instead of the camera.
Parameters
videoSource:
ICustomVideoSource instance
Returns
type:
void