ICall
Interface that may be used for call operations like answer, reject, hang up and mid-call operations like hold, start/stop video and others.
Methods
addCallListener
void
addCallListener( listener)
Add ICallListener listener to handle call events.
Parameters
listener:
ICallListener listener
Returns
type:
void
answer
void
answer( callSettings)
Answer the call. Should be used only for 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()
Get the call duration
Returns
type:
long
getCallId
String
getCallId()
Get the call id.
Returns
type:
String
getCurrentQualityIssues
getCurrentQualityIssues()
Get current status for all quality issues.
Returns
type:
getEndpoints
List<IEndpoint>
getEndpoints()
Get list of the endpoints associated with the call.
Returns
type:
List<IEndpoint>
getLocalAudioStreams
List<ILocalAudioStream>
getLocalAudioStreams()
Get all active local audio streams of the call.
Returns
type:
List<ILocalAudioStream>
getLocalVideoStreams
List<ILocalVideoStream>
getLocalVideoStreams()
Get all active local video streams of the call.
Returns
type:
List<ILocalVideoStream>
hangup
void
hangup(Map<String, String>
headers)
Hang up the call.
Parameters
headers:
Map<String, String>
Optional set of headers to be sent to Voximplant Cloud. Names must begin with "X-" to be processed by SDK
Returns
type:
void
hold
void
hold(boolean
enable, handler)
Hold or unhold the call.
Starting 2.23.0 hold functionality is not supported in conference calls. In case of conference call the API will fail with CallError.INCORRECT_OPERATION
Parameters
enable:
boolean
True if the call should be put on hold, false for unhold
handler:
Object to receive the result of this operation. Starting Voximplant Android SDK 2.3.6 this operation will fail if the call is not established, i.e. ICallListener.onCallConnected(ICall, Map) is not invoked
Returns
type:
void
isAudioSending
boolean
isAudioSending()
Check if audio is sent in the call.
Return false if the call was ended, i.e. one of the following events was invoked:
- 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()
Check if video is enabled in the call.
Returns
type:
boolean
receiveVideo
void
receiveVideo( handler)
Start receive video if video receive was disabled before. Stop receiving video 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 will fail if the call is not established, i.e. ICallListener.onCallConnected(ICall, Map) is not invoked
Returns
type:
void
reject
void
reject( mode, Map<String, String>
headers)
Reject the call. Should be used only for incoming call.
Parameters
mode:
Specify RejectMode
headers:
Map<String, String>
Optional set of headers to be sent to Voximplant Cloud. Names must 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)
Remove previously added ICallListener
Parameters
listener:
ICallListener listener
Returns
type:
void
sendAudio
void
sendAudio(boolean
enable)
Enables or disables audio transfer from microphone into the call.
Parameters
enable:
boolean
True if audio should be sent, false otherwise
Returns
type:
void
sendDTMF
void
sendDTMF(String
tone)
Send DTMFs in the call. DTMFs will be sent only if the call is established, i.e. ICallListener.onCallConnected(ICall, Map) is invoked
Parameters
tone:
String
DTMFs
Returns
type:
void
sendInfo
void
sendInfo(String
mimeType, String
content, Map<String, String>
headers)
Send INFO message within the call.
INFO message will be 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 invoked.
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 must begin with "X-" to be processed by SDK
Returns
type:
void
sendMessage
void
sendMessage(String
text)
Send 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 will be 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 invoked.
Parameters
text:
String
Message text
Returns
type:
void
sendVideo
void
sendVideo(boolean
enable, handler)
Start or stop sending video for the call.
Other call participants will receive IEndpointListener.onRemoteVideoStreamAdded(IEndpoint, IRemoteVideoStream) or IEndpointListener.onRemoteVideoStreamRemoved(IEndpoint, IRemoteVideoStream) events.
Starting 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 send (video stream in the 'muted' state will still consume a small bandwidth).
Parameters
enable:
boolean
True if video should be sent, false otherwise
handler:
Object to receive the result of this operation. Starting Voximplant Android SDK 2.3.6 this operation will fail if the call is not established, i.e. ICallListener.onCallConnected(ICall, Map) is not invoked
Returns
type:
void
setQualityIssueListener
void
setQualityIssueListener( listener)
Set IQualityIssueListener to monitor issues that affect call quality.
Parameters
listener:
IQualityListener instance or null
Returns
type:
void
start
void
start()
Start 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)
Start sharing screen.
Requires Android API 21.
Before calling this method, it is required to get user permission to start screen sharing using 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" - will start sending video from camera or ICustomVideoSource
- with "enable" parameter as "false" - will stop 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)
Set ICustomVideoSource instance for the call to send video frames. It will be used instead of camera.
Parameters
videoSource:
ICustomVideoSource instance
Returns
type:
void