Added in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/net/sip/SipSession.Listener#pubctors) \| [Methods](https://developer.android.com/reference/android/net/sip/SipSession.Listener#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/net/sip/SipSession.Listener#inhmethods)

# SipSession.Listener

*** ** * ** ***

` public static class SipSession.Listener `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.net.sip.SipSession.Listener |

<br />

*** ** * ** ***

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

Many of these events are also received by `https://developer.android.com/reference/android/net/sip/SipAudioCall.Listener`.

<br />

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/net/sip/SipSession.Listener#Listener()() ` |

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/net/sip/SipSession.Listener#onCallBusy(android.net.sip.SipSession)(https://developer.android.com/reference/android/net/sip/SipSession session) ` Called when the peer is busy during session initialization. |
| ` void` | ` https://developer.android.com/reference/android/net/sip/SipSession.Listener#onCallChangeFailed(android.net.sip.SipSession,%20int,%20java.lang.String)(https://developer.android.com/reference/android/net/sip/SipSession session, int errorCode, https://developer.android.com/reference/java/lang/String errorMessage) ` Called when an error occurs during session modification negotiation. |
| ` void` | ` https://developer.android.com/reference/android/net/sip/SipSession.Listener#onCallEnded(android.net.sip.SipSession)(https://developer.android.com/reference/android/net/sip/SipSession session) ` Called when the session is terminated. |
| ` void` | ` https://developer.android.com/reference/android/net/sip/SipSession.Listener#onCallEstablished(android.net.sip.SipSession,%20java.lang.String)(https://developer.android.com/reference/android/net/sip/SipSession session, https://developer.android.com/reference/java/lang/String sessionDescription) ` Called when the session is established. |
| ` void` | ` https://developer.android.com/reference/android/net/sip/SipSession.Listener#onCalling(android.net.sip.SipSession)(https://developer.android.com/reference/android/net/sip/SipSession session) ` Called when an INVITE request is sent to initiate a new call. |
| ` void` | ` https://developer.android.com/reference/android/net/sip/SipSession.Listener#onError(android.net.sip.SipSession,%20int,%20java.lang.String)(https://developer.android.com/reference/android/net/sip/SipSession session, int errorCode, https://developer.android.com/reference/java/lang/String errorMessage) ` Called when an error occurs during session initialization and termination. |
| ` void` | ` https://developer.android.com/reference/android/net/sip/SipSession.Listener#onRegistering(android.net.sip.SipSession)(https://developer.android.com/reference/android/net/sip/SipSession session) ` Called when a registration request is sent. |
| ` void` | ` https://developer.android.com/reference/android/net/sip/SipSession.Listener#onRegistrationDone(android.net.sip.SipSession,%20int)(https://developer.android.com/reference/android/net/sip/SipSession session, int duration) ` Called when registration is successfully done. |
| ` void` | ` https://developer.android.com/reference/android/net/sip/SipSession.Listener#onRegistrationFailed(android.net.sip.SipSession,%20int,%20java.lang.String)(https://developer.android.com/reference/android/net/sip/SipSession session, int errorCode, https://developer.android.com/reference/java/lang/String errorMessage) ` Called when the registration fails. |
| ` void` | ` https://developer.android.com/reference/android/net/sip/SipSession.Listener#onRegistrationTimeout(android.net.sip.SipSession)(https://developer.android.com/reference/android/net/sip/SipSession session) ` Called when the registration gets timed out. |
| ` void` | ` https://developer.android.com/reference/android/net/sip/SipSession.Listener#onRinging(android.net.sip.SipSession,%20android.net.sip.SipProfile,%20java.lang.String)(https://developer.android.com/reference/android/net/sip/SipSession session, https://developer.android.com/reference/android/net/sip/SipProfile caller, https://developer.android.com/reference/java/lang/String sessionDescription) ` Called when an INVITE request is received. |
| ` void` | ` https://developer.android.com/reference/android/net/sip/SipSession.Listener#onRingingBack(android.net.sip.SipSession)(https://developer.android.com/reference/android/net/sip/SipSession session) ` Called when a RINGING response is received for the INVITE request sent |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Public constructors

