public interface SipStack
This SipStack interface defines the methods that are be used by an
application implementing the SipListener
interface to
control the architecture and setup of the SIP stack. These methods include:
SipProvider
's that represent
messaging objects that can be used by an application to send
Request
and Response
messages statelessly or statefully via Client and Server transactions.
ListeningPoint
's that represent
different ports and transports that a SipProvider can use to send and receive
messages.
SipStack Creation
An application must create a SipStack by invoking the
SipFactory.createSipStack(Properties)
method, ensuring the
SipFactory.setPathName(String)
is set. Following the naming
convention defined in SipFactory
, the implementation of
the SipStack interface must be called SipStackImpl. This specification also
defines a stack configuration mechanism using java.util.Properties, therefore
this constructor must also accept a properties argument:
The following table documents the static configuration properties which can be set for an implementation of a SipStack. This specification doesn't preclude additional values within a configuration properties object if understood by the underlying implementation. In order to change these properties after a SipStack has been initialized the SipStack must be deleted and recreated:
SipStack Property |
Description |
---|---|
android.javax.sip.IP_ADDRESS |
Deprecated v1.2. It is recommended in this specification that the IP
Address should be set using the enhanced ListeningPoint architecture,
therefore this property is no longer mandatory. When this parameter is
specified as null, a singleton stack instance will be created and returned
by the SipFactory and the IP Address attributes can be managed via the
|
android.javax.sip.STACK_NAME |
Sets a user friendly name to identify the underlying stack implementation to the property value i.e. NISTv1.2. The stack name property should contain no spaces. This property is mandatory. |
android.javax.sip.OUTBOUND_PROXY |
Sets the outbound proxy of the SIP Stack. The fromat for this string is "ipaddress:port/transport" i.e. 129.1.22.333:5060/UDP. This property is optional. |
android.javax.sip.ROUTER_PATH |
Sets the fully qualified classpath to the application supplied Router object that determines how to route messages when the stack cannot make a routing decision ( ie. non-sip URIs). In version 1.2 of this specification, out of Dialog SIP URIs are routed by the Routing algorithm defined in RFC 3261 which is implemented internally by the stack provided that android.javax.sip.USE_ROUTER_FOR_ALL_URIS is set to false. In this case, the installed Router object is consulted for routing decisions pertaining to non-SIP URIs. An application defined Router object must implement the android.javax.sip.Router interface. This property is optional. |
android.javax.sip.EXTENSION_METHODS |
This configuration value informs the underlying implementation of supported extension methods that create new dialog's. This list must not include methods that are natively supported by this specification such as INVITE, SUBSCRIBE and REFER. This configuration flag should only be used for dialog creating extension methods, other extension methods that don't create dialogs can be used using the method parameter on Request assuming the implementation understands the method. If more than one method is supported in this property each extension should be seprated with a colon for example "FOO:BAR". This property is optional. |
android.javax.sip.RETRANSMISSION_FILTER |
Deprecated v1.2. Applications can request
retransmission alerts from the
The default retransmission behaviour of this specification is dependent on the application core and is defined as follows:
|
android.javax.sip.AUTOMATIC_DIALOG_SUPPORT |
This property specifies the defined values
'ON' and 'OFF'. The default value is 'ON'. The default behavior represents a
common mode of stack operation and allows the construction of simple user
agents. This property is optional. This is summarized as:
The ability to turn of dialog support is motivated by dialog free servers (such as proxy servers) that do not want to pay the overhead of the dialog layer and user agents that may want to create multiple dialogs for a single INVITE (as a result of forking by proxy servers). The following behavior is defined when the configuration parameter is set to 'OFF'.Since v1.2. |
android.javax.sip.FORKABLE_EVENTS |
Comma separated list of events for which the implementation should expect forked SUBSCRIBE dialogs. Each element of this list must have the syntax packagename.eventname This configuration parameter is provided in order to support the following behavior ( defined in RFC 3265): Successful SUBSCRIBE requests will normally receive only one 200-class response; however, due to forking, the subscription may have been accepted by multiple nodes. The subscriber MUST therefore be prepared to receive NOTIFY requests with "From:" tags which differ from the "To:" tag received in the SUBSCRIBE 200-class response. If multiple NOTIFY messages are received in different dialogs in response to a single SUBSCRIBE message, each dialog represents a different destination to which the SUBSCRIBE request was forked. Each event package MUST specify whether forked SUBSCRIBE requests are allowed to install multiple subscriptions.If such behavior is not allowed, the first potential dialog-establishing message will create a dialog. All subsequent NOTIFY messages which correspond to the SUBSCRIBE message (i.e., match "To","From", "From" header "tag" parameter, "Call-ID", "CSeq", "Event", and "Event" header "id" parameter) but which do not match the dialog would be rejected with a 481 response. This property is optional. Since v1.2 |
android.javax.sip.USE_ROUTER_FOR_ALL_URIS |
If set to Since v1.2. |
SipFactory
,
SipProvider
Modifier and Type | Method and Description |
---|---|
ListeningPoint |
createListeningPoint(int port,
String transport)
Deprecated.
Since v1.2. This has been replaced by
createListeningPoint(String, int, String)
For backwards compatibility with v1.1 implementations should support this method.
Implementations should throw |
ListeningPoint |
createListeningPoint(String ipAddress,
int port,
String transport)
Creates a ListeningPoint a given IP address, port and transport.
|
SipProvider |
createSipProvider(ListeningPoint listeningPoint)
Creates a new peer SipProvider on this SipStack on a specified
ListeningPoint and returns a reference to the newly created SipProvider
object.
|
void |
deleteListeningPoint(ListeningPoint listeningPoint)
Deletes the specified ListeningPoint attached to this SipStack.
|
void |
deleteSipProvider(SipProvider sipProvider)
Deletes the specified peer SipProvider attached to this SipStack.
|
String |
getIPAddress()
Gets the IP Address that identifies this SipStack instance.
|
Iterator |
getListeningPoints()
Returns an Iterator of existing ListeningPoints created by this SipStack.
|
Router |
getRouter()
Gets the Router object that identifies the default Router information of
this SipStack.
|
Iterator |
getSipProviders()
Returns an Iterator of existing SipProviders that have been created by
this SipStack.
|
String |
getStackName()
Gets the user friendly name that identifies this SipStack instance.
|
boolean |
isRetransmissionFilterActive()
Deprecated.
Since v1.2. This retransmission filter property has been deprecated
as a SIP Stack property. Applications can enable retransmission alerts by using the
ServerTransaction.enableRetransmissionAlerts() method. |
void |
start()
This method initiates the active processing of the stack.
|
void |
stop()
This methods initiates the shutdown of the stack.
|
SipProvider createSipProvider(ListeningPoint listeningPoint) throws ObjectInUseException
listeningPoint
- listening point for this SipProvider.ObjectInUseException
- if another SipProvider is already associated
with this ListeningPoint.void deleteSipProvider(SipProvider sipProvider) throws ObjectInUseException
sipProvider
- the peer SipProvider to be deleted from this
SipStack.ObjectInUseException
- if the specified SipProvider cannot be
deleted because the SipProvider is currently in use.Iterator getSipProviders()
ListeningPoint createListeningPoint(int port, String transport) throws TransportNotSupportedException, InvalidArgumentException
createListeningPoint(String, int, String)
For backwards compatibility with v1.1 implementations should support this method.
Implementations should throw port
- the port of the new ListeningPoint.transport
- the transport of the new ListeningPoint.TansportNotSupportedException
- if the specified transport is not supported by this SipStack.InvalidArgumentException
- if the specified port is invalid.TransportNotSupportedException
ListeningPoint createListeningPoint(String ipAddress, int port, String transport) throws TransportNotSupportedException, InvalidArgumentException
SipException
- if the Listening point cannot be created for any reason or if the
stack has specified a default IP address that differs from the IP address specified
for this method.InvalidArgumentException
TransportNotSupportedException
void deleteListeningPoint(ListeningPoint listeningPoint) throws ObjectInUseException
listeningPoint
- the SipProvider to be deleted from this SipStack.ObjectInUseException
- if the specified ListeningPoint cannot be deleted because the
ListeningPoint is currently in use.Iterator getListeningPoints()
String getStackName()
SipFactory.createSipStack(Properties)
method upon creation of the
SipStack object.String getIPAddress()
ListeningPoint
.
For backwards compatability if an IP address is specified in the
Properties object passed to the
SipFactory.createSipStack(Properties)
method upon creation of
the SipStack object then this becomes the default IP address of the
SipStack object, ListeningPoints can then be created on this IP Address.Router getRouter()
SipFactory.createSipStack(Properties)
method upon creation of
the SipStack object.void stop()
void start() throws SipException
SipException
- if the stack cannot be started due to some system
level failure.boolean isRetransmissionFilterActive()
ServerTransaction.enableRetransmissionAlerts()
method.SipFactory.createSipStack(Properties)
method upon creation of the
SipStack object.
The default value of the retransmission filter boolean is false
. When this value is set to true
, retransmissions
of ACK's and 2xx responses to an INVITE transaction are handled by the
SipProvider, hence the application will not receive
Timeout.RETRANSMIT
notifications encapsulated in
TimeoutEvent
's, however an application will be
notified if the underlying transaction expires with a
Timeout.TRANSACTION
notification encapsulated in a TimeoutEvent.
true
if
the filter is set, false
otherwise.Copyright © 2016. All Rights Reserved.