# CallAttributesCompat

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

*** ** * ** ***


```
public final class CallAttributesCompat
```

<br />

*** ** * ** ***

CallAttributes represents a set of properties that define a new Call. Applications should build an instance of this class and use `https://developer.android.com/reference/androidx/core/telecom/CallsManager#addCall(androidx.core.telecom.CallAttributesCompat,kotlin.coroutines.SuspendFunction1,kotlin.coroutines.SuspendFunction1,kotlin.coroutines.SuspendFunction0,kotlin.coroutines.SuspendFunction0,kotlin.Function1)` to start a new call with Telecom.

## Summary

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat#CALL_TYPE_AUDIO_CALL() = 1` Used when answering or dialing a call to indicate that the call does not have a video component |
| `static final int` | `https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat#CALL_TYPE_VIDEO_CALL() = 2` Indicates video transmission is supported |
| `static final int` | `https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat#DIRECTION_INCOMING() = 1` Indicates that the call is an incoming call. |
| `static final int` | `https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat#DIRECTION_OUTGOING() = 2` Indicates that the call is an outgoing call. |
| `static final int` | `https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat#SUPPORTS_SET_INACTIVE()` This call being created can be set to inactive (traditionally referred to as hold). |
| `static final int` | `https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat#SUPPORTS_STREAM()` This call can be streamed from a root device to another device to continue the call without completely transferring it. |
| `static final int` | `https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat#SUPPORTS_TRANSFER()` This call can be completely transferred from one endpoint to another. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat#CallAttributesCompat(kotlin.CharSequence,android.net.Uri,kotlin.Int,kotlin.Int,kotlin.Int,androidx.core.telecom.CallEndpointCompat,kotlin.Boolean)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/CharSequence.html displayName, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/net/Uri.html address, int direction, int callType, int callCapabilities, https://developer.android.com/reference/androidx/core/telecom/CallEndpointCompat preferredStartingCallEndpoint, https://developer.android.com/reference/java/lang/Boolean.html isLogExcluded )` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/net/Uri.html` | `https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat#getAddress()()` Address of the call. |
| `final int` | `https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat#getCallCapabilities()()` Allows a package to opt into capabilities on the telecom side, on a per-call basis |
| `final int` | `https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat#getCallType()()` Information related to data being transmitted (voice, video, etc. ) |
| `final int` | `https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat#getDirection()()` The direction (Outgoing/Incoming) of the new Call |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/CharSequence.html` | `https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat#getDisplayName()()` Display name of the person on the other end of the call |
| `final https://developer.android.com/reference/androidx/core/telecom/CallEndpointCompat` | `https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat#getPreferredStartingCallEndpoint()()` allows clients to specify a `https://developer.android.com/reference/androidx/core/telecom/CallEndpointCompat` to start a new call on. |
| `int` | `https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat#hashCode()()` |
| `final https://developer.android.com/reference/java/lang/Boolean.html` | `https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat#isLogExcluded()()` Whether this call should be excluded from the call log. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat#toString()()` |

## Constants

### CALL_TYPE_AUDIO_CALL

```
public static final int CALL_TYPE_AUDIO_CALL = 1
```

Used when answering or dialing a call to indicate that the call does not have a video component

### CALL_TYPE_VIDEO_CALL

```
public static final int CALL_TYPE_VIDEO_CALL = 2
```

Indicates video transmission is supported

### DIRECTION_INCOMING

```
public static final int DIRECTION_INCOMING = 1
```

Indicates that the call is an incoming call.

### DIRECTION_OUTGOING

```
public static final int DIRECTION_OUTGOING = 2
```

Indicates that the call is an outgoing call.

### SUPPORTS_SET_INACTIVE

```
public static final int SUPPORTS_SET_INACTIVE
```

This call being created can be set to inactive (traditionally referred to as hold). This means that once a new call goes active, if the active call needs to be held in order to place or receive an incoming call, the active call will be placed on hold. otherwise, the active call may be disconnected.

### SUPPORTS_STREAM

```
public static final int SUPPORTS_STREAM
```

This call can be streamed from a root device to another device to continue the call without completely transferring it. The call continues to take place on the source device, however media and control are streamed to another device.

### SUPPORTS_TRANSFER

```
public static final int SUPPORTS_TRANSFER
```

This call can be completely transferred from one endpoint to another.

## Public constructors

### CallAttributesCompat

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

```
public CallAttributesCompat(
    @NonNull CharSequence displayName,
    @NonNull Uri address,
    int direction,
    int callType,
    int callCapabilities,
    CallEndpointCompat preferredStartingCallEndpoint,
    Boolean isLogExcluded
)
```

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/CharSequence.html displayName` | Display name of the person on the other end of the call |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/net/Uri.html address` | Address of the call. Note, this can be extended to a meeting link or a custom scheme. On sdks 26 \& 27, the address should start with the "sip:" prefix (e.g Uri.parse("sip:")), otherwise the address will be replaced with "sip:" + packageName. |
| `int direction` | The direction (Outgoing/Incoming) of the new Call Value is one of the following: - `1` - `2` <br /> |
| `int callType` | Information related to data being transmitted (voice, video, etc. ) Value is one of the following: - `1` - `2` <br /> |
| `int callCapabilities` | Allows a package to opt into capabilities on the telecom side, on a per-call basis Value is either `0` or a combination of the following: - `2` - `4` - `8` <br /> |
| `https://developer.android.com/reference/androidx/core/telecom/CallEndpointCompat preferredStartingCallEndpoint` | allows clients to specify a `https://developer.android.com/reference/androidx/core/telecom/CallEndpointCompat` to start a new call on. The `https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat#preferredStartingCallEndpoint()` should be a value returned from `https://developer.android.com/reference/androidx/core/telecom/CallsManager#getAvailableStartingCallEndpoints()`. Once the call is started, Core-Telecom will switch to the `https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat#preferredStartingCallEndpoint()` before running the `https://developer.android.com/reference/androidx/core/telecom/CallControlScope`. |
| `https://developer.android.com/reference/java/lang/Boolean.html isLogExcluded` | Whether this call should be excluded from the call log. This is only applicable on sdks 36.1+. Pass null if the default platform behavior is desired or when running on older versions. |

## Public methods

### equals

```
public boolean equals(Object other)
```

### getAddress

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

```
public final @NonNull Uri getAddress()
```

Address of the call. Note, this can be extended to a meeting link or a custom scheme. On sdks 26 \& 27, the address should start with the "sip:" prefix (e.g Uri.parse("sip:")), otherwise the address will be replaced with "sip:" + packageName.

### getCallCapabilities

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

```
public final int getCallCapabilities()
```

Allows a package to opt into capabilities on the telecom side, on a per-call basis

### getCallType

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

```
public final int getCallType()
```

Information related to data being transmitted (voice, video, etc. )

### getDirection

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

```
public final int getDirection()
```

The direction (Outgoing/Incoming) of the new Call

### getDisplayName

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

```
public final @NonNull CharSequence getDisplayName()
```

Display name of the person on the other end of the call

### getPreferredStartingCallEndpoint

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

```
public final CallEndpointCompat getPreferredStartingCallEndpoint()
```

allows clients to specify a `https://developer.android.com/reference/androidx/core/telecom/CallEndpointCompat` to start a new call on. The `https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat#preferredStartingCallEndpoint()` should be a value returned from `https://developer.android.com/reference/androidx/core/telecom/CallsManager#getAvailableStartingCallEndpoints()`. Once the call is started, Core-Telecom will switch to the `https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat#preferredStartingCallEndpoint()` before running the `https://developer.android.com/reference/androidx/core/telecom/CallControlScope`.

### hashCode

```
public int hashCode()
```

### isLogExcluded

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

```
public final Boolean isLogExcluded()
```

Whether this call should be excluded from the call log. This is only applicable on sdks 36.1+. Pass null if the default platform behavior is desired or when running on older versions.

### toString

```
public @NonNull String toString()
```