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: [Constants](https://developer.android.com/reference/android/net/sip/SipManager#constants) \| [Methods](https://developer.android.com/reference/android/net/sip/SipManager#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/net/sip/SipManager#inhmethods)

# SipManager

*** ** * ** ***


`
public


class
SipManager
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

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

<br />

*** ** * ** ***


**This class was deprecated
in API level 31.**   

`https://developer.android.com/reference/android/net/sip/SipManager` and associated classes are no longer supported and
should not be used as the basis of future VOIP apps.

Provides APIs for SIP tasks, such as initiating SIP connections, and provides access to related
SIP services. This class is the starting point for any SIP actions. You can acquire an instance
of it with `https://developer.android.com/reference/android/net/sip/SipManager#newInstance(android.content.Context)`.

The APIs in this class allows you to:

- Create a `https://developer.android.com/reference/android/net/sip/SipSession` to get ready for making calls or listen for incoming calls. See `https://developer.android.com/reference/android/net/sip/SipManager#createSipSession(android.net.sip.SipProfile,%20android.net.sip.SipSession.Listener)` and `https://developer.android.com/reference/android/net/sip/SipManager#getSessionFor(android.content.Intent)`.
- Initiate and receive generic SIP calls or audio-only SIP calls. Generic SIP calls may be video, audio, or other, and are initiated with `https://developer.android.com/reference/android/net/sip/SipManager#open(android.net.sip.SipProfile)`. Audio-only SIP calls should be handled with a `https://developer.android.com/reference/android/net/sip/SipAudioCall`, which you can acquire with `https://developer.android.com/reference/android/net/sip/SipManager#makeAudioCall(android.net.sip.SipProfile,%20android.net.sip.SipProfile,%20android.net.sip.SipAudioCall.Listener,%20int)` and `https://developer.android.com/reference/android/net/sip/SipManager#takeAudioCall(android.content.Intent,%20android.net.sip.SipAudioCall.Listener)`.
- Register and unregister with a SIP service provider, with `https://developer.android.com/reference/android/net/sip/SipManager#register(android.net.sip.SipProfile,%20int,%20android.net.sip.SipRegistrationListener)` and `https://developer.android.com/reference/android/net/sip/SipManager#unregister(android.net.sip.SipProfile,%20android.net.sip.SipRegistrationListener)`.
- Verify session connectivity, with `https://developer.android.com/reference/android/net/sip/SipManager#isOpened(java.lang.String)` and `https://developer.android.com/reference/android/net/sip/SipManager#isRegistered(java.lang.String)`.

**Note:** Not all Android-powered devices support VOIP calls using
SIP. You should always call `https://developer.android.com/reference/android/net/sip/SipManager#isVoipSupported(android.content.Context)` to verify that the device supports VOIP calling and `https://developer.android.com/reference/android/net/sip/SipManager#isApiSupported(android.content.Context)` to verify that the device supports
the SIP APIs. Your application must also request the `https://developer.android.com/reference/android/Manifest.permission#INTERNET` and `https://developer.android.com/reference/android/Manifest.permission#USE_SIP`
permissions.

### Developer Guides

For more information about using SIP, read the
[Session Initiation Protocol](https://developer.android.com/guide/topics/network/sip)
developer guide.

<br />

## Summary

| ### Constants ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/sip/SipManager#EXTRA_CALL_ID` Key to retrieve the call ID from an incoming call intent. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/sip/SipManager#EXTRA_OFFER_SD` Key to retrieve the offered session description from an incoming call intent. |
| `int` | `https://developer.android.com/reference/android/net/sip/SipManager#INCOMING_CALL_RESULT_CODE` The result code to be sent back with the incoming call `https://developer.android.com/reference/android/app/PendingIntent`. |

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/net/sip/SipManager#close(java.lang.String)(https://developer.android.com/reference/java/lang/String localProfileUri) ` Closes the specified profile to not make/receive calls. |
| ` https://developer.android.com/reference/android/net/sip/SipSession` | ` https://developer.android.com/reference/android/net/sip/SipManager#createSipSession(android.net.sip.SipProfile,%20android.net.sip.SipSession.Listener)(https://developer.android.com/reference/android/net/sip/SipProfile localProfile, https://developer.android.com/reference/android/net/sip/SipSession.Listener listener) ` Creates a `https://developer.android.com/reference/android/net/sip/SipSession` with the specified profile. |
| ` static https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/net/sip/SipManager#getCallId(android.content.Intent)(https://developer.android.com/reference/android/content/Intent incomingCallIntent) ` Gets the call ID from the specified incoming call broadcast intent. |
| ` static https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/net/sip/SipManager#getOfferSessionDescription(android.content.Intent)(https://developer.android.com/reference/android/content/Intent incomingCallIntent) ` Gets the offer session description from the specified incoming call broadcast intent. |
| ` https://developer.android.com/reference/android/net/sip/SipSession` | ` https://developer.android.com/reference/android/net/sip/SipManager#getSessionFor(android.content.Intent)(https://developer.android.com/reference/android/content/Intent incomingCallIntent) ` Gets the `https://developer.android.com/reference/android/net/sip/SipSession` that handles the incoming call. |
| ` static boolean` | ` https://developer.android.com/reference/android/net/sip/SipManager#isApiSupported(android.content.Context)(https://developer.android.com/reference/android/content/Context context) ` Returns true if the SIP API is supported by the system. |
| ` static boolean` | ` https://developer.android.com/reference/android/net/sip/SipManager#isIncomingCallIntent(android.content.Intent)(https://developer.android.com/reference/android/content/Intent intent) ` Checks if the intent is an incoming call broadcast intent. |
| ` boolean` | ` https://developer.android.com/reference/android/net/sip/SipManager#isOpened(java.lang.String)(https://developer.android.com/reference/java/lang/String localProfileUri) ` Checks if the specified profile is opened in the SIP service for making and/or receiving calls. |
| ` boolean` | ` https://developer.android.com/reference/android/net/sip/SipManager#isRegistered(java.lang.String)(https://developer.android.com/reference/java/lang/String localProfileUri) ` Checks if the SIP service has successfully registered the profile to the SIP provider (specified in the profile) for receiving calls. |
| ` static boolean` | ` https://developer.android.com/reference/android/net/sip/SipManager#isSipWifiOnly(android.content.Context)(https://developer.android.com/reference/android/content/Context context) ` Returns true if SIP is only available on WIFI. |
| ` static boolean` | ` https://developer.android.com/reference/android/net/sip/SipManager#isVoipSupported(android.content.Context)(https://developer.android.com/reference/android/content/Context context) ` Returns true if the system supports SIP-based VOIP API. |
| ` https://developer.android.com/reference/android/net/sip/SipAudioCall` | ` https://developer.android.com/reference/android/net/sip/SipManager#makeAudioCall(java.lang.String,%20java.lang.String,%20android.net.sip.SipAudioCall.Listener,%20int)(https://developer.android.com/reference/java/lang/String localProfileUri, https://developer.android.com/reference/java/lang/String peerProfileUri, https://developer.android.com/reference/android/net/sip/SipAudioCall.Listener listener, int timeout) ` Creates a `https://developer.android.com/reference/android/net/sip/SipAudioCall` to make an audio call. |
| ` https://developer.android.com/reference/android/net/sip/SipAudioCall` | ` https://developer.android.com/reference/android/net/sip/SipManager#makeAudioCall(android.net.sip.SipProfile,%20android.net.sip.SipProfile,%20android.net.sip.SipAudioCall.Listener,%20int)(https://developer.android.com/reference/android/net/sip/SipProfile localProfile, https://developer.android.com/reference/android/net/sip/SipProfile peerProfile, https://developer.android.com/reference/android/net/sip/SipAudioCall.Listener listener, int timeout) ` Creates a `https://developer.android.com/reference/android/net/sip/SipAudioCall` to make a call. |
| ` static https://developer.android.com/reference/android/net/sip/SipManager` | ` https://developer.android.com/reference/android/net/sip/SipManager#newInstance(android.content.Context)(https://developer.android.com/reference/android/content/Context context) ` Creates a manager instance. |
| ` void` | ` https://developer.android.com/reference/android/net/sip/SipManager#open(android.net.sip.SipProfile,%20android.app.PendingIntent,%20android.net.sip.SipRegistrationListener)(https://developer.android.com/reference/android/net/sip/SipProfile localProfile, https://developer.android.com/reference/android/app/PendingIntent incomingCallPendingIntent, https://developer.android.com/reference/android/net/sip/SipRegistrationListener listener) ` Opens the profile for making calls and/or receiving generic SIP calls. |
| ` void` | ` https://developer.android.com/reference/android/net/sip/SipManager#open(android.net.sip.SipProfile)(https://developer.android.com/reference/android/net/sip/SipProfile localProfile) ` Opens the profile for making generic SIP calls. |
| ` void` | ` https://developer.android.com/reference/android/net/sip/SipManager#register(android.net.sip.SipProfile,%20int,%20android.net.sip.SipRegistrationListener)(https://developer.android.com/reference/android/net/sip/SipProfile localProfile, int expiryTime, https://developer.android.com/reference/android/net/sip/SipRegistrationListener listener) ` Manually registers the profile to the corresponding SIP provider for receiving calls. |
| ` void` | ` https://developer.android.com/reference/android/net/sip/SipManager#setRegistrationListener(java.lang.String,%20android.net.sip.SipRegistrationListener)(https://developer.android.com/reference/java/lang/String localProfileUri, https://developer.android.com/reference/android/net/sip/SipRegistrationListener listener) ` Sets the listener to listen to registration events. |
| ` https://developer.android.com/reference/android/net/sip/SipAudioCall` | ` https://developer.android.com/reference/android/net/sip/SipManager#takeAudioCall(android.content.Intent,%20android.net.sip.SipAudioCall.Listener)(https://developer.android.com/reference/android/content/Intent incomingCallIntent, https://developer.android.com/reference/android/net/sip/SipAudioCall.Listener listener) ` Creates a `https://developer.android.com/reference/android/net/sip/SipAudioCall` to take an incoming call. |
| ` void` | ` https://developer.android.com/reference/android/net/sip/SipManager#unregister(android.net.sip.SipProfile,%20android.net.sip.SipRegistrationListener)(https://developer.android.com/reference/android/net/sip/SipProfile localProfile, https://developer.android.com/reference/android/net/sip/SipRegistrationListener listener) ` Manually unregisters the profile from the corresponding SIP provider for stop receiving further calls. |

| ### 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*. | ||

## Constants

### EXTRA_CALL_ID

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

```
public static final String EXTRA_CALL_ID
```

Key to retrieve the call ID from an incoming call intent.

<br />

**See also:**

- `https://developer.android.com/reference/android/net/sip/SipManager#open(android.net.sip.SipProfile,%20android.app.PendingIntent,%20android.net.sip.SipRegistrationListener)`

Constant Value:

"android:sipCallID"


### EXTRA_OFFER_SD

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

```
public static final String EXTRA_OFFER_SD
```

Key to retrieve the offered session description from an incoming call
intent.

<br />

**See also:**

- `https://developer.android.com/reference/android/net/sip/SipManager#open(android.net.sip.SipProfile,%20android.app.PendingIntent,%20android.net.sip.SipRegistrationListener)`

Constant Value:

"android:sipOfferSD"


### INCOMING_CALL_RESULT_CODE

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

```
public static final int INCOMING_CALL_RESULT_CODE
```

The result code to be sent back with the incoming call
`https://developer.android.com/reference/android/app/PendingIntent`.

<br />

**See also:**

- `https://developer.android.com/reference/android/net/sip/SipManager#open(android.net.sip.SipProfile,%20android.app.PendingIntent,%20android.net.sip.SipRegistrationListener)`

Constant Value:

101
(0x00000065)


## Public methods

### close

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

```
public void close (String localProfileUri)
```

Closes the specified profile to not make/receive calls. All the resources
that were allocated to the profile are also released.

<br />

| Parameters ||
|---|---|
| `localProfileUri` | `String`: the URI of the profile to close <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/net/sip/SipException` | if calling the SIP service results in an error |

### createSipSession

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

```
public SipSession createSipSession (SipProfile localProfile, 
                SipSession.Listener listener)
```

Creates a `https://developer.android.com/reference/android/net/sip/SipSession` with the specified profile. Use other
methods, if applicable, instead of interacting with `https://developer.android.com/reference/android/net/sip/SipSession`
directly.

<br />

| Parameters ||
|---|---|
| `localProfile` | `SipProfile`: the SIP profile the session is associated with <br /> |
| `listener` | `SipSession.Listener`: to listen to SIP session events <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/sip/SipSession` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/net/sip/SipException` |   |

### getCallId

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

```
public static String getCallId (Intent incomingCallIntent)
```

Gets the call ID from the specified incoming call broadcast intent.

<br />

| Parameters ||
|---|---|
| `incomingCallIntent` | `Intent`: the incoming call broadcast intent <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the call ID or null if the intent does not contain it <br /> |

### getOfferSessionDescription

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

```
public static String getOfferSessionDescription (Intent incomingCallIntent)
```

Gets the offer session description from the specified incoming call
broadcast intent.

<br />

| Parameters ||
|---|---|
| `incomingCallIntent` | `Intent`: the incoming call broadcast intent <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the offer session description or null if the intent does not have it <br /> |

### getSessionFor

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

```
public SipSession getSessionFor (Intent incomingCallIntent)
```

Gets the `https://developer.android.com/reference/android/net/sip/SipSession` that handles the incoming call. For audio
calls, consider to use `https://developer.android.com/reference/android/net/sip/SipAudioCall` to handle the incoming call.
See `https://developer.android.com/reference/android/net/sip/SipManager#takeAudioCall(android.content.Intent,%20android.net.sip.SipAudioCall.Listener)`. Note that the method may be called only once
for the same intent. For subsequent calls on the same intent, the method
returns null.

<br />

| Parameters ||
|---|---|
| `incomingCallIntent` | `Intent`: the incoming call broadcast intent <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/sip/SipSession` | the session object that handles the incoming call <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/net/sip/SipException` |   |

### isApiSupported

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

```
public static boolean isApiSupported (Context context)
```

Returns true if the SIP API is supported by the system.

<br />

| Parameters ||
|---|---|
| `context` | `Context` <br /> |

| Returns ||
|---|---|
| `boolean` | <br /> |

### isIncomingCallIntent

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

```
public static boolean isIncomingCallIntent (Intent intent)
```

Checks if the intent is an incoming call broadcast intent.

<br />

| Parameters ||
|---|---|
| `intent` | `Intent`: the intent in question <br /> |

| Returns ||
|---|---|
| `boolean` | true if the intent is an incoming call broadcast intent <br /> |

### isOpened

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

```
public boolean isOpened (String localProfileUri)
```

Checks if the specified profile is opened in the SIP service for
making and/or receiving calls.

<br />

| Parameters ||
|---|---|
| `localProfileUri` | `String`: the URI of the profile in question <br /> |

| Returns ||
|---|---|
| `boolean` | true if the profile is enabled to receive calls <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/net/sip/SipException` | if calling the SIP service results in an error |

### isRegistered

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

```
public boolean isRegistered (String localProfileUri)
```

Checks if the SIP service has successfully registered the profile to the
SIP provider (specified in the profile) for receiving calls. Returning
true from this method also implies the profile is opened
(`https://developer.android.com/reference/android/net/sip/SipManager#isOpened(java.lang.String)`).

<br />

| Parameters ||
|---|---|
| `localProfileUri` | `String`: the URI of the profile in question <br /> |

| Returns ||
|---|---|
| `boolean` | true if the profile is registered to the SIP provider; false if the profile has not been opened in the SIP service or the SIP service has not yet successfully registered the profile to the SIP provider <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/net/sip/SipException` | if calling the SIP service results in an error |

### isSipWifiOnly

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

```
public static boolean isSipWifiOnly (Context context)
```

Returns true if SIP is only available on WIFI.

<br />

| Parameters ||
|---|---|
| `context` | `Context` <br /> |

| Returns ||
|---|---|
| `boolean` | <br /> |

### isVoipSupported

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

```
public static boolean isVoipSupported (Context context)
```

Returns true if the system supports SIP-based VOIP API.

<br />

| Parameters ||
|---|---|
| `context` | `Context` <br /> |

| Returns ||
|---|---|
| `boolean` | <br /> |

### makeAudioCall

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

```
public SipAudioCall makeAudioCall (String localProfileUri, 
                String peerProfileUri, 
                SipAudioCall.Listener listener, 
                int timeout)
```

Creates a `https://developer.android.com/reference/android/net/sip/SipAudioCall` to make an audio call. The attempt will be
timed out if the call is not established within `timeout` seconds
and
`https://developer.android.com/reference/android/net/sip/SipAudioCall.Listener#onError(android.net.sip.SipAudioCall,%20int,%20java.lang.String)`
will be called.

<br />

| Parameters ||
|---|---|
| `localProfileUri` | `String`: URI of the SIP profile to make the call from <br /> |
| `peerProfileUri` | `String`: URI of the SIP profile to make the call to <br /> |
| `listener` | `SipAudioCall.Listener`: to listen to the call events from `https://developer.android.com/reference/android/net/sip/SipAudioCall`; can be null <br /> |
| `timeout` | `int`: the timeout value in seconds. Default value (defined by SIP protocol) is used if `timeout` is zero or negative. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/sip/SipAudioCall` | a `https://developer.android.com/reference/android/net/sip/SipAudioCall` object <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/net/sip/SipException` | if calling the SIP service results in an error or VOIP API is not supported by the device |

**See also:**

- `https://developer.android.com/reference/android/net/sip/SipAudioCall.Listener#onError(android.net.sip.SipAudioCall,%20int,%20java.lang.String)`
- `https://developer.android.com/reference/android/net/sip/SipManager#isVoipSupported(android.content.Context)`

### makeAudioCall

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

```
public SipAudioCall makeAudioCall (SipProfile localProfile, 
                SipProfile peerProfile, 
                SipAudioCall.Listener listener, 
                int timeout)
```

Creates a `https://developer.android.com/reference/android/net/sip/SipAudioCall` to make a call. The attempt will be timed
out if the call is not established within `timeout` seconds and
`https://developer.android.com/reference/android/net/sip/SipAudioCall.Listener#onError(android.net.sip.SipAudioCall,%20int,%20java.lang.String)`
will be called.

<br />

| Parameters ||
|---|---|
| `localProfile` | `SipProfile`: the SIP profile to make the call from <br /> |
| `peerProfile` | `SipProfile`: the SIP profile to make the call to <br /> |
| `listener` | `SipAudioCall.Listener`: to listen to the call events from `https://developer.android.com/reference/android/net/sip/SipAudioCall`; can be null <br /> |
| `timeout` | `int`: the timeout value in seconds. Default value (defined by SIP protocol) is used if `timeout` is zero or negative. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/sip/SipAudioCall` | a `https://developer.android.com/reference/android/net/sip/SipAudioCall` object <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/net/sip/SipException` | if calling the SIP service results in an error or VOIP API is not supported by the device |

**See also:**

- `https://developer.android.com/reference/android/net/sip/SipAudioCall.Listener#onError(android.net.sip.SipAudioCall,%20int,%20java.lang.String)`
- `https://developer.android.com/reference/android/net/sip/SipManager#isVoipSupported(android.content.Context)`

### newInstance

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

```
public static SipManager newInstance (Context context)
```

Creates a manager instance. Returns null if SIP API is not supported.

<br />

| Parameters ||
|---|---|
| `context` | `Context`: application context for creating the manager object <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/sip/SipManager` | the manager instance or null if SIP API is not supported <br /> |

### open

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

```
public void open (SipProfile localProfile, 
                PendingIntent incomingCallPendingIntent, 
                SipRegistrationListener listener)
```

Opens the profile for making calls and/or receiving generic SIP calls. The caller may
make subsequent calls through `https://developer.android.com/reference/android/net/sip/SipManager#makeAudioCall(android.net.sip.SipProfile,%20android.net.sip.SipProfile,%20android.net.sip.SipAudioCall.Listener,%20int)`. If the
auto-registration option is enabled in the profile, the SIP service
will register the profile to the corresponding SIP provider periodically
in order to receive calls from the provider. When the SIP service
receives a new call, it will send out an intent with the provided action
string. The intent contains a call ID extra and an offer session
description string extra. Use `https://developer.android.com/reference/android/net/sip/SipManager#getCallId(android.content.Intent)` and
`https://developer.android.com/reference/android/net/sip/SipManager#getOfferSessionDescription(android.content.Intent)` to retrieve those extras.

<br />

| Parameters ||
|---|---|
| `localProfile` | `SipProfile`: the SIP profile to receive incoming calls for <br /> |
| `incomingCallPendingIntent` | `PendingIntent`: When an incoming call is received, the SIP service will call `https://developer.android.com/reference/android/app/PendingIntent#send(android.content.Context,%20int,%20android.content.Intent)` to send back the intent to the caller with `https://developer.android.com/reference/android/net/sip/SipManager#INCOMING_CALL_RESULT_CODE` as the result code and the intent to fill in the call ID and session description information. It cannot be null. <br /> |
| `listener` | `SipRegistrationListener`: to listen to registration events; can be null <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/net/sip/SipException` | if the profile contains incorrect settings or calling the SIP service results in an error |
| `https://developer.android.com/reference/java/lang/NullPointerException` | if `incomingCallPendingIntent` is null |

**See also:**

- `https://developer.android.com/reference/android/net/sip/SipManager#getCallId(android.content.Intent)`
- `https://developer.android.com/reference/android/net/sip/SipManager#getOfferSessionDescription(android.content.Intent)`
- `https://developer.android.com/reference/android/net/sip/SipManager#takeAudioCall(android.content.Intent,%20android.net.sip.SipAudioCall.Listener)`
- `https://developer.android.com/reference/android/net/sip/SipManager#isIncomingCallIntent(android.content.Intent)`
- `https://developer.android.com/reference/android/net/sip/SipManager#getCallId(android.content.Intent)`
- `https://developer.android.com/reference/android/net/sip/SipManager#getOfferSessionDescription(android.content.Intent)`

### open

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

```
public void open (SipProfile localProfile)
```

Opens the profile for making generic SIP calls. The caller may make subsequent calls
through `https://developer.android.com/reference/android/net/sip/SipManager#makeAudioCall(android.net.sip.SipProfile,%20android.net.sip.SipProfile,%20android.net.sip.SipAudioCall.Listener,%20int)`. If one also wants to receive calls on the
profile, use
`https://developer.android.com/reference/android/net/sip/SipManager#open(android.net.sip.SipProfile,%20android.app.PendingIntent,%20android.net.sip.SipRegistrationListener)`
instead.

<br />

| Parameters ||
|---|---|
| `localProfile` | `SipProfile`: the SIP profile to make calls from <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/net/sip/SipException` | if the profile contains incorrect settings or calling the SIP service results in an error |

### register

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

```
public void register (SipProfile localProfile, 
                int expiryTime, 
                SipRegistrationListener listener)
```

Manually registers the profile to the corresponding SIP provider for
receiving calls.
`https://developer.android.com/reference/android/net/sip/SipManager#open(android.net.sip.SipProfile,%20android.app.PendingIntent,%20android.net.sip.SipRegistrationListener)` is
still needed to be called at least once in order for the SIP service to
notify the caller with the `https://developer.android.com/reference/android/app/PendingIntent` when an incoming call is
received.

<br />

| Parameters ||
|---|---|
| `localProfile` | `SipProfile`: the SIP profile to register with <br /> |
| `expiryTime` | `int`: registration expiration time (in seconds) <br /> |
| `listener` | `SipRegistrationListener`: to listen to the registration events <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/net/sip/SipException` | if calling the SIP service results in an error |

### setRegistrationListener

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

```
public void setRegistrationListener (String localProfileUri, 
                SipRegistrationListener listener)
```

Sets the listener to listen to registration events. No effect if the
profile has not been opened to receive calls (see
`https://developer.android.com/reference/android/net/sip/SipManager#open(android.net.sip.SipProfile,%20android.app.PendingIntent,%20android.net.sip.SipRegistrationListener)`).

<br />

| Parameters ||
|---|---|
| `localProfileUri` | `String`: the URI of the profile <br /> |
| `listener` | `SipRegistrationListener`: to listen to registration events; can be null <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/net/sip/SipException` | if calling the SIP service results in an error |

### takeAudioCall

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

```
public SipAudioCall takeAudioCall (Intent incomingCallIntent, 
                SipAudioCall.Listener listener)
```

Creates a `https://developer.android.com/reference/android/net/sip/SipAudioCall` to take an incoming call. Before the call
is returned, the listener will receive a
`https://developer.android.com/reference/android/net/sip/SipAudioCall.Listener#onRinging(android.net.sip.SipAudioCall,%20android.net.sip.SipProfile)`
callback.

<br />

| Parameters ||
|---|---|
| `incomingCallIntent` | `Intent`: the incoming call broadcast intent <br /> |
| `listener` | `SipAudioCall.Listener`: to listen to the call events from `https://developer.android.com/reference/android/net/sip/SipAudioCall`; can be null <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/sip/SipAudioCall` | a `https://developer.android.com/reference/android/net/sip/SipAudioCall` object <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/net/sip/SipException` | if calling the SIP service results in an error |

### unregister

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

```
public void unregister (SipProfile localProfile, 
                SipRegistrationListener listener)
```

Manually unregisters the profile from the corresponding SIP provider for
stop receiving further calls. This may interference with the auto
registration process in the SIP service if the auto-registration option
in the profile is enabled.

<br />

| Parameters ||
|---|---|
| `localProfile` | `SipProfile`: the SIP profile to register with <br /> |
| `listener` | `SipRegistrationListener`: to listen to the registration events <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/net/sip/SipException` | if calling the SIP service results in an error |