### Listener

```
public Listener ()
```

<br />

<br />

## Public methods

### onCallBusy

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

```
public void onCallBusy (SipSession session)
```

Called when the peer is busy during session initialization.

<br />

| Parameters ||
|---|---|
| `session` | `SipSession`: the session object that carries out the transaction <br /> |

### onCallChangeFailed

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

```
public void onCallChangeFailed (SipSession session, 
                int errorCode, 
                String errorMessage)
```

Called when an error occurs during session modification negotiation.

<br />

| Parameters ||
|---|---|
| `session` | `SipSession`: the session object that carries out the transaction <br /> |
| `errorCode` | `int`: error code defined in `https://developer.android.com/reference/android/net/sip/SipErrorCode` <br /> |
| `errorMessage` | `String`: error message <br /> |

### onCallEnded

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

```
public void onCallEnded (SipSession session)
```

Called when the session is terminated.

<br />

| Parameters ||
|---|---|
| `session` | `SipSession`: the session object that is associated with the dialog <br /> |

### onCallEstablished

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

```
public void onCallEstablished (SipSession session, 
                String sessionDescription)
```

Called when the session is established.

<br />

| Parameters ||
|---|---|
| `session` | `SipSession`: the session object that is associated with the dialog <br /> |
| `sessionDescription` | `String`: the peer's session description <br /> |

### onCalling

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

```
public void onCalling (SipSession session)
```

Called when an INVITE request is sent to initiate a new call.

<br />

| Parameters ||
|---|---|
| `session` | `SipSession`: the session object that carries out the transaction <br /> |

### onError

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

```
public void onError (SipSession session, 
                int errorCode, 
                String errorMessage)
```

Called when an error occurs during session initialization and termination.

<br />

| Parameters ||
|---|---|
| `session` | `SipSession`: the session object that carries out the transaction <br /> |
| `errorCode` | `int`: error code defined in `https://developer.android.com/reference/android/net/sip/SipErrorCode` <br /> |
| `errorMessage` | `String`: error message <br /> |

### onRegistering

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

```
public void onRegistering (SipSession session)
```

Called when a registration request is sent.

<br />

| Parameters ||
|---|---|
| `session` | `SipSession`: the session object that carries out the transaction <br /> |

### onRegistrationDone

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

```
public void onRegistrationDone (SipSession session, 
                int duration)
```

Called when registration is successfully done.

<br />

| Parameters ||
|---|---|
| `session` | `SipSession`: the session object that carries out the transaction <br /> |
| `duration` | `int`: duration in second before the registration expires <br /> |

### onRegistrationFailed

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

```
public void onRegistrationFailed (SipSession session, 
                int errorCode, 
                String errorMessage)
```

Called when the registration fails.

<br />

| Parameters ||
|---|---|
| `session` | `SipSession`: the session object that carries out the transaction <br /> |
| `errorCode` | `int`: error code defined in `https://developer.android.com/reference/android/net/sip/SipErrorCode` <br /> |
| `errorMessage` | `String`: error message <br /> |

### onRegistrationTimeout

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

```
public void onRegistrationTimeout (SipSession session)
```

Called when the registration gets timed out.

<br />

| Parameters ||
|---|---|
| `session` | `SipSession`: the session object that carries out the transaction <br /> |

### onRinging

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

```
public void onRinging (SipSession session, 
                SipProfile caller, 
                String sessionDescription)
```

Called when an INVITE request is received.

<br />

| Parameters ||
|---|---|
| `session` | `SipSession`: the session object that carries out the transaction <br /> |
| `caller` | `SipProfile`: the SIP profile of the caller <br /> |
| `sessionDescription` | `String`: the caller's session description <br /> |

### onRingingBack

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

```
public void onRingingBack (SipSession session)
```

Called when a RINGING response is received for the INVITE request sent

<br />

| Parameters ||
|---|---|
| `session` | `SipSession`: the session object that carries out the transaction <br /> |