SipAudioCall
open classSipAudioCall
| kotlin.Any | |
| ↳ | android.net.sip.SipAudioCall |
Handles an Internet audio call over SIP. You can instantiate this class with SipManager, using android.net.sip.SipManager#makeAudioCall and takeAudioCall().
Note: Using this class require the android.Manifest.permission#INTERNET and android.Manifest.permission#USE_SIP permissions. In addition, startAudio requires the android.Manifest.permission#RECORD_AUDIO, android.Manifest.permission#ACCESS_WIFI_STATE, and android.Manifest.permission#WAKE_LOCK permissions; and setSpeakerMode() requires the android.Manifest.permission#MODIFY_AUDIO_SETTINGS permission.
Summary
| Nested classes | |
|---|---|
| open |
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"). |
| Public constructors | |
|---|---|
SipAudioCall(context: Context!, localProfile: SipProfile!)Creates a call object with the local SIP profile. |
|
| Public methods | |
|---|---|
| open Unit |
answerCall(timeout: Int)Answers a call. |
| open Unit |
attachCall(session: SipSession!, sessionDescription: String!)Attaches an incoming call to this call object. |
| open Unit |
close()Closes this object. |
| open Unit |
continueCall(timeout: Int)Continues a call that's on hold. |
| open Unit |
endCall()Ends a call. |
| open SipProfile! |
Gets the local SIP profile. |
| open SipProfile! |
Gets the peer's SIP profile. |
| open Int |
getState()Gets the state of the |
| open Unit |
Puts a call on hold. |
| open Boolean |
isInCall()Checks if the call is established. |
| open Boolean |
isMuted()Checks if the call is muted. |
| open Boolean |
isOnHold()Checks if the call is on hold. |
| open Unit |
makeCall(peerProfile: SipProfile!, sipSession: SipSession!, timeout: Int)Initiates an audio call to the specified profile. |
| open Unit |
Sends a DTMF code. |
| open Unit |
Sends a DTMF code. |
| open Unit |
setListener(listener: SipAudioCall.Listener!)Sets the listener to listen to the audio call events. |
| open Unit |
setListener(listener: SipAudioCall.Listener!, callbackImmediately: Boolean)Sets the listener to listen to the audio call events. |
| open Unit |
setSpeakerMode(speakerMode: Boolean)Puts the device to speaker mode. |
| open Unit |
Starts the audio for the established call. |
| open Unit |
Toggles mute. |
Public constructors
SipAudioCall
SipAudioCall(
context: Context!,
localProfile: SipProfile!)
Creates a call object with the local SIP profile.
| Parameters | |
|---|---|
context |
Context!: the context for accessing system services such as ringtone, audio, WIFI etc |
Public methods
answerCall
open funanswerCall(timeout: Int): Unit
Deprecated: Deprecated in Java.
Answers a call. The attempt will be timed out if the call is not established within timeout seconds and onError(SipAudioCall, SipErrorCode.TIME_OUT, String) will be called.
| Parameters | |
|---|---|
timeout |
Int: the timeout value in seconds. Default value (defined by SIP protocol) is used if timeout is zero or negative. |
| Exceptions | |
|---|---|
android.net.sip.SipException |
if the SIP service fails to answer the call |
attachCall
open funattachCall(
session: SipSession!,
sessionDescription: String!
): Unit
Deprecated: Deprecated in Java.
Attaches an incoming call to this call object.
| Parameters | |
|---|---|
session |
SipSession!: the session that receives the incoming call |
sessionDescription |
String!: the session description of the incoming call |
| Exceptions | |
|---|---|
android.net.sip.SipException |
if the SIP service fails to attach this object to the session or VOIP API is not supported by the device |
close
open funclose(): Unit
Deprecated: Deprecated in Java.
Closes this object. This object is not usable after being closed.
continueCall
open funcontinueCall(timeout: Int): Unit
Deprecated: Deprecated in Java.
Continues a call that's on hold. When succeeds, Listener.onCallEstablished is called. The attempt will be timed out if the call is not established within timeout seconds and onError(SipAudioCall, SipErrorCode.TIME_OUT, String) will be called.
| Parameters | |
|---|---|
timeout |
Int: the timeout value in seconds. Default value (defined by SIP protocol) is used if timeout is zero or negative. |
| Exceptions | |
|---|---|
android.net.sip.SipException |
if the SIP service fails to unhold the call |
endCall
open funendCall(): Unit
Deprecated: Deprecated in Java.
Ends a call.
| Exceptions | |
|---|---|
android.net.sip.SipException |
if the SIP service fails to end the call |
getLocalProfile
open fungetLocalProfile(): SipProfile!
Deprecated: Deprecated in Java.
Gets the local SIP profile.
| Return | |
|---|---|
SipProfile! |
the local SIP profile |
getPeerProfile
open fungetPeerProfile(): SipProfile!
Deprecated: Deprecated in Java.
Gets the peer's SIP profile.
| Return | |
|---|---|
SipProfile! |
the peer's SIP profile |
getState
open fungetState(): Int
Deprecated: Deprecated in Java.
Gets the state of the SipSession that carries this call. The value returned must be one of the states in SipSession.State.
| Return | |
|---|---|
Int |
the session state |
holdCall
open funholdCall(timeout: Int): Unit
Deprecated: Deprecated in Java.
Puts a call on hold. When succeeds, Listener.onCallHeld is called. The attempt will be timed out if the call is not established within timeout seconds and onError(SipAudioCall, SipErrorCode.TIME_OUT, String) will be called.
| Parameters | |
|---|---|
timeout |
Int: the timeout value in seconds. Default value (defined by SIP protocol) is used if timeout is zero or negative. |
| Exceptions | |
|---|---|
android.net.sip.SipException |
if the SIP service fails to hold the call |
isInCall
open funisInCall(): Boolean
Deprecated: Deprecated in Java.
Checks if the call is established.
| Return | |
|---|---|
Boolean |
true if the call is established |
isMuted
open funisMuted(): Boolean
Deprecated: Deprecated in Java.
Checks if the call is muted.
| Return | |
|---|---|
Boolean |
true if the call is muted |
isOnHold
open funisOnHold(): Boolean
Deprecated: Deprecated in Java.
Checks if the call is on hold.
| Return | |
|---|---|
Boolean |
true if the call is on hold |
makeCall
open funmakeCall(
peerProfile: SipProfile!,
sipSession: SipSession!,
timeout: Int
): Unit
Deprecated: Deprecated in Java.
Initiates an audio call to the specified profile. The attempt will be timed out if the call is not established within timeout seconds and onError(SipAudioCall, SipErrorCode.TIME_OUT, String) will be called.
| Parameters | |
|---|---|
peerProfile |
SipProfile!: the SIP profile to make the call to |
sipSession |
SipSession!: the SipSession for carrying out the call |
timeout |
Int: the timeout value in seconds. Default value (defined by SIP protocol) is used if timeout is zero or negative. |
| Exceptions | |
|---|---|
android.net.sip.SipException |
if the SIP service fails to create a session for the call or VOIP API is not supported by the device |
sendDtmf
open funsendDtmf(code: Int): Unit
Deprecated: Deprecated in Java.
Sends a DTMF code. According to RFC 2883, event 0--9 maps to decimal value 0--9, '*' to 10, '#' to 11, event 'A'--'D' to 12--15, and event flash to 16. Currently, event flash is not supported.
| Parameters | |
|---|---|
code |
Int: the DTMF code to send. Value 0 to 15 (inclusive) are valid inputs. |
sendDtmf
open funsendDtmf(
code: Int,
result: Message!
): Unit
Deprecated: Deprecated in Java.
Sends a DTMF code. According to RFC 2883, event 0--9 maps to decimal value 0--9, '*' to 10, '#' to 11, event 'A'--'D' to 12--15, and event flash to 16. Currently, event flash is not supported.
| Parameters | |
|---|---|
code |
Int: the DTMF code to send. Value 0 to 15 (inclusive) are valid inputs. |
result |
Message!: the result message to send when done |
setListener
open funsetListener(listener: SipAudioCall.Listener!): Unit
Deprecated: Deprecated in Java.
Sets the listener to listen to the audio call events. The method calls #setListener.
| Parameters | |
|---|---|
listener |
SipAudioCall.Listener!: to listen to the audio call events of this object |
See Also
setListener
open funsetListener(
listener: SipAudioCall.Listener!,
callbackImmediately: Boolean
): Unit
Deprecated: Deprecated in Java.
Sets the listener to listen to the audio call events. A SipAudioCall can only hold one listener at a time. Subsequent calls to this method override the previous listener.
| Parameters | |
|---|---|
listener |
SipAudioCall.Listener!: to listen to the audio call events of this object |
callbackImmediately |
Boolean: set to true if the caller wants to be called back immediately on the current state |
setSpeakerMode
open funsetSpeakerMode(speakerMode: Boolean): Unit
Deprecated: Deprecated in Java.
Puts the device to speaker mode.
Note: Requires the android.Manifest.permission#MODIFY_AUDIO_SETTINGS permission.
| Parameters | |
|---|---|
speakerMode |
Boolean: set true to enable speaker mode; false to disable |
startAudio
open funstartAudio(): Unit
Deprecated: Deprecated in Java.
Starts the audio for the established call. This method should be called after Listener.onCallEstablished is called.
Note: Requires the android.Manifest.permission#RECORD_AUDIO, android.Manifest.permission#ACCESS_WIFI_STATE and android.Manifest.permission#WAKE_LOCK permissions.
toggleMute
open funtoggleMute(): Unit
Deprecated: Deprecated in Java.
Toggles mute.