Skip to navigation

Call (class)

Android SDK v3 API reference
View as Markdown

com.voximplant.android.sdk.calls

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:

Annotations: Throws(CallException)

Parameters

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

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:

Parameters

ParameterTypeRequirementDescription
headersMap<String, String>?OptionalOptional set of headers to send to the Voximplant Cloud. Names should begin with “X-” to be processed by the SDK.

Returns: Unit

hold

fun hold(enable: Boolean, callback: CallCallback?): Unit

Holds or unholds the call.

Parameters

ParameterTypeRequirementDescription
enableBooleanWhether to put the call on hold
callbackCallCallback?Object to receive the result of this operation

Returns: Unit

muteAudio

fun muteAudio(muted: Boolean): Unit

Enables or disables audio from microphone into the call.

Parameters

ParameterTypeRequirementDescription
mutedBooleanWhether to mute the microphone

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:

Annotations: Throws(CallException)

Parameters

ParameterTypeRequirementDescription
modeRejectModeReject mode for the incoming call
headersMap<String, String>?OptionalOptional set of headers to send to the Voximplant Cloud. Names should begin with “X-” to be processed by the SDK.

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

ParameterTypeRequirementDescription
toneStringDTMF tones

Returns: Unit

sendInfo

fun sendInfo(mimeType: String, content: String, headers: Map<String, String>?): Unit

Sends an INFO message within the call.

Parameters

ParameterTypeRequirementDescription
mimeTypeStringMIME type of info
contentStringCustom string data
headersMap<String, String>?Optional set of headers to be sent with message. Names should begin with “X-” to be processed by SDK

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

ParameterTypeRequirementDescription
textStringMessage text

Returns: Unit

setCallListener

fun setCallListener(listener: CallListener?): Unit

Sets a listener to be notified of the call events.

Parameters

ParameterTypeRequirementDescription
listenerCallListener?Listener to be notified of call events. If null, previously set listener is removed.

Returns: Unit

setQualityIssueListener

fun setQualityIssueListener(listener: QualityIssueListener?): Unit

Sets QualityIssueListener to monitor issues that affect call quality.

Parameters

ParameterTypeRequirementDescription
listenerQualityIssueListener?QualityIssueListener instance or null

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:

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

ParameterTypeRequirementDescription
videoStreamLocalVideoStreamVideo stream to be sent within the call
callbackCallCallback?Object to receive the result of this operation

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

ParameterTypeRequirementDescription
callbackCallCallback?Object to receive the result of this operation

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.