# SipAudioCall.Listener

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# Listener

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/net/sip/SipAudioCall.Listener "View this page in Java")  

```
open class Listener
```

|---|--------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                 ||
| ↳ | [android.net.sip.SipAudioCall.Listener](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall.Listener#) |

*** ** * ** ***

| **This class was deprecated in API level 31.**
|
| Deprecated in Java.

Listener for events relating to a SIP call, such as when a call is being received ("on ringing") or a call is outgoing ("on calling").

Many of these events are also received by[SipSession.Listener](https://developer.android.com/reference/kotlin/android/net/sip/SipSession.Listener).

## Summary

|                                                    Public constructors                                                    ||
|------------------------------------------------------------------------------------------------------------------------|---|
| [Listener](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall.Listener#Listener())`()` <br /> |

|                                                                                                                                                                                                                                                                                        Public methods                                                                                                                                                                                                                                                                                         ||
|----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onCallBusy](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall.Listener#onCallBusy(android.net.sip.SipAudioCall))`(`call:` `[SipAudioCall](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall)!`)` Called when the peer is busy during session initialization.                                                                                                                                                                                           |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onCallEnded](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall.Listener#onCallEnded(android.net.sip.SipAudioCall))`(`call:` `[SipAudioCall](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall)!`)` Called when the session is terminated.                                                                                                                                                                                                              |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onCallEstablished](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall.Listener#onCallEstablished(android.net.sip.SipAudioCall))`(`call:` `[SipAudioCall](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall)!`)` Called when the session is established.                                                                                                                                                                                                 |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onCallHeld](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall.Listener#onCallHeld(android.net.sip.SipAudioCall))`(`call:` `[SipAudioCall](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall)!`)` Called when the call is on hold.                                                                                                                                                                                                                      |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onCalling](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall.Listener#onCalling(android.net.sip.SipAudioCall))`(`call:` `[SipAudioCall](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall)!`)` Called when a request is sent out to initiate a new call.                                                                                                                                                                                               |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onChanged](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall.Listener#onChanged(android.net.sip.SipAudioCall))`(`call:` `[SipAudioCall](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall)!`)` Called when an event occurs and the corresponding callback is not overridden.                                                                                                                                                                           |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onError](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall.Listener#onError(android.net.sip.SipAudioCall,%20kotlin.Int,%20kotlin.String))`(`call:` `[SipAudioCall](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall)!`, `errorCode:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `errorMessage:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Called when an error occurs. |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onReadyToCall](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall.Listener#onReadyToCall(android.net.sip.SipAudioCall))`(`call:` `[SipAudioCall](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall)!`)` Called when the call object is ready to make another call.                                                                                                                                                                                      |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onRinging](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall.Listener#onRinging(android.net.sip.SipAudioCall,%20android.net.sip.SipProfile))`(`call:` `[SipAudioCall](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall)!`, `caller:` `[SipProfile](https://developer.android.com/reference/kotlin/android/net/sip/SipProfile)!`)` Called when a new call comes in.                                                                                    |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onRingingBack](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall.Listener#onRingingBack(android.net.sip.SipAudioCall))`(`call:` `[SipAudioCall](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall)!`)` Called when a RINGING response is received for the INVITE request sent.                                                                                                                                                                         |

## Public constructors

### Listener

```
Listener()
```

## Public methods

### onCallBusy

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun onCallBusy(call: SipAudioCall!): Unit
```

**Deprecated:** *Deprecated in Java.*

Called when the peer is busy during session initialization. The default implementation calls[onChanged](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall.Listener#onChanged(android.net.sip.SipAudioCall)).

|                                                                      Parameters                                                                      ||
|--------|----------------------------------------------------------------------------------------------------------------------------------------------|
| `call` | [SipAudioCall](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall)!:the call object that carries out the audio call |

### onCallEnded

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun onCallEnded(call: SipAudioCall!): Unit
```

**Deprecated:** *Deprecated in Java.*

Called when the session is terminated. The default implementation calls[onChanged](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall.Listener#onChanged(android.net.sip.SipAudioCall)).

|                                                                      Parameters                                                                      ||
|--------|----------------------------------------------------------------------------------------------------------------------------------------------|
| `call` | [SipAudioCall](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall)!:the call object that carries out the audio call |

### onCallEstablished

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun onCallEstablished(call: SipAudioCall!): Unit
```

**Deprecated:** *Deprecated in Java.*

Called when the session is established. The default implementation calls[onChanged](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall.Listener#onChanged(android.net.sip.SipAudioCall)).

|                                                                      Parameters                                                                      ||
|--------|----------------------------------------------------------------------------------------------------------------------------------------------|
| `call` | [SipAudioCall](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall)!:the call object that carries out the audio call |

### onCallHeld

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun onCallHeld(call: SipAudioCall!): Unit
```

**Deprecated:** *Deprecated in Java.*

Called when the call is on hold. The default implementation calls[onChanged](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall.Listener#onChanged(android.net.sip.SipAudioCall)).

|                                                                      Parameters                                                                      ||
|--------|----------------------------------------------------------------------------------------------------------------------------------------------|
| `call` | [SipAudioCall](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall)!:the call object that carries out the audio call |

### onCalling

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun onCalling(call: SipAudioCall!): Unit
```

**Deprecated:** *Deprecated in Java.*

Called when a request is sent out to initiate a new call. The default implementation calls[onChanged](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall.Listener#onChanged(android.net.sip.SipAudioCall)).

|                                                                      Parameters                                                                      ||
|--------|----------------------------------------------------------------------------------------------------------------------------------------------|
| `call` | [SipAudioCall](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall)!:the call object that carries out the audio call |

### onChanged

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun onChanged(call: SipAudioCall!): Unit
```

**Deprecated:** *Deprecated in Java.*

Called when an event occurs and the corresponding callback is not overridden. The default implementation is no op. Error events are not re-directed to this callback and are handled in[onError](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall.Listener#onError(android.net.sip.SipAudioCall,%20kotlin.Int,%20kotlin.String)).  

### onError

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun onError(
    call: SipAudioCall!, 
    errorCode: Int, 
    errorMessage: String!
): Unit
```

**Deprecated:** *Deprecated in Java.*

Called when an error occurs. The default implementation is no op.

|                                                                          Parameters                                                                          ||
|----------------|----------------------------------------------------------------------------------------------------------------------------------------------|
| `call`         | [SipAudioCall](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall)!:the call object that carries out the audio call |
| `errorCode`    | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):error code of this error                                          |
| `errorMessage` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:error message                                              |

**See Also**

- [android.net.sip.SipErrorCode](https://developer.android.com/reference/kotlin/android/net/sip/SipErrorCode)  

### onReadyToCall

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun onReadyToCall(call: SipAudioCall!): Unit
```

**Deprecated:** *Deprecated in Java.*

Called when the call object is ready to make another call. The default implementation calls[onChanged](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall.Listener#onChanged(android.net.sip.SipAudioCall)).

|                                                                       Parameters                                                                        ||
|--------|-------------------------------------------------------------------------------------------------------------------------------------------------|
| `call` | [SipAudioCall](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall)!:the call object that is ready to make another call |

### onRinging

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun onRinging(
    call: SipAudioCall!, 
    caller: SipProfile!
): Unit
```

**Deprecated:** *Deprecated in Java.*

Called when a new call comes in. The default implementation calls[onChanged](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall.Listener#onChanged(android.net.sip.SipAudioCall)).

|                                                                       Parameters                                                                       ||
|----------|----------------------------------------------------------------------------------------------------------------------------------------------|
| `call`   | [SipAudioCall](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall)!:the call object that carries out the audio call |
| `caller` | [SipProfile](https://developer.android.com/reference/kotlin/android/net/sip/SipProfile)!:the SIP profile of the caller                       |

### onRingingBack

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun onRingingBack(call: SipAudioCall!): Unit
```

**Deprecated:** *Deprecated in Java.*

Called when a RINGING response is received for the INVITE request sent. The default implementation calls[onChanged](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall.Listener#onChanged(android.net.sip.SipAudioCall)).

|                                                                      Parameters                                                                      ||
|--------|----------------------------------------------------------------------------------------------------------------------------------------------|
| `call` | [SipAudioCall](https://developer.android.com/reference/kotlin/android/net/sip/SipAudioCall)!:the call object that carries out the audio call |