# CallsManagerExtensions

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/extensions/CallsManagerExtensions.kt+class:androidx.core.telecom.extensions.CallsManagerExtensions) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/core#1.0.0)

*** ** * ** ***


```
interface CallsManagerExtensions
```

<br />

Known direct subclasses [CallsManager](https://developer.android.com/reference/kotlin/androidx/core/telecom/CallsManager)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/core/telecom/CallsManager` | CallsManager allows VoIP applications to add their calls to the Android system service Telecom. |

*** ** * ** ***

Provide the ability for `https://developer.android.com/reference/kotlin/androidx/core/telecom/CallsManager` to support extensions on a call.

Extensions allow an application to support optional features beyond the scope of call state management and audio routing. These optional features provide the application with the ability to describe additional information about the call, which allows remote surfaces (automotive, watches, etc..) to provide UX related to this additional information. Additionally, remote surfaces can perform actions using a configured extension to notify this application of a remote user request.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/core/telecom/extensions/ExtensionInitializationScope` |   |

## Summary

| ### Public functions |
|---|---|
| `suspend https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi(value = 26) https://developer.android.com/reference/kotlin/androidx/core/telecom/extensions/CallsManagerExtensions#addCallWithExtensions(androidx.core.telecom.CallAttributesCompat,kotlin.coroutines.SuspendFunction1,kotlin.coroutines.SuspendFunction1,kotlin.coroutines.SuspendFunction0,kotlin.coroutines.SuspendFunction0,kotlin.coroutines.SuspendFunction1)( callAttributes: https://developer.android.com/reference/kotlin/androidx/core/telecom/CallAttributesCompat, onAnswer: suspend (callType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html, onDisconnect: suspend (disconnectCause: https://developer.android.com/reference/android/telecom/DisconnectCause.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html, onSetActive: suspend () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html, onSetInactive: suspend () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html, init: suspend https://developer.android.com/reference/kotlin/androidx/core/telecom/extensions/ExtensionInitializationScope.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html )` Adds a call with extensions support, which allows an app to implement optional additional actions that go beyond the scope of a call, such as information about meeting participants and icons. |

## Public functions

### addCallWithExtensions

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

```
@RequiresApi(value = 26)
suspend fun addCallWithExtensions(
    callAttributes: CallAttributesCompat,
    onAnswer: suspend (callType: Int) -> Unit,
    onDisconnect: suspend (disconnectCause: DisconnectCause) -> Unit,
    onSetActive: suspend () -> Unit,
    onSetInactive: suspend () -> Unit,
    init: suspend ExtensionInitializationScope.() -> Unit
): Unit
```

Adds a call with extensions support, which allows an app to implement optional additional actions that go beyond the scope of a call, such as information about meeting participants and icons.

| Parameters |
|---|---|
| `callAttributes: https://developer.android.com/reference/kotlin/androidx/core/telecom/CallAttributesCompat` | attributes of the new call (incoming or outgoing, address, etc. ) |
| `onAnswer: suspend (callType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | where callType is the audio/video state the call should be answered as. Telecom is informing your VoIP application to answer an incoming call and set it to active. Telecom is requesting this on behalf of an system service (e.g. Automotive service) or a device (e.g. Wearable). |
| `onDisconnect: suspend (disconnectCause: https://developer.android.com/reference/android/telecom/DisconnectCause.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | where disconnectCause represents the cause for disconnecting the call. Telecom is informing your VoIP application to disconnect the incoming call. Telecom is requesting this on behalf of an system service (e.g. Automotive service) or a device (e.g. Wearable). |
| `onSetActive: suspend () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | Telecom is informing your VoIP application to set the call active. Telecom is requesting this on behalf of an system service (e.g. Automotive service) or a device (e.g. Wearable). |
| `onSetInactive: suspend () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | Telecom is informing your VoIP application to set the call inactive. This is the same as holding a call for two endpoints but can be extended to setting a meeting inactive. Telecom is informing your VoIP application to set the call inactive. Note: Your app must stop using the microphone and playing incoming media when returning. |
| `init: suspend https://developer.android.com/reference/kotlin/androidx/core/telecom/extensions/ExtensionInitializationScope.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | The scope used to first initialize Extensions that will be used when the call is first notified to the platform and UX surfaces. Once the call is set up, the user's implementation of `https://developer.android.com/reference/kotlin/androidx/core/telecom/extensions/ExtensionInitializationScope#onCall(kotlin.coroutines.SuspendFunction1)` will be called. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/core/telecom/extensions/ExtensionInitializationScope` |   |