Call (class)
com.voximplant.android.sdk.calls
Methods
- answer
- hangup
- hold
- muteAudio
- reject
- sendDTMF
- sendInfo
- sendMessage
- setCallListener
- setQualityIssueListener
- start
- startSendingVideo
- stopSendingVideo
- toString
Properties
Methods
answer
fun answer(callSettings: CallSettings): Unit
Answers the call. This method should be used only for incoming calls.
Calling this method initiates the connection process. One of the following CallListener events is triggered as a result:
- CallListener.onCallConnected is triggered when the call connects successfully.
- CallListener.onCallFailed is triggered if the call fails to connect.
Annotations: Throws(CallException)
Parameters
Returns: Unit
Throws
CallException if the call is already answered or RECORD_AUDIO permission is not granted.
hangup
fun hangup(headers: Map<String, String>?): Unit
Hangs up the call.
Calling this method terminates the call. The following CallListener events are triggered depending on the call state:
- CallListener.onCallDisconnected is triggered on the local call instance.
- CallListener.onCallDisconnected is triggered on the remote participant side if the call has connected.
- CallListener.onCallDisconnected is triggered on the callee side if an outgoing call is still connecting.
- CallListener.onCallFailed is triggered on the caller side if an incoming call has not been answered.
Parameters
Returns: Unit
hold
fun hold(enable: Boolean, callback: CallCallback?): Unit
Holds or unholds the call.
Parameters
Returns: Unit
muteAudio
fun muteAudio(muted: Boolean): Unit
Enables or disables audio from microphone into the call.
Parameters
Returns: Unit
reject
fun reject(mode: RejectMode, headers: Map<String, String>?): Unit
Rejects the call. This method should be used only for incoming calls.
Calling this method terminates the incoming call attempt. The following CallListener events are triggered as a result:
- CallListener.onCallDisconnected is triggered on the callee side.
- CallListener.onCallFailed is triggered on the caller side.
Annotations: Throws(CallException)
Parameters
Returns: Unit
Throws
CallException if the call is already answered or ended.
sendDTMF
fun sendDTMF(tone: String): Unit
Sends DTMF tones to the call.
Parameters
Returns: Unit
sendInfo
fun sendInfo(mimeType: String, content: String, headers: Map<String, String>?): Unit
Sends an INFO message within the call.
Parameters
Returns: Unit
sendMessage
fun sendMessage(text: String): Unit
Sends a message within the call.
Implemented atop SIP INFO for communication between call endpoint and Voximplant cloud.
Parameters
Returns: Unit
setCallListener
fun setCallListener(listener: CallListener?): Unit
Sets a listener to be notified of the call events.
Parameters
Returns: Unit
setQualityIssueListener
fun setQualityIssueListener(listener: QualityIssueListener?): Unit
Sets QualityIssueListener to monitor issues that affect call quality.
Parameters
Returns: Unit
start
fun start(): Unit
Starts the call. This method should be used only for outgoing calls.
Calling this method initiates the call setup. The following CallListener events may be triggered as a result:
- CallListener.onStartRinging is triggered when the remote participant’s device starts ringing.
- CallListener.onCallConnected is triggered when the call connects successfully.
- CallListener.onCallFailed is triggered if the call fails to connect, including when the callee rejects the call.
Annotations: Throws(CallException)
Returns: Unit
Throws
CallException if the call is already started, if RECORD_AUDIO (for audio and video calls) or CAMERA (for video calls) permissions are not granted, if the method is called for an incoming call.
startSendingVideo
fun startSendingVideo(videoStream: LocalVideoStream, callback: CallCallback?): Unit
Starts sending video in the call.
Parameters
Returns: Unit
stopSendingVideo
fun stopSendingVideo(callback: CallCallback?): Unit
Stops sending video in the call.
If the operation is completed successfully, the caller should close the local video stream that has been previously used to send the video. Otherwise the video resources are not released.
Parameters
Returns: Unit
toString
fun toString(): String
Returns: String
Properties
currentQualityIssues
val currentQualityIssues: Map<QualityIssue, QualityIssueLevel>
Current status for all quality issues.
Read-only.
direction
val direction: CallDirection
Whether the call is incoming or outgoing.
Read-only.
duration
val duration: Long
Call duration in milliseconds.
Read-only.
id
val id: String
Call id.
Read-only.
isMuted
val isMuted: Boolean
Whether the user’s microphone is muted. You can change this state via Call.muteAudio.
Read-only.
isOnHold
var isOnHold: Boolean
Whether the call is on hold. You can change this state via Call.hold.
isVideoEnabled
val isVideoEnabled: Boolean
Whether video is enabled in the call. True if video send or receive is enabled by current user, false otherwise.
Read-only.
localVideoStream
val localVideoStream: LocalVideoStream?
Outgoing video stream during the call or null if the local video is disabled.
Read-only.
number
val number: String
Specifies the number used to make outgoing call.
Read-only.
remoteDisplayName
val remoteDisplayName: String?
Participant’s display name.
For incoming calls it is available immediately, for outgoing calls it is available after the CallListener.onCallConnected event.
Read-only.
remoteSipUri
val remoteSipUri: String?
Participant’s SIP URI.
For incoming calls it is available immediately, for outgoing calls it is available after the CallListener.onCallConnected event.
Read-only.
remoteVideoStreams
val remoteVideoStreams: List<RemoteVideoStream>
List of remote video streams.
Read-only.
state
val state: CallState
Call state.
Read-only.