> For a complete documentation index, fetch https://docs.voximplant.ai/llms.txt

# Call (class)

[com.voximplant.android.sdk.calls](/api-reference/androidsdk3/android/sdk/calls/overview)

**Methods**

* [answer](/api-reference/androidsdk3/android/sdk/calls/call#answer)
* [hangup](/api-reference/androidsdk3/android/sdk/calls/call#hangup)
* [hold](/api-reference/androidsdk3/android/sdk/calls/call#hold)
* [muteAudio](/api-reference/androidsdk3/android/sdk/calls/call#muteaudio)
* [reject](/api-reference/androidsdk3/android/sdk/calls/call#reject)
* [sendDTMF](/api-reference/androidsdk3/android/sdk/calls/call#senddtmf)
* [sendInfo](/api-reference/androidsdk3/android/sdk/calls/call#sendinfo)
* [sendMessage](/api-reference/androidsdk3/android/sdk/calls/call#sendmessage)
* [setCallListener](/api-reference/androidsdk3/android/sdk/calls/call#setcalllistener)
* [setQualityIssueListener](/api-reference/androidsdk3/android/sdk/calls/call#setqualityissuelistener)
* [start](/api-reference/androidsdk3/android/sdk/calls/call#start)
* [startSendingVideo](/api-reference/androidsdk3/android/sdk/calls/call#startsendingvideo)
* [stopSendingVideo](/api-reference/androidsdk3/android/sdk/calls/call#stopsendingvideo)
* [toString](/api-reference/androidsdk3/android/sdk/calls/call#tostring)

**Properties**

* [currentQualityIssues](/api-reference/androidsdk3/android/sdk/calls/call#currentqualityissues)
* [direction](/api-reference/androidsdk3/android/sdk/calls/call#direction)
* [duration](/api-reference/androidsdk3/android/sdk/calls/call#duration)
* [id](/api-reference/androidsdk3/android/sdk/calls/call#id)
* [isMuted](/api-reference/androidsdk3/android/sdk/calls/call#ismuted)
* [isOnHold](/api-reference/androidsdk3/android/sdk/calls/call#isonhold)
* [isVideoEnabled](/api-reference/androidsdk3/android/sdk/calls/call#isvideoenabled)
* [localVideoStream](/api-reference/androidsdk3/android/sdk/calls/call#localvideostream)
* [number](/api-reference/androidsdk3/android/sdk/calls/call#number)
* [remoteDisplayName](/api-reference/androidsdk3/android/sdk/calls/call#remotedisplayname)
* [remoteSipUri](/api-reference/androidsdk3/android/sdk/calls/call#remotesipuri)
* [remoteVideoStreams](/api-reference/androidsdk3/android/sdk/calls/call#remotevideostreams)
* [state](/api-reference/androidsdk3/android/sdk/calls/call#state)

## Methods

### answer

`fun answer(callSettings: `[`CallSettings`](/api-reference/androidsdk3/android/sdk/calls/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](/api-reference/androidsdk3/android/sdk/calls/calllistener) events is triggered as a result:

* [CallListener.onCallConnected](/api-reference/androidsdk3/android/sdk/calls/calllistener#oncallconnected) is triggered when the call connects successfully.
* [CallListener.onCallFailed](/api-reference/androidsdk3/android/sdk/calls/calllistener#oncallfailed) is triggered if the call fails to connect.

**Annotations:** `Throws(CallException)`

**Parameters**

| Parameter      | Type                                                                        | Requirement | Description                                                                                                   |
| -------------- | --------------------------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------- |
| `callSettings` | [`CallSettings`](/api-reference/androidsdk3/android/sdk/calls/callsettings) |             | Call settings with additional call parameters, such as preferred video codec, custom data, extra headers etc. |

**Returns:** Unit

**Throws**

[CallException](/api-reference/androidsdk3/android/sdk/calls/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](/api-reference/androidsdk3/android/sdk/calls/calllistener) events are triggered depending on the call state:

* [CallListener.onCallDisconnected](/api-reference/androidsdk3/android/sdk/calls/calllistener#oncalldisconnected) is triggered on the local call instance.
* [CallListener.onCallDisconnected](/api-reference/androidsdk3/android/sdk/calls/calllistener#oncalldisconnected) is triggered on the remote participant side if the call has connected.
* [CallListener.onCallDisconnected](/api-reference/androidsdk3/android/sdk/calls/calllistener#oncalldisconnected) is triggered on the callee side if an outgoing call is still connecting.
* [CallListener.onCallFailed](/api-reference/androidsdk3/android/sdk/calls/calllistener#oncallfailed) is triggered on the caller side if an incoming call has not been answered.

**Parameters**

| Parameter | Type                   | Requirement | Description                                                                                                       |
| --------- | ---------------------- | ----------- | ----------------------------------------------------------------------------------------------------------------- |
| `headers` | `Map<String, String>?` | Optional    | Optional 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`](/api-reference/androidsdk3/android/sdk/calls/callcallback)`?): Unit`

Holds or unholds the call.

**Parameters**

| Parameter  | Type                                                                           | Requirement | Description                                    |
| ---------- | ------------------------------------------------------------------------------ | ----------- | ---------------------------------------------- |
| `enable`   | `Boolean`                                                                      |             | Whether to put the call on hold                |
| `callback` | [`CallCallback`](/api-reference/androidsdk3/android/sdk/calls/callcallback)`?` |             | 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**

| Parameter | Type      | Requirement | Description                    |
| --------- | --------- | ----------- | ------------------------------ |
| `muted`   | `Boolean` |             | Whether to mute the microphone |

**Returns:** Unit

### reject

`fun reject(mode: `[`RejectMode`](/api-reference/androidsdk3/android/sdk/calls/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](/api-reference/androidsdk3/android/sdk/calls/calllistener) events are triggered as a result:

* [CallListener.onCallDisconnected](/api-reference/androidsdk3/android/sdk/calls/calllistener#oncalldisconnected) is triggered on the callee side.
* [CallListener.onCallFailed](/api-reference/androidsdk3/android/sdk/calls/calllistener#oncallfailed) is triggered on the caller side.

**Annotations:** `Throws(CallException)`

**Parameters**

| Parameter | Type                                                                    | Requirement | Description                                                                                                       |
| --------- | ----------------------------------------------------------------------- | ----------- | ----------------------------------------------------------------------------------------------------------------- |
| `mode`    | [`RejectMode`](/api-reference/androidsdk3/android/sdk/calls/rejectmode) |             | Reject mode for the incoming call                                                                                 |
| `headers` | `Map<String, String>?`                                                  | Optional    | Optional set of headers to send to the Voximplant Cloud. Names should begin with "X-" to be processed by the SDK. |

**Returns:** Unit

**Throws**

[CallException](/api-reference/androidsdk3/android/sdk/calls/callexception) if the call is already answered or ended.

### sendDTMF

`fun sendDTMF(tone: String): Unit`

Sends DTMF tones to the call.

**Parameters**

| Parameter | Type     | Requirement | Description |
| --------- | -------- | ----------- | ----------- |
| `tone`    | `String` |             | DTMF tones  |

**Returns:** Unit

### sendInfo

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

Sends an INFO message within the call.

**Parameters**

| Parameter  | Type                   | Requirement | Description                                                                                          |
| ---------- | ---------------------- | ----------- | ---------------------------------------------------------------------------------------------------- |
| `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:** 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**

| Parameter | Type     | Requirement | Description  |
| --------- | -------- | ----------- | ------------ |
| `text`    | `String` |             | Message text |

**Returns:** Unit

### setCallListener

`fun setCallListener(listener: `[`CallListener`](/api-reference/androidsdk3/android/sdk/calls/calllistener)`?): Unit`

Sets a listener to be notified of the call events.

**Parameters**

| Parameter  | Type                                                                           | Requirement | Description                                                                          |
| ---------- | ------------------------------------------------------------------------------ | ----------- | ------------------------------------------------------------------------------------ |
| `listener` | [`CallListener`](/api-reference/androidsdk3/android/sdk/calls/calllistener)`?` |             | Listener to be notified of call events. If null, previously set listener is removed. |

**Returns:** Unit

### setQualityIssueListener

`fun setQualityIssueListener(listener: `[`QualityIssueListener`](/api-reference/androidsdk3/android/sdk/calls/qualityissuelistener)`?): Unit`

Sets [QualityIssueListener](/api-reference/androidsdk3/android/sdk/calls/qualityissuelistener) to monitor issues that affect call quality.

**Parameters**

| Parameter  | Type                                                                                           | Requirement | Description                                                                                                |
| ---------- | ---------------------------------------------------------------------------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------- |
| `listener` | [`QualityIssueListener`](/api-reference/androidsdk3/android/sdk/calls/qualityissuelistener)`?` |             | [QualityIssueListener](/api-reference/androidsdk3/android/sdk/calls/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](/api-reference/androidsdk3/android/sdk/calls/calllistener) events may be triggered as a result:

* [CallListener.onStartRinging](/api-reference/androidsdk3/android/sdk/calls/calllistener#onstartringing) is triggered when the remote participant's device starts ringing.
* [CallListener.onCallConnected](/api-reference/androidsdk3/android/sdk/calls/calllistener#oncallconnected) is triggered when the call connects successfully.
* [CallListener.onCallFailed](/api-reference/androidsdk3/android/sdk/calls/calllistener#oncallfailed) is triggered if the call fails to connect, including when the callee rejects the call.

**Annotations:** `Throws(CallException)`

**Returns:** Unit

**Throws**

[CallException](/api-reference/androidsdk3/android/sdk/calls/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`](/api-reference/androidsdk3/android/sdk/calls/localvideostream)`, callback: `[`CallCallback`](/api-reference/androidsdk3/android/sdk/calls/callcallback)`?): Unit`

Starts sending video in the call.

**Parameters**

| Parameter     | Type                                                                                | Requirement | Description                                    |
| ------------- | ----------------------------------------------------------------------------------- | ----------- | ---------------------------------------------- |
| `videoStream` | [`LocalVideoStream`](/api-reference/androidsdk3/android/sdk/calls/localvideostream) |             | Video stream to be sent within the call        |
| `callback`    | [`CallCallback`](/api-reference/androidsdk3/android/sdk/calls/callcallback)`?`      |             | Object to receive the result of this operation |

**Returns:** Unit

### stopSendingVideo

`fun stopSendingVideo(callback: `[`CallCallback`](/api-reference/androidsdk3/android/sdk/calls/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**

| Parameter  | Type                                                                           | Requirement | Description                                    |
| ---------- | ------------------------------------------------------------------------------ | ----------- | ---------------------------------------------- |
| `callback` | [`CallCallback`](/api-reference/androidsdk3/android/sdk/calls/callcallback)`?` |             | Object to receive the result of this operation |

**Returns:** Unit

### toString

`fun toString(): String`

**Returns:** String

## Properties

### currentQualityIssues

`val currentQualityIssues: Map<`[`QualityIssue`](/api-reference/androidsdk3/android/sdk/calls/qualityissue)`, `[`QualityIssueLevel`](/api-reference/androidsdk3/android/sdk/calls/qualityissuelevel)`>`

Current status for all quality issues.

**Read-only.**

### direction

`val direction: `[`CallDirection`](/api-reference/androidsdk3/android/sdk/calls/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](/api-reference/androidsdk3/android/sdk/calls/call#muteaudio).

**Read-only.**

### isOnHold

`var isOnHold: Boolean`

Whether the call is on hold. You can change this state via [Call.hold](/api-reference/androidsdk3/android/sdk/calls/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`](/api-reference/androidsdk3/android/sdk/calls/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](/api-reference/androidsdk3/android/sdk/calls/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](/api-reference/androidsdk3/android/sdk/calls/calllistener#oncallconnected) event.

**Read-only.**

### remoteVideoStreams

`val remoteVideoStreams: List<`[`RemoteVideoStream`](/api-reference/androidsdk3/android/sdk/calls/remotevideostream)`>`

List of remote video streams.

**Read-only.**

### state

`val state: `[`CallState`](/api-reference/androidsdk3/android/sdk/calls/callstate)

Call state.

**Read-only.**