# CallException

Artifact: [androidx.core:core-telecom](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/telecom/CallException.kt+class:androidx.core.telecom.CallException) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/core#1.0.0)

*** ** * ** ***


```
class CallException : RuntimeException
```

<br />

|---|---|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||||
| ↳ | [kotlin.Throwable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html) ||||
|   | ↳ | [java.lang.Exception](https://developer.android.com/reference/java/lang/Exception.html) |||
|   |   | ↳ | [java.lang.RuntimeException](https://developer.android.com/reference/java/lang/RuntimeException.html) ||
|   |   |   | ↳ | [androidx.core.telecom.CallException](https://developer.android.com/reference/kotlin/androidx/core/telecom/CallException) |

*** ** * ** ***

This class defines exceptions that can be thrown when using `https://developer.android.com/reference/kotlin/androidx/core/telecom/package-summary` APIs.

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/telecom/CallException#ERROR_BLUETOOTH_DEVICE_IS_NULL() = 8` Telecom was not able to switch the audio route to Bluetooth because the Bluetooth device is null. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/telecom/CallException#ERROR_CALL_CANNOT_BE_SET_TO_ACTIVE() = 4` The operation has failed because Telecom cannot set the requested call as the current active call. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/telecom/CallException#ERROR_CALL_DOES_NOT_SUPPORT_HOLD() = 7` The `https://developer.android.com/reference/kotlin/androidx/core/telecom/CallControlScope#setInactive()` or CallsManager.addCall#onSetInactive failed because the `https://developer.android.com/reference/kotlin/androidx/core/telecom/CallAttributesCompat#SUPPORTS_SET_INACTIVE()` was not set. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/telecom/CallException#ERROR_CALL_IS_NOT_BEING_TRACKED() = 3` The operation has failed because Telecom has already removed the call from the server side and destroyed all the objects associated with it. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/telecom/CallException#ERROR_CALL_NOT_PERMITTED_AT_PRESENT_TIME() = 5` The operation has failed because there is either no PhoneAccount registered with Telecom for the given operation, or the limit of calls has been reached. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/telecom/CallException#ERROR_CANNOT_HOLD_CURRENT_ACTIVE_CALL() = 2` The operation has failed due to Telecom failing to hold the current active call for the call attempting to become the new active call. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/telecom/CallException#ERROR_OPERATION_TIMED_OUT() = 6` The operation has failed because the operation failed to complete before the timeout |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/telecom/CallException#ERROR_UNKNOWN() = 1` The operation has failed due to an unknown or unspecified error. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/core/telecom/CallException#CallException(kotlin.Int)(code: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/telecom/CallException#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/telecom/CallException#hashCode()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/telecom/CallException#toString()()` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/telecom/CallException#code()` |

### Inherited functions

From [kotlin.Throwable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/add-suppressed.html(exception: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/fill-in-stack-trace.html()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/init-cause.html(cause: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/print-stack-trace.html()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/print-stack-trace.html(s: https://developer.android.com/reference/java/io/PrintStream.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/print-stack-trace.html(s: https://developer.android.com/reference/java/io/PrintWriter.html)`

### Inherited properties

From [kotlin.Throwable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html) `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html?` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/cause.html` `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/localized-message.html` `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/message.html` `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/java/lang/StackTraceElement.html>` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/stack-trace.html` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html>` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/suppressed.html`

## Constants

### ERROR_BLUETOOTH_DEVICE_IS_NULL

```
const val ERROR_BLUETOOTH_DEVICE_IS_NULL = 8: Int
```

Telecom was not able to switch the audio route to Bluetooth because the Bluetooth device is null. The user should reconnect the Bluetooth device and retry the audio route switch.

### ERROR_CALL_CANNOT_BE_SET_TO_ACTIVE

```
const val ERROR_CALL_CANNOT_BE_SET_TO_ACTIVE = 4: Int
```

The operation has failed because Telecom cannot set the requested call as the current active call. The client should end the current active call and re-try the operation.

### ERROR_CALL_DOES_NOT_SUPPORT_HOLD

```
const val ERROR_CALL_DOES_NOT_SUPPORT_HOLD = 7: Int
```

The `https://developer.android.com/reference/kotlin/androidx/core/telecom/CallControlScope#setInactive()` or CallsManager.addCall#onSetInactive failed because the `https://developer.android.com/reference/kotlin/androidx/core/telecom/CallAttributesCompat#SUPPORTS_SET_INACTIVE()` was not set. Please re-add the call with the `https://developer.android.com/reference/kotlin/androidx/core/telecom/CallAttributesCompat#SUPPORTS_SET_INACTIVE()` if the call should be able to hold.

### ERROR_CALL_IS_NOT_BEING_TRACKED

```
const val ERROR_CALL_IS_NOT_BEING_TRACKED = 3: Int
```

The operation has failed because Telecom has already removed the call from the server side and destroyed all the objects associated with it. The client should re-add the call.

### ERROR_CALL_NOT_PERMITTED_AT_PRESENT_TIME

```
const val ERROR_CALL_NOT_PERMITTED_AT_PRESENT_TIME = 5: Int
```

The operation has failed because there is either no PhoneAccount registered with Telecom for the given operation, or the limit of calls has been reached. The client should end the current active call and re-try the failed operation.

### ERROR_CANNOT_HOLD_CURRENT_ACTIVE_CALL

```
const val ERROR_CANNOT_HOLD_CURRENT_ACTIVE_CALL = 2: Int
```

The operation has failed due to Telecom failing to hold the current active call for the call attempting to become the new active call. The client should end the current active call and re-try the failed operation.

### ERROR_OPERATION_TIMED_OUT

```
const val ERROR_OPERATION_TIMED_OUT = 6: Int
```

The operation has failed because the operation failed to complete before the timeout

### ERROR_UNKNOWN

```
const val ERROR_UNKNOWN = 1: Int
```

The operation has failed due to an unknown or unspecified error.

## Public constructors

### CallException

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/core#1.0.0)

```
CallException(code: Int = ERROR_UNKNOWN)
```

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

```
open fun hashCode(): Int
```

### toString

```
open fun toString(): String
```

## Public properties

### code

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/core#1.0.0)

```
val code: Int
```

Value is one of the following:

- `1`
- `2`
- `3`
- `4`
- `5`
- `6`
- `7`
- `8`

<br />