java.lang.Object | |
↳ | android.net.sip.SipSession |
Represents a SIP session that is associated with a SIP dialog or a standalone transaction not within a dialog.
You can get a
SipSession
from
SipManager
with
createSipSession()
(when initiating calls) or
getSessionFor()
(when receiving calls).
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
SipSession.Listener | 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"). | |||||||||
|
SipSession.State | Defines SIP session states, such as "registering", "outgoing call", and "in call". |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
Answers an incoming call with the specified session description.
|
||||||||||
|
Changes the session description during a call.
|
||||||||||
|
Ends an established call, terminates an outgoing call or rejects an
incoming call.
|
||||||||||
|
Gets the call ID of the session.
|
||||||||||
|
Gets the IP address of the local host on which this SIP session runs.
|
||||||||||
|
Gets the SIP profile that this session is associated with.
|
||||||||||
|
Gets the SIP profile that this session is connected to.
|
||||||||||
|
Gets the session state.
|
||||||||||
|
Checks if the session is in a call.
|
||||||||||
|
Initiates a call to the specified profile.
|
||||||||||
|
Performs registration to the server specified by the associated local
profile.
|
||||||||||
|
Sets the listener to listen to the session events.
|
||||||||||
|
Performs unregistration to the server specified by the associated local
profile.
|
[Expand]
Inherited Methods
|
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Answers an incoming call with the specified session description. The
method is only valid to call when the session state is in
INCOMING_CALL
.
sessionDescription | the session description to answer this call |
---|---|
timeout |
the session will be timed out if the call is not
established within
timeout
seconds. Default value (defined
by SIP protocol) is used if
timeout
is zero or negative.
|
Changes the session description during a call. The method is only valid
to call when the session state is in
IN_CALL
.
sessionDescription | the new session description |
---|---|
timeout |
the session will be timed out if the call is not
established within
timeout
seconds. Default value (defined
by SIP protocol) is used if
timeout
is zero or negative.
|
Ends an established call, terminates an outgoing call or rejects an
incoming call. The method is only valid to call when the session state is
in
IN_CALL
,
INCOMING_CALL
,
OUTGOING_CALL
or
OUTGOING_CALL_RING_BACK
.
Gets the call ID of the session.
Gets the IP address of the local host on which this SIP session runs.
Gets the SIP profile that this session is associated with.
Gets the SIP profile that this session is connected to. Only available when the session is associated with a SIP dialog.
Gets the session state. The value returned must be one of the states in
SipSession.State
.
Checks if the session is in a call.
Initiates a call to the specified profile. The session listener is called
back upon defined session events. The method is only valid to call when
the session state is in
READY_TO_CALL
.
callee | the SIP profile to make the call to |
---|---|
sessionDescription | the session description of this call |
timeout |
the session will be timed out if the call is not
established within
timeout
seconds. Default value (defined
by SIP protocol) is used if
timeout
is zero or negative.
|
Performs registration to the server specified by the associated local
profile. The session listener is called back upon success or failure of
registration. The method is only valid to call when the session state is
in
READY_TO_CALL
.
duration | duration in second before the registration expires |
---|
Sets the listener to listen to the session events. A
SipSession
can only hold one listener at a time. Subsequent calls to this method
override the previous listener.
listener | to listen to the session events of this object |
---|
Performs unregistration to the server specified by the associated local
profile. Unregistration is technically the same as registration with zero
expiration duration. The session listener is called back upon success or
failure of unregistration. The method is only valid to call when the
session state is in
READY_TO_CALL
.