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
void
addCallListener( listener)
Adds an ICallListener listener to handle call events.
Parameters
listener:
ICallListener listener
Returns
type:
void
answer
void
answer( callSettings)
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
long
getCallDuration()
Gets the call duration.
Returns
type:
long
getCallId
String
getCallId()
Gets the call's ID.
Returns
type:
String
getCurrentQualityIssues
getCurrentQualityIssues()
Gets the current status for all quality issues.
Returns
type:
getEndpoints
List<IEndpoint>
getEndpoints()
Gets the list of endpoints associated with the call.
Returns
type:
List<IEndpoint>
getLocalAudioStreams
List<ILocalAudioStream>
getLocalAudioStreams()
Gets all active local audio streams of the call.
Returns
type:
List<ILocalAudioStream>
getLocalVideoStreams
List<ILocalVideoStream>
getLocalVideoStreams()
Gets all active local video streams of the call.
Returns
type:
List<ILocalVideoStream>
hangup
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
void
hold(boolean
enable, 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
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
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:
- 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
boolean
isVideoEnabled()
Whether video is enabled in the call.
Returns
type:
boolean
receiveVideo
void
receiveVideo( 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
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
void
reject( mode, Map<String, String>
headers)
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
void
removeCallListener( listener)
Removes a previously added ICallListener.
Parameters
listener:
ICallListener listener
Returns
type:
void
sendAudio
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
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
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
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
void
sendVideo(boolean
enable, 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
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
void
setQualityIssueListener( listener)
Sets an IQualityIssueListener to monitor issues that affect the call quality.
Parameters
listener:
IQualityListener instance or null
Returns
type:
void
start
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
void
startScreenSharing(Intent
permissionResultData, 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:
- 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
void
useCustomVideoSource( videoSource)
Sets an ICustomVideoSource instance for the call to send video frames instead of the camera.
Parameters
videoSource:
ICustomVideoSource instance
Returns
type:
void