This document details basic procedures for system administrators installing, configuring, and managing Rhino SIP Servlet.

About Rhino SIP Servlet

Rhino SIP Servlet lets users deploy SIP Servlet applications alongside SLEE applications in the same Rhino instance.

It works using a SLEE Resource Adaptor (RA) and supporting libraries, which together provide a SIP Servlet 1.1 container environment inside the Rhino’s JAIN SLEE container. SIP Servlet applications can then be deployed into Rhino, without being aware they are running on a SLEE.

Note Rhino SIP Servlet adds SIP Servlet 1.1 (JSR289) support to the OpenCloud Rhino JAIN SLEE platform.

Installing and configuring Rhino SIP Servlet

Installing Rhino SIP Servlet means installing the Rhino SIP Servlet RA and its supporting libraries, and configuring the RA with suitable settings for its environment, such as network addresses, ports and so on. Once installed, Rhino SIP Servlet can be managed using its command-line console (sipservlet-console) or Ant tasks.

Tip This guide explains the procedures for installing and managing Rhino SIP Servlet.

Installing Rhino SIP Servlet

To install the Rhino SIP servlet:

1

Check the system requirements:

  • OpenCloud Rhino SLEE 2.3.x or later (SDK or Production)

  • Java SDK 1.6

  • Apache Ant 1.8

2

Extract the Rhino SIP Servlet package:

  • Extract the sipservlet-<version>.zip file into the base directory of a Rhino (SDK or Production) installation.

    This creates a sipservlet-<version> directory under the Rhino base directory.

Warning
Update deploy.properties for other locations

The bundled deployment scripts assume that the package has been extracted into a Rhino base directory. You can extract it elsewhere, but you’ll need to manually update the $\{client.home\} property in deploy.properties to point to the actual Rhino base directory:

# Update to the actual Rhino client directory.
client.home=${sipservlet.basedir}/../client

The $\{client.home\} property must be set correctly so that the deployment scripts can communicate with a Rhino instance.

Note
What’s in the package

Here’s what’s in the package:

Folder/file What it’s for
du/

deployable unit jar files for the SIP Servlet SLEE components to be deployed.

lib/

Library jar files required by administration tools

doc/

Introductory documentation and Javadocs for APIs used by Rhino SIP Servlet.

deploy.properties

Specifies the $\{client.home\} directory.

deploy.xml

Ant build file for deploying the SIP Servlet RA.

common.xml

Ant build file that defines the Rhino SIP Servlet Ant tasks.

sipservlet-console

Shell script that invokes Rhino SIP Servlet’s command-line console.

examples/

Example SIP Servlet applications and deployment scripts.

3

Create a SIP Servlet RA entity:

  • First, start the Rhino instance where you’re deploying Rhino SIP Servlet.

  • The bundled deploy.xml file is an Ant script that creates a single SIP Servlet RA entity with a default configuration. Once the RA entity is created, it can be managed using sipservlet-console or the Rhino SIP Servlet Ant tasks. Run:

    $ ant -f deploy.xml

    This will:

    • install the SIP Servlet 1.1 API library

    • install the Rhino SIP Servlet container library

    • create SLEE profile tables for storing SIP Servlet RA configurations

    • install the Rhino SIP Servlet RA

    • create a Rhino SIP Servlet RA entity (instance) named ss

    • configure a default network interface for the RA entity (listen on port 5060)

    • activate the RA entity.

At this point, the SIP Servlet RA entity ss is active and listening on port 5060. No servlet applications have been installed yet, so any SIP requests will be rejected with a 500 Server Error response.

Tip The next sections describe how to configure Rhino SIP Servlet and deploy applications.

Rhino SIP Servlet Management Interfaces

Below are brief introductions to Rhino SIP Servlet’s command-line, Ant, and MBean management interfaces.

(Sections further in this document explain in more detail how they are used for particular tasks.)

Command-line console

The sipservlet-console command is an extension to Rhino’s rhino-console. When you run sipservlet-console, all Rhino management commands are available, plus several SIP Servlet-specific commands. The help command shows the available command categories, including SIP Servlet. For help on a particular category or command, help <category> or help <command>.

Tip For more detail on the SIP Servlet commands, please see the SIP Servlet Console Reference.

Setting CLIENT_HOME

The sipservlet-console script uses the CLIENT_HOME environment variable to locate the Rhino client directory and the rhino-console command. If Rhino SIP Servlet was extracted in the Rhino base directory as recommended, it’s not necessary to set CLIENT_HOME. Otherwise, you must set CLIENT_HOME in the shell to point to the correct location; for example:

$ export CLIENT_HOME=/home/user/rhino/client
$ ./sipservlet-console

RA entity parameter

All Rhino SIP Servlet console commands specify the RA entity name of the SIP Servlet RA entity being managed.

Note The examples throughout this guide assume the RA entity name "ss" (unless noted otherwise).

Ant tasks

Rhino SIP Servlet provides a set of Ant tasks for configuring the SIP Servlet RA and deploying SIP Servlet applications. The complete set of available tasks is described in the Ant.

Below are instructions for:

Enabling SIP Servlet tasks in your Ant build file

To make use of these tasks, an Ant build file must import Rhino SIP Servlet’s common.xml build file, and also declare a namespace prefix for these tasks using their antlib URI, antlib:com.opencloud.sipservlet.ant. For example:

<project name="my-project" xmlns:sipservlet="antlib:com.opencloud.sipservlet.ant">
  <import file="${user.home}/rhino/sipservlet/common.xml"/>

  <target name="deploy-servlet">
    <sipservlet:connect raentity="ss"/>
    <sipservlet:install srcfile="${jars}/my-servlet.sar"/>
    <sipservlet:activate appname="my-servlet"/>
  </target>
  ...
</project>

Here the namespace prefix sipservlet is used, so the tasks are invoked as <sipservlet:connect>, <sipservlet:install>, and so on. The prefix was declared by the xmlns:sipservlet attribute in the root element. The prefix can be anything, as long as it doesn’t conflict with other namespace prefixes declared in the build file.

Note The examples throughout this guide use the sipservlet prefix.

Connecting to an RA entity

The first SIP Servlet task to run in an Ant build must be the task. This establishes the management connection to a SIP Servlet RA entity, which will automatically be used by subsequent SIP Servlet Ant tasks running in the same build. A simple way to do this is to have an initialization target that calls , and ensure that other targets depend on the initialization target.

It’s also possible to have connections to multiple SIP Servlet RA entities in the same build. Here, the script connects to entities "foo" and "bar", and subsequent tasks can select a connection using the optional connectionrefid attribute:

<sipservlet:connect raentity="foo" id="ra1"/>
<sipservlet:connect raentity="bar" id="ra2"/>
...
<sipservlet:install connectionrefid="ra1" srcfile="${jars}/my-servlet.sar"/>
<sipservlet:install connectionrefid="ra2" srcfile="${jars}/my-servlet.sar"/>

All Rhino SIP Servlet Ant tasks support the connectionrefid attribute. If ommitted, the connection from the most recent is used automatically.

Setting Ant properties for installed applications

The optionally sets Ant project properties that can be used to refer to the application’s name and ServiceID in deployment scripts. This is useful because the script may not know these values in advance.

To set these properties when installing, use the optional prefix attribute on the task. For example:

<sipservlet:install srcfile="myservlet.sar" prefix="myservlet"/>

If installation is successful, the following project properties are automatically set:

Property Name Description
prefix.app.name

The deployed servlet application name.

prefix.service.name

deployed service’s ServiceID name.

prefix.service.vendor

deployed service’s ServiceID vendor.

prefix.service.version

deployed service’s ServiceID version.

Now a script can easily install and activate a servlet application, without knowing the ServiceID or application name in advance:

<sipservlet:install srcfile="myservlet.sar" prefix="myservlet"/>
<!-- successful install sets myservlet.app.name property. -->
<sipservlet:activate appname="${myservlet.app.name}"/>

Resolving previously installed applications

Sometimes the method above will not be suitable because it relies on the task running earlier in the script, which will not be the case when applications were already installed before the script was running. In these cases, scripts can use the task. This task looks up applications that are already installed and sets the Ant properties as above. Scripts just need to supply the installed application’s Deployable Unit URL:

<sipservlet:resolve url="file:/path/to/myservlet.sar" prefix="myservlet"/>
<sipservlet:deactivate appname="${myservlet.app.name}"/>

The task uses the url attribute to find an installed SAR deployable unit, and sets the Ant properties based on the servlet application found. If the DU cannot be found, or does not contain a servlet application, then the task will not set any properties, but allows the build to continue.

MBeans

All SIP Servlet management operations are accessible via JMX MBeans, so custom applications may also be used to manage Rhino SIP Servlet. The MBeans are registered with Rhino’s MBean server.

Tip The Javadoc for the Rhino SIP Servlet MBeans is available at docs/api/sipservlet-management/index.html.

Configuring the SIP Servlet Resource Adaptor

The SIP Servlet Resource Adaptor (RA) gets its configuration from several sources.

Like most SLEE RAs, it uses configuration properties — configured values that the SLEE passes to an RA entity when it is created, and when its configuration is updated (for example, by way of rhino-console’s updateRAEntityConfigProperties command).

Note Configuration Properties describes the available configuration properties.

The SIP Servlet RA also uses several profile tables for storing configuration settings that are not easily represented using standard configuration properties. These profile tables must be created before the SIP Servlet RA entity is created. The bundled deployment script deploy.xml does this automatically.

Note
  • SLEE Profile Tables describes the required tables and their contents, which can be adapted for custom deployments.

  • Users are not expected to manipulate the profile tables directly, after they are created (unless otherwise noted). The SIP Servlet management commands will perform any configuration updates and apply changes to the underlying profile tables.

  • Modifying the profile tables directly is not supported, and the results of doing so are undefined.

Active reconfiguration

All configuration property updates or management operations may be invoked on an active SIP Servlet RA entity. For some properties, however, updates may not apply immediately. If a SIP Servlet RA entity cannot apply a configuration change immediately, it will raise a SLEE alarm saying that the RA entity must be restarted for the changes to take effect. These alarms will appear in Rhino’s logs, and can be viewed in REM or rhino-console (listactivealarms).

If a configuration update fails for any reason, the SIP Servlet RA entity will raise an alarm, and try to continue with its last successful configuration.

Configuration Properties

These configuration properties may be specified when creating or updating an RA entity (createRAEntity and updateRAEntityConfigProperties management commands).

Name Type Default Value Reconfigurable while active? Description
config-profile

String

None, a value must be supplied on RA entity creation.

The ProfileID of the Configuration Profile that will be used to configure this RA entity. The string must be in the form "table-name/profile-name".

WorkerPoolSize

Integer

4

Number of worker threads the SIP Servlet RA will use to process incoming messages. If zero, the RA will process messages in the receiving I/O thread. Otherwise, messages will be handed off to the pool so they can be processed concurrently.

WorkerQueueSize

Integer

500

Queue size for the worker thread pool. If the queue fills, then the RA will drop packets (UDP) or temporarily suspend socket reads (TCP).

TCPIOThreads

Integer

1

Number of threads for handling TCP I/O. TCP connections will be divided between the I/O threads.

AllowLoopbackSend

Boolean

false

Controls whether the RA may send SIP requests to its own addresses. Disabled by default to prevent accidental loops.

Automatic100TryingSupport

Boolean

true

If enabled, the RA will automatically generate 100 Trying responses for INVITEs.

OffsetPorts

Boolean

false

Required if running multiple cluster nodes on the same host. If true, the RA will automatically add an offset to each SIP network interface port, so that each RA instance gets a different port number. See PortOffset below.

PortOffset

Integer

0

Required when running multiple cluster nodes on the same host. If OffsetPorts is enabled, a network interface’s port will be calculated as Port + (NodeID - PortOffset). Typically the PortOffset value used is the lowest NodeID in the cluster. So if the network interface Port is 5060, and the lowest NodeID is 101, and the cluster has nodes 101, 102 and 103, the actual ports used will be 5060, 5061 and 5062 respectively.

fiber-pool.core-pool-size

Integer

2

The RA’s fiber pool is a thread pool used for ordering execution of tasks within the SIP Servlet implementation. The core pool size is the minimum size of this thread pool.

fiber-pool.max-pool-size

Integer

8

The maximum number of threads that may be used by the fiber pool.

fiber-pool.queue-size

Integer

500

The maximum size of the fiber pool’s input queue.

RFC3263:failover_enabled

Boolean

false

Specifies whether to use RFC 3263 Failover & Load Balancing. By default this is disabled, to match existing behaviour. If enabled, the RA uses RFC 3263 DNS procedures to find possible servers and automatically fails over to backup servers where available. If multiple servers are found in DNS, they are sorted and tried according to their SRV priority and weight as per RFC 2782. If disabled, the DNS procedures are still used to find server addresses, but only the first address is used.

RFC3263:failover_timer

Long

10000

Specifies the duration of the failover timer in milliseconds. If RFC 3263 failover is enabled and this timer expires before any responses were received, the RA treats this as a transport error and tries sending the request to the next available server. This timer should be set to a value smaller than the default Timer B and Timer F timers (32s) so that failures can be detected promptly. A value of zero or less disables this timer.

RFC3263:blacklist_timer

Long

300000

The duration in milliseconds for which a server will be blacklisted after a failure is detected. This avoids the RA trying to use the server immediately after a failure when it is most likely just going to fail again. After this time has passed the failed server may be tried again on subsequent client transactions. If a server specifies a Retry-After duration in a 503 response, that value will be used instead.

SSL/TLS Properties

These properties are only used if a network interface is configured to use the TLS transport.

Name Type Default Value Reconfigurable while active? Description
Keystore

String

${rhino.dir.base}/
sipservlet-data/
sipservlet.keystore

The name of a keystore file used to store private key material.

KeystoreType

String

jks

The type of keystore implementation.

KeystorePassword

String

Empty string (no password).

Password to unlock the keystore.

Truststore

String

${rhino.dir.base}/
sipservlet-data/
sipservlet.keystore

The name of a truststore file containing trusted CA certificates. May be same as Keystore.

TruststoreType

String

jks

TruststorePassword

String

Empty string
(no password).

Password to unlock the truststore.

CRLURL

String

None.

The location of a certificate revocation list.

CRLRefreshTimeout

Integer

86400

The certificate revocation list refresh timeout, in seconds.

CRLLoadFailureRetryTimeout

Integer

900

The certificate revocation list load failure timeout, in seconds.

CRLNoCRLLoadFailure
RetryTimeout

Integer

60

The certificate revocation list load failure retry timeout, in seconds.

ClientAuthentication

String

NEED

Indicate whether clients need to be authenticated against certificates in the truststore, must be one of NEED, WANT or NONE:

  • NEED - client authentication is required.

  • WANT - client authentication is requested but not required.

  • NONE - no client authentication is required.

EnabledCipherSuites

String


          

Comma-separated list of cipher suites to enable on all TLS sockets. If empty, the JVM’s default cipher suites will be used. See Java SE 6 cipher suites.

SLEE Profile tables

Rhino SIP Servlet uses several profile tables for storing its configuration. Below are the default tables, which the bundled deployment script deploy.xml automatically creates when deploying the RA:

Profile Spec Name Default Table Name Description

SIP Servlet Config Profile

config

The config-profile configuration property refers to this profile. These attributes in the profile specify the names of the other profile tables used by the RA entity:

  • NetworkInterfaceProfileTableName

  • NetworkRouteProfileTableName

  • ApplicationNameRefProfileTableName

  • DefaultApplicationRouterProfileTableName

SIP Servlet Network Interface Profile

interfaces

Stores SIP network interface definitions.

SIP Servlet Network Route Profile

routes

Stores routing rules that determine the outgoing network interface for requests.

SIP Servlet Application Name Ref Profile

application-names

Stores the mappings of servlet application names to SLEE ServiceIDs.

SIP Servlet Default Application Router Profile

darconfig

Stores Default Application Router configurations.

Note When creating a SIP Servlet RA entity, these profile tables must exist, but they may be empty. The exception is the configuration profile referred to by the config-profile configuration property: this profile must exist before creating the RA entity. It tells the RA where to find the other tables. The bundled deploy.xml script calls the macro create-rhino-sipservlet-instance, which creates the configuration profile config/<ra-entity>-config by default, using the profile table names above.

Typically it will not be necessary to manipulate these tables directly; the defaults should be suitable in most cases. Rhino SIP Servlet’s management operations will update these profile tables as needed.

Tip Multiple SIP Servlet RA entities can share the same profile tables; it’s not necessary to create new profile tables to support additional RA entities. The implementation ensures that RA entities don’t overwrite each other’s settings.

RFC 3263 Failover & Load Balancing

RFC 3263 — Locating SIP Servers specifies how SIP clients use DNS procedures to resolve a SIP URI into the address, port and transport protocol of the next server to contact. In addition, these DNS procedures can result in multiple addresses that clients can try sequentially if earlier addresses failed.

The SIP Servlet RA now supports RFC 3263 to provide failover and load balancing of outgoing requests. Previously the SIP Servlet RA used RFC 3263 only for determining the first address to contact; it did not automatically try backup addresses if the first address failed. Now the SIP Servlet RA has been updated to automatically failover to backup addresses as well, with no intervention required from the application.

Introduction to the RFC 3263 process

When a SIP client sends a request, it must select either the first Route header’s URI, if present, or the Request-URI. This URI determines where the request is sent to (the next-hop address). This URI might only contain a domain name, such as sip:bob@example.com. RFC 3263 DNS procedures are required to convert the URI into the address, port and transport protocol of an actual SIP server (or servers).

At a high level there are three parts to the RFC 3263 DNS process. Some of these may be skipped depending on what information is already given in the URI, such as transport, IP address or port numbers. Here is a simplified description of the process that applies to any SIP client using RFC 3263.

  1. Determine the transport protocol. If not already specified in the URI, the client will do a DNS NAPTR lookup on the domain. This may return some NAPTR records which specify in order of preference the transport protocols that shall be used. The NAPTR records will contain SRV addresses for each supported transport protocol.

  2. Next, determine the port. This can be found by looking up the SRV address in the NAPTR record. Or, if there were no NAPTR records, the SIP client will try the default SRV addresses for its preferred transport protocols, e.g. "_sip._tcp.example.com". The SRV query may return one or more SRV records. Each record contains the hostname and port of a SIP server. Multiple SRV records are sorted according to their priority and weight, and ordered randomly as per RFC 2782. This means that the results will be ordered slightly differently every time, providing a form of load balancing.

  3. Finally the hostnames provided in SRV records must be looked up to obtain their IP addresses. Sometimes this information is already included in the SRV response. If there were no SRV records the SIP client will default to looking up the IP address of the hostname in the URI.

At the end of this process the SIP client has a list of (address, port, transport) tuples to try. If the list is empty then the request cannot be routed and will fail. Otherwise, the client picks the first address in the list and starts a client transaction. The next backup address will be tried if the transaction fails for any of these reasons:

  • the server responds with 503 (Service Unavailable)

  • the transaction times out

  • the transaction fails with a transport error

When such a failure occurs, the client selects the next address and tries again with a new client transaction. If all addresses failed then the client must fail the request.

SIP Servlet RA usage of RFC 3263

The SIP Servlet RA closely follows the RFC 3263 procedures but with some adaptations described below.

Use of client transactions

RFC 3263 states that a new client transaction is used for each backup address. The SIP Servlet RA does this, but the client transactions are hidden from the application. The application just sends a single SipServletRequest on a SipSession, as usual. If a failure occurs and there are backup addresses available, the RA automatically creates a new client transaction and sends the request to the backup address. The RA takes care of routing the successful responses up to the application’s SipSession.

Each new client transaction created for contacting backup servers will have a new Via branch ID (as per the RFC), but these are derived from the original branch ID with a different suffix for each new transaction. For example if the original branch was "z9hG4bK776asdhds", any subsequent transactions will have branches "z9hG4bK776asdhds%1", "z9hG4bK776asdhds%2" so on. In this way the branches for each transaction are still unique in the RA and the network, but can be correlated when looking at logs or packet captures. The application will only see the original branch ID in responses.

The first final response to be received will end the transaction and no more backup addresses will be tried. If all of the available addresses failed, the application will see the last error response received from a server (a 503 or 408 response), or the RA will generate a 503 response and pass it up to the application.

Failover timer

Failover to a backup server is triggered by transaction timeouts, transport errors or 503 responses. If a server has failed completely, the resulting transport error (such as ICMP Port Unreachable) may not be directly visible to the RA, especially when using UDP. Or there may be no ICMP rejects at all in the event of a network partition. This means failover will not occur until the transaction timeout (Timers B or F in RFC 3261) occurs, which will usually be 32 seconds!

For many applications it is desirable to try and detect failures a bit faster than this. The SIP Servlet RA defines an additional failover timer, which can expire before the default transaction timeout to trigger a failover faster. The default value of this timer is 10 seconds.

The failover timer is only started when there are multiple addresses to try. If there is just a single address, the normal transaction timeout behaviour applies. The timer is stopped as soon as any response (including 100 Trying) is received, as this indicates that the next-hop server is functioning. If this timer expires and no responses were received, the RA moves on to the next address.

Server blacklisting and recovery

By itself, DNS does not tell you if a server is available. When using the DNS process above, the same set of servers will always be returned, regardless of whether they are currently available or not. To avoid contacting servers that are likely to be down, the SIP Servlet RA maintains a "blacklist".

Whenever a server failure is detected, either by timeout, transport error or 503 response, the RA adds the failed address to a blacklist so that the address is not tried again for some period of time.

This avoids the RA needlessly contacting servers that are most likely going to be down. By default, servers are blacklisted for 5 minutes. After that time the RA will try using the address again.

Servers that respond with a 503 response and a Retry-After header will be blacklisted for the duration specified in the header.

Configuring the SIP Servlet RA for RFC 3263

See the RFC3263 configuration properties in Configuration Properties.

Network Configuration

When creating a Rhino SIP Servlet RA entity, you must also configure how it will connect to the network.

Rhino SIP Servlet’s network configuration consists of:

  • network interfaces — define the IP addresses, ports and transports that the RA entity will use for sending and receiving SIP traffic

  • network routes — specify which network interface to use for outgoing requests, when certain criteria are met.

Each RA entity must have at least one network interface. Routes are required if there is more than one network interface. Alarms are raised when attempting to activate an RA entity that has no network interfaces, or multiple interfaces and no routes.

Rhino SIP Servlet supports multihomed hosts as specified in JSR289 §14.2. Typically only one network interface is required, but multihoming can be useful in some situations. For example, Rhino SIP Servlet could proxy between clients on a public network, and some application servers on a hidden, private network.

Network Interfaces

Configuring Network Interfaces

You configure network interfaces in Rhino SIP Servlet by setting these properties, when creating or updating an interface.

Name Type Default Value Reconfigurable while active? Description
IPAddress

String

None, a value must be specified.

The IP address (or hostname) of the network interface. Must match a local network interface on the host. The special value auto means "listen on all interfaces". May also use CIDR address/mask notation (for example, "10.0.0.0/24"), which selects the matching local interface in the given range, intended for clusters. IPv4 and IPv6 addresses are supported.

Port

Integer

5060

The port that will be used for unencrypted SIP transports (UDP, TCP).

SecurePort

Integer

5061

The port that will be used for encrypted SIP transports (TLS).

Transports

String

TCP,UDP

Comma-separated list of transports that the network interface supports.

VirtualAddresses

String

None

Comma-separated list of virtual IPs or hostnames that are considered to be local, such as virtual addresses provided by an external load balancer. Incoming requests that are routed to a local address will be processed by the SIP Servlet RA before forwarding.

Addresses may also include a port number, e.g. host:5090. This specifies the load balancer port, if an external load balancer provides the virtual address on a different port to the SIP Servlet RA. If no port is specified, the SIP Servlet RA will match the virtual address on any port.

ViaSentByAddress

String

None

The hostname that will be used as the sent-by address in Via headers of requests sent on this interface.

UseVirtual​AddressInURIs

Boolean

True

If true and VirtualAddresses is set, the first virtual address in the list will be used as the hostname in Record-Route and Contact headers inserted by the RA. Otherwise, the network interface’s IP address will be used.

Warning Changes to the network interface configuration of an active SIP Servlet RA entity will not be applied until the RA entity is restarted.

Viewing Network Interfaces

Use sipservlet-console to view the currently configured set of network interfaces.

To…​ Use this console command:

List all network interfaces

listnetworkinterfaces <ra-entity>

List all enabled network interfaces

listenablednetworkinterfaces <ra-entity>

Display properties of a network interface

dumpnetworkinterface <ra-entity> <interface-name>

List all supported network interface properties

listsupportedproperties <ra-entity>

Creating Network Interfaces

Below are the sipservlet-console and Ant for creating network interfaces.

Warning Network interfaces must be created with a unique name and an IPAddress property. Other optional properties may also be specified. The network interface will not be used until it is enabled on an RA entity.

Console

Syntax

createnetworkinterface <ra-entity> <interface-name> (<property> <value>)*

Example

To create a network interface on a specific port (5099):

createnetworkinterface ss private IPAddress auto Port 5099

Ant

Syntax

<sipservlet:createnetworkinterface name="...">
  <sipservlet:property name="..." value="..."/>
</sipservlet:createnetworkinterface>

Example

To create a network interface on a specific port (5099):

<sipservlet:createnetworkinterface name="private">
  <sipservlet:property name="IPAddress" value="auto"/>
  <sipservlet:property name="Port" value="5099"/>
</sipservlet:createnetworkinterface>

Updating Network Interfaces

Below are the sipservlet-console and Ant commands for updating network interfaces.

Tip The properties of a network interface can be updated by specifying the interface name and the new property values. In sipservlet-console or Ant, setting a property value to the literal string null removes the property from the network interface, so the property reverts to its default value.

Console

Syntax

updatenetworkinterface <ra-entity> <interface-name> (<property> <value>)*

Example

To update a network interface’s address and port:

updatenetworkinterface ss public IPAddress 192.168.99.4 Port 5600

Ant

Syntax

<sipservlet:updatenetworkinterface name="...">
  <sipservlet:property name="..." value="..."/>
</sipservlet:updatenetworkinterface>

Example

To update a network interface’s address and port:

<sipservlet:updatenetworkinterface name="public">
  <sipservlet:property name="IPAddress" value="192.168.99.4"/>
  <sipservlet:property name="Port" value="5600"/>
</sipservlet:updatenetworkinterface>

Enabling Network Interfaces

Below are the sipservlet-console and Ant commands for enabling network interfaces.

Note Enabling a network interface assigns it to a particular RA entity. When the RA entity is activated, it will begin accepting SIP traffic on the interface.

Console

Syntax

enablenetworkinterface <ra-entity> <interface-name>

Example

enablenetworkinterface ss public

Ant

Syntax

<sipservlet:enablenetworkinterface name="..."/>

Example

<sipservlet:enablenetworkinterface name="public"/>

Disabling Network Interfaces

Below are the sipservlet-console and Ant commands for disabling network interfaces.

Warning Disabling a network interface means it will no longer be used by the RA entity.

Console

Syntax

disablenetworkinterface <ra-entity> <interface-name>

Example

disablenetworkinterface ss public

Ant

Syntax

<sipservlet:disablenetworkinterface name="..."/>

Example

<sipservlet:disablenetworkinterface name="public"/>

Removing Network Interfaces

Below are the sipservlet-console and Ant commands for removing network interfaces.

Warning Network interfaces may be removed as long as they are not enabled on an RA entity.

Console

Syntax

removenetworkinterface <ra-entity> <interface-name>

Example

removenetworkinterface ss public

Ant

Syntax

<sipservlet:removenetworkinterface name="..."/>

Example

<sipservlet:removenetworkinterface name="public"/>

Network Routes

Rhino SIP Servlet uses its network routes to determine the appropriate outbound network interface for outgoing requests.

Tip Network routes are only required when the SIP Servlet RA entity has two or more network interfaces enabled.
Warning Changes to the network route configuration of an active SIP Servlet RA entity will not be applied until the RA entity is restarted.

Determining the outbound interface

The SIP Servlet RA uses a routing table, which is an ordered sequence of network routes. Users modify the RA’s routing table by adding, removing, or moving network routes.

When the RA needs to send a SIP request on the network, it looks at the request’s next-hop address. This is the hostname or IP address in the first Route header, if present, or the address of the Request-URI. Note that this occurs before RFC3263 name resolution procedures are applied.

Each configured network route has a rule, and a network interface to use if the rule matches the next-hop address. The RA iterates over the table, and the first route to match the next-hop address is selected. If no rules match, the default route will be used.

Note A servlet can explicitly select an outbound network interface using SipSession.setOutboundInterface() or SipSession.setOutboundInterface(). This setting overrides the RA’s routing table.

Routing rules

Network routes are created by specifying a rule, and a network interface to use if the rule is matched. The available rules are:

  • ip — matches if the next-hop address (or its resolved address) is in the given IP address range. For example, ip 10.0.0.0/8 matches addresses 10.0.0.0-10.0.0.255.

  • subdomain — matches if the hostname is inside a given domain. For example, subdomain opencloud.com matches proxy.opencloud.com.

  • regex — performs a regularexpression match on the next-hop address. For example, regex media.*\.abc\.com matches mediaserver.abc.com.

Default route

The default route is a special rule that is always evaluated last. It specifies a network interface that requests will be sent on if no other routes matched.

Tip When two or more network interfaces are enabled, it is good practice to configure the default route — to prevent requests falling through and being rejected because no other routes matched.

Relationship to host routing table

Rhino SIP Servlet will not modify the host’s routing table. It assumes that the operator will update the host routing table as necessary. For example, if the SIP Servlet RA has a rule that says all requests to 192.168.0.0/24 should use the interface "private", then the operator must ensure that the corresponding physical network interface can actually send to those addresses — that the interface is directly attached to the 192.168.0.0/24 network, or has a route to that network.

 

Displaying the Routing Table

Use sipservlet-console to display the routing table.

Syntax

listnetworkroutes <ra-entity>

Example

> listnetworkroutes ss
0: ip 192.168.0.0/16 -> private
1: domain services.foo.com -> apps

Specifying the Default Route

Below are the sipservlet-console and Ant commands for specifying the default route.

Note The default route will always be checked last, if all other routes did not match.

Console

Syntax

adddefaultnetworkroute <ra-entity> <interface-name>

Example

To set the default route to the network interface "external":

adddefaultnetworkroute ss external

Ant

Syntax

<sipservlet:adddefaultnetworkroute interface="..."/>

Example

To set the default route to the network interface "external":

<sipservlet:adddefaultnetworkroute interface="external"/>

Removing the Default Route

Below are the sipservlet-console and Ant commands for removing the default route.

Console

Syntax

removedefaultnetworkroute <ra-entity>

Example

removedefaultnetworkroute ss

Ant

Syntax

<sipservlet:removedefaultnetworkroute/>

Example

<sipservlet:removedefaultnetworkroute/>

Adding a Route

Below are the sipservlet-console and Ant commands for adding a route.

Note New routes are added after any existing routes, unless a position is specified, starting from zero.

Console

Syntax

addnetworkroute <ra-entity> <rule> <interface-name> [position]

Example

To add a route for requests addressed to domain "xyz.com":

addnetworkroute ss "domain xyz.com" public

Ant

Syntax

<sipservlet:addnetworkroute rule="..." interface="..." position="..."/>

Example

To add a route for requests addressed to domain "xyz.com"

<sipservlet:addnetworkroute rule="domain xyz.com" interface="public"/>

Removing a Route

Below are the sipservlet-console and Ant commands for removing a route.

Console

Syntax

removenetworkroute <ra-entity> <position>

Example

To remove the first route (position 0):

removenetworkroute ss 0

Ant

Syntax

<sipservlet:removenetworkroute position="..."/>

Example

To remove the first route (position 0):

<sipservlet:removenetworkroute position="0"/>

Moving a Route

Below are the sipservlet-console and Ant commands for moving a route.

Note
  • Moving a route to position zero or less moves it to the top of the list (first).

  • Moving a route to a position greater than or equal to the current number of routes moves it to the bottom of the list (last).

  • Default routes are always evaluated last, and cannot be moved.

Console

Syntax

movenetworkroute <ra-entity> <old-position> <new-position>

Example

To move the route at position 4 to position 0 (first):

movenetworkroute ss 4 0

Ant

Syntax

<sipservlet:updatenetworkroute position="..." newposition="..."/>

Example

To move the route at position 4 to position 0 (first):

<sipservlet:updatenetworkroute position="4" newposition="0"/>

Updating a Route

Below are the sipservlet-console and Ant commands for updating a route.

Console

Syntax

updatenetworkroute <ra-entity> <position> [-rule <rule>] [-interface <interface-name>]

Example

To make the route at position 1 use interface "external":

updatenetworkroute ss 1 -interface external

Ant

Syntax

<sipservlet:updatenetworkroute position="..." rule="..." interface="..." newposition="..."/>

Example

To make the route at position 1 use interface "external":

<sipservlet:updatenetworkroute position="1" interface="external"/>

Updating the Default Route

Below are the sipservlet-console and Ant commands for updating the default route.

Console

Syntax

updatedefaultnetworkroute <ra-entity> <interface-name>

Example

To make the interface "public" the default route:

updatedefaultnetworkroute ss public

Ant

Syntax

<sipservlet:updatedefaultnetworkroute interface="..."/>

Example

To make the interface "public" the default route:

<sipservlet:updatedefaultnetworkroute interface="public"/>

Application Deployment

Regular SLEE services must be installed using deployable units, or DUs. These are JAR files containing the service deployment descriptor, Service Building Block (SBB) component JAR files, and supporting libraries.

Each installed DU is identified by a unique URL, which can later be used to uninstall the DU, removing the service and its components from the SLEE.

When a SIP Servlet application’s SAR file is deployed, Rhino SIP Servlet automatically generates a container service for the SIP Servlet application, and packages it inside a DU, along with the original SAR file. The resulting DU is then installed in the SLEE.

The new SIP Servlet application DU is installed with the following default properties:

  • The DU’s URL is the file: URL of the original SAR file.

  • The servlet application name is that defined in the SAR’s sip.xml deployment descriptor, or @SipApplication annotation.

  • The ServiceID of the container service is:
    name=SIP Servlet Application: app-name,vendor=OpenCloud,version=1.0

These properties may all be overridden at deployment time — see Installing a SIP Servlet Application.

Once deployed, the new service can be managed with the normal Rhino SLEE management commands, such as activateservice, deactivateservice, and so on. Rhino SIP Servlet provides some additional commands that let services be addressed by their servlet application names instead of their SLEE ServiceIDs.

Warning This section assumes that the application is packaged as a SAR file.

See the following procedures for deploying and undeploying SIP Servlet applications in Rhino SIP Servlet:

Installing a SIP Servlet Application

Below are the sipservlet-console and Ant commands for installing a SIP Servlet application.

Note Installing a SIP Servlet application automatically generates a container service and deploys it in Rhino.

Console

Syntax

install-ss <ra-entity> <sar-file> [-appname <name>] [-linkname <name>] [-service <service-id>]

Examples

To override the default ServiceID:

install-ss ss myservlet.sar -service name=myservlet,vendor=abc,version=1

By default, Rhino SIP Servlet creates an application name reference mapping the servlet application’s name to its ServiceID. The deployer can specify a different application name to use, for example if the same name was already in use by another application. To override the default application name:

install-ss ss myservlet.sar -appname newname

Ant

Syntax

<sipservlet:install srcfile="..." appname="..." linkname="..." url="...">
  <sipservlet:service name="..." vendor="..." version="..."/>
</sipservlet:install>
Tip The Ant <sipservlet:install> task allows the DU’s URL to be specified using the url attribute.

Examples

To override the default ServiceID:

<sipservlet:install srcfile="myservlet.sar">
  <sipservlet:service name="myservlet" vendor="abc" version="1"/>
</sipservlet:install>

To override the default application name:

<sipservlet:install srcfile="myservlet.sar" appname="newname"/>
RA Entity Bindings and Link Names

When an application is deployed, it is automatically bound to the SIP Servlet RA entity that is performing the deployment. This RA entity provides the SipFactory implementation for the service, so all SIP messages will be sent using this RA entity. The application and RA entity are bound using a link name.

Link names are managed in the SLEE using the console commands bindralinkname and unbindralinkname. See help link in sipservlet-console for related commands. RA entities may have zero or more link names. The default SIP Servlet RA deployment uses the link name "slee/resources/sipservlet".

During deployment, the deploying RA entity selects its own link name to bind with the application. If the RA entity has no link names, deployment will fail. If the RA entity has several link names, one will be selected, or alternatively this can be overridden using the "linkname" parameter in the install-ss command or sipservlet:install Ant task.

Uninstalling a SIP Servlet Application

Below are the sipservlet-console and Ant commands for uninstalling a SIP Servlet application.

Note You uninstall a SIP Servlet application the same way as a regular SLEE service, by uninstalling the service’s deployable unit. This can be done with the standard Rhino uninstall command.

Console

Syntax

uninstall <sar-url>

Example

To uninstall a SAR DU:

uninstall file:/path/to/myservlet.sar

Ant

Syntax

<slee-management>
  <uninstall url="..."/>
</slee-management>

or, to also remove the servlet application’s application name reference:

<sipservlet:uninstall url="..." removeappname="true/false"/>

Example

To uninstall a SAR DU:

<slee-management>
  <uninstall url="file:/path/to/myservlet.sar"/>
</slee-management>

or

<sipservlet:uninstall url="file:/path/to/myservlet.sar" removeappname="true"/>

Activating a SIP Servlet Application

Below are the sipservlet-console and Ant commands for activating a SIP Servlet application

Note After installation, a SIP Servlet application must be activated before it will begin processing SIP messages. You activate an application by activating its SLEE service, with Rhino’s activateservice command.

Console

Syntax

activateservice <service-id>

Example

activateservice name=myservlet,vendor=abc,version=1

Ant

Syntax

<activateservice>
  <component name="..." vendor="..." version="..."/>
</activateservice>

or, using the servlet application name instead of the ServiceID:

<sipservlet:activate appname="..."/>

Example

<slee-management>
  <activateservice>
    <component name="${myservlet.service.name}" vendor="${myservlet.service.vendor}" version="${myservlet.service.version}"/>
  </activateservice>
</slee-management>

or

<sipservlet:activate appname="${myservlet.app.name}"/>

Deactivating a SIP Servlet Application

Below are the sipservlet-console and Ant for deactivating a SIP Servlet application

Note You deactivate a SIP Servlet application by deactivating its SLEE service, with Rhino’s deactivateservice command.

Console

Syntax

 deactivateservice <service-id>

Example

 deactivateservice name=myservlet,vendor=abc,version=1

Ant

Syntax

<deactivateservice>
  <component name="..." vendor="..." version="..."/>
</deactivateservice>

or, using the servlet application name instead of the ServiceID:

 <sipservlet:deactivate appname="..."/>

Example

<slee-management>
  <deactivateservice>
    <component name="${myservlet.service.name}" vendor="${myservlet.service.vendor}" version="${myservlet.service.version}"/>
  </deactivateservice>
</slee-management>

or

<sipservlet:deactivate appname="${myservlet.app.name}"/>

Application Name References

As explained in Application Naming, installing SIP Servlet application SAR files in Rhino SIP Servlet automatically creates application name references. These are mappings between the application’s name and its corresponding SLEE ServiceID.

It should not be necessary to manually update application name references, unless you’re deploying a hybrid application, or there is a naming conflict.

Use the following procedures to manually update application name references:

Viewing Application Name References

Below are the sipservlet-console commands for viewing application name references.

Syntax

To list all application name references:

listapplicationnamerefs <ra-entity>

To dump an application name reference, showing its ServiceID:

dumpapplicationnameref <ra-entity> <name>

Creating an Application Name Reference

Below are the sipservlet-console and Ant commands for creating an application name reference.

Note Creating an application name reference maps a servlet application name to a SLEE ServiceID.

Console

Syntax

createapplicationnameref <ra-entity> <name> <service-id>

Example

createapplicationnameref ss my-app name=My-Service,vendor=abc,version=1

Ant

Syntax

<sipservlet:createapplicationnameref name="...">
  <sipservlet:service name="..." vendor="..." version="..."/>
</sipservlet:createapplicationnameref>

Example

<sipservlet:createapplicationnameref name="my-app">
  <sipservlet:service name="My-Service" vendor="abc" version="1"/>
</sipservlet:createapplicationnameref>

Removing an Application Name Reference

Below are the sipservlet-console and Ant commands for removing an application name reference.

Console

Syntax

removeapplicationnameref <ra-entity> <name>

Example

removeapplicationnameref ss my-app

Ant

Syntax

<sipservlet:removeapplicationnameref name="..."/>

Example

<sipservlet:removeapplicationnameref name="my-app"/>

Replacing an Application Name Reference

Below are the sipservlet-console and Ant commands for replacing an application name reference.

Note An existing application name reference can have its ServiceID replaced with a new ServiceID.

Console

Syntax

replaceapplicationnameref <ra-entity> <name> <service-id>

Example

replaceapplicationnameref ss my-app name=New-Service,vendor=abc,version=2

Ant

Syntax

<sipservlet:replaceapplicationnameref name="...">
  <sipservlet:service name="..." vendor="..." version="..."/>
</sipservlet:replaceapplicationnameref>

Example

<sipservlet:replaceapplicationnameref name="my-app">
  <sipservlet:service name="New-Service" vendor="abc" version="2"/>
</sipservlet:replaceapplicationnameref>

Application Router Configuration

The Application Router selects which SIP Servlet applications process a call.

Warning A valid application router configuration must be installed before the SIP Servlet RA can process SIP messages.

See the following sections about managing application routers:

Default Application Router

All SIP Servlet 1.1 containers support the Default Application Router (DAR). You configure it using a properties file. The DAR may only have a single configuration active at a time.

You configure the Rhino SIP Servlet’s DAR at run time, using the following procedures:

Viewing the DAR Configuration

Below is the sipservlet-console command for viewing the DAR configuration.

Syntax

get-dar-config <ra-entity>

Installing a DAR Configuration

Below are the sipservlet-console and Ant commands for installing a DAR configuration.

Note A DAR configuration can be installed from a text file, or by specifying the DAR configuration inline in the Ant task. Installing a new DAR configuration automatically replaces the RA entities' previous DAR configuration, if any. The change takes effect immediately.

Console

Syntax

install-dar-config <ra-entity> <config file>

Example

install-dar-config ss /path/to/dar.properties

Ant

Syntax

<sipservlet:installdarconfig file="..."/>

or including the DAR configuration inline:

<sipservlet:installdarconfig>
<!-- Insert DAR rules here... --->
</sipservlet:installdarconfig>

Example

<sipservlet:installdarconfig file="/path/to/dar.properties"/>

or inline:

<sipservlet:installdarconfig>
INVITE: ("my-app", "DAR:P-Served-User", "ORIGINATING", "", "NO_ROUTE", "0"), ...
</sipservlet:installdarconfig>

Removing the DAR Configuration

Below are the sipservlet-console and Ant commands for removing the DAR configuration.

Warning Removing the DAR configuration means that no applications will be selected, so Rhino SIP Servlet will reject new SIP requests. Removing the configuration takes effect immediately.

Console

Syntax

uninstall-dar-config <ra-entity>

Example

uninstall-dar-config ss

Ant

Syntax

<sipservlet:uninstalldarconfig/>

Example

<sipservlet:uninstalldarconfig/>

Custom Application Routers

A custom application router can be installed following the procedures in SIP Servlet 1.1 §15.4.2.

  • The application router must be packaged as a Jar file using the Java SE Service Loader conventions.

    This means the application router jar file must contain a
    META-INF/services/javax.servlet.sip.ar.spi.SipApplicationRouterProvider file, which contains the name of SipApplicationRouterProvider concrete class to load.

    Alternatively, the concrete class can be specified by setting the javax.servlet.sip.ar.spi.SipApplicationRouterProvider system property.

  • The application router jar file must be on the class path of the SIP Servlet RA.

    The simplest way is to add it to the Rhino instance’s CLASSPATH.

    Alternatively, it could be added to the SIP Servlet RA’s deployable unit jar file (du/sipservlet-ra-1.x.y.z.du.jar).

Note When a SIP Servlet RA entity is created, it will first try the javax.servlet.sip.ar.spi.SipApplicationRouterProvider system property, then the Service Loader mechanism to locate an application router implementation. If no application router is found, the RA entity will use the Default Application Router.

Appendix A. SIP Servlet Console Reference

This appendix describes all commands available in sipservlet-console.

Deployment commands

install-ss

Description

Installs a SIP Servlet Application sar file. Optionally overrides the default application name or ServiceID.

Syntax

install-ss <ra-entity> <sar-file> [-appname <name>] [-service <service-id>]

createapplicationnameref

Description

Creates an application name reference bound to a SLEE service.

Syntax

createapplicationnameref <ra-entity> <name> <service-id>

dumpapplicationnameref

Description

Displays the value of an application name reference.

Syntax

dumpapplicationnameref <ra-entity> <name>

listapplicationnamerefs

Description

Lists all application name references.

Syntax

listapplicationnamerefs <ra-entity>

removeapplicationnameref

Description

Removes an application name reference.

Syntax

removeapplicationnameref <ra-entity> <name>

replaceapplicationnameref

Description

Replaces an application name reference with a binding to another SLEE service.

Syntax

replaceapplicationnameref <ra-entity> <name> <service-id>

Network interface commands

createnetworkinterface

Description

Adds a new network interface definition to the SIP Servlet RA entity.

May include a list of property names and values for the interface; see Configuring Network Interfaces.

Syntax

createnetworkinterface <ra-entity> <interface-name> (<property-name> <property-value>)*

disablenetworkinterface

Description

Disables a network interface (so the SIP Servlet RA entity stops using it).

Syntax

disablenetworkinterface <ra-entity> <interface-name>

dumpnetworkinterface

Description

Displays the current configuration of a network interface.

Syntax

dumpnetworkinterface <ra-entity> <interface-name>

enablenetworkinterface

Description

Enables a network interface, which assigns it to the RA entity.

When the RA entity is then activated, it will begin accepting SIP traffic on that interface.

Syntax

enablenetworkinterface <ra-entity> <interface-name>

listenablednetworkinterfaces

Description

Lists all enabled network interfaces on a SIP Servlet RA entity.

Syntax

listenablednetworkinterfaces <ra-entity>

listnetworkinterfaces

Description

Lists all network interfaces.

Syntax

listnetworkinterfaces <ra-entity>

listsupportedproperties

Description

Lists all supported network interface properties.

Syntax

listsupportedproperties <ra-entity>

removenetworkinterface

Description

Removes a network interface definition from the SIP Servlet RA entity.

Syntax

removenetworkinterface <ra-entity> <interface-name>

updatenetworkinterface

Description

Updates a new network interface definition with the given properties.

A property value of "null" removes that property from the network interface, reverting it to its default value.

Syntax

updatenetworkinterface <ra-entity> <interface-name> (<property-name> <property-value>)*

Network route commands

adddefaultnetworkroute

Description

Adds a default route rule to a SIP Servlet RA entity.

Syntax

adddefaultnetworkroute <ra-entity> <interface-name>

addnetworkroute

Description

Add a new network route rule to a SIP Servlet RA entity.

Rules are matched against the target address of outgoing requests (the host-part of the top Route header or Request-URI).

These rule types are supported:

  • "all" — always matches

  • "none" — never matches

  • "ip <address>\[/<mask>\] — target address must match the given IP address or range

  • "domain <domain>" — target address is in the given domain

  • "regex <regex>" — target address matches the regular expression.

Syntax

addnetworkroute <ra-entity> <rule> <interface-name> [position]

listnetworkroutes

Description

Displays all network routes on the RA entity.

Syntax

listnetworkroutes <ra-entity>

movenetworkroute

Description

Moves a network route from one position to another.

Syntax

movenetworkroute <ra-entity> <old-position> <new-position>

removedefaultnetworkroute

Description

Removes the default route from a SIP Servlet RA entity.

Syntax

removedefaultnetworkroute <ra-entity>

removenetworkroute

Description

Removes a route from a SIP Servlet RA entity.

Syntax

removenetworkroute <ra-entity> <position>

updatedefaultnetworkroute

Description

Updates the default route used by a SIP Servlet RA entity.

Syntax

updatedefaultnetworkroute <ra-entity> <interface-name>

updatenetworkroute

Description

Updates an existing network route in the SIP Servlet RA entity.

Syntax

updatenetworkroute <ra-entity> <position> [-rule <rule>] [-interface <interface-name>]

Default Application Router (DAR) commands

install-dar-config

Description

Installs a new DAR configuration into the SIP Servlet RA entity.

Syntax

install-dar-config <ra-entity> <config file>

get-dar-config

Description

Displays the current DAR configuration.

Syntax

get-dar-config <ra-entity>

uninstall-dar-config

Description

Uninstalls the current DAR configuration.

Syntax

uninstall-dar-config <ra-entity>

Appendix B. SIP Servlet Ant Task Reference

This appendix describes all commands available in sipservlet-console.

How to add the SIP Servlet Ant tasks to your project

  1. Import Rhino SIP Servlet’s common.xml:

    <import file="/path/to/rhino/sipservlet/common.xml"/>
  2. Declare a namespace for the SIP Servlet tasks:

    <project name="servlet-app" xmlns:sipservlet="antlib:com.opencloud.sipservlet.ant">
  3. Use the Ant tasks in your targets:

    <sipservlet:connect raentity="ss"/>
    <sipservlet:install srcfile="${jars}/servlet-app.sar"/>

Parameters common to all Ant tasks

All Rhino SIP Servlet Ant tasks support these optional attributes:

Attribute Description Required
connectionrefid

The id of a previous connect task that will be used to connect to a SIP Servlet RA entity.

No, defaults to last successful connection.

failonerror

Default failure behaviour for this task. If set to "false" or "no", the build will continue when this task attempts a redundant action, such as installing an application that already exists. Unrecoverable errors will still fail the build.

No, default is "false".

Ant tasks

Below are descriptions and parameters for SIP Servlet Ant tasks.

connect

What it does

Establishes a connection to a SIP Servlet RA entity. Connections are saved in memory for use by subsequent SIP Servlet tasks in the same Ant build (same JVM instance). Therefore this task must be executed before any other SIP Servlet tasks.

Subsequent SIP Servlet tasks in the build use the last successful connection, unless a different connection is requested using the connectionrefid attribute, which must match the id attribute of a previous connect task.

The ${rhino.remote.*} properties are defined in Rhino’s ${client.home}/etc/common.xml, which is automatically included by Rhino SIP Servlet’s common.xml. So it is usually unnecessary to define these explicitly in your build.

Ant parameters

Attribute Description Required
raentity

Name of the SIP Servlet RA entity to connect to.

Yes.

id

A reference that subsequent SIP Servlet tasks can use to refer to this connection.

No.

host

Hostname or IP address of Rhino node.

No, may be omitted if ${rhino.remote.host} property is defined.

port

Port for the Rhino management connection.

No, may be omitted if ${rhino.remote.port} property is defined.

username

User for the Rhino management connection.

No, may be omitted if ${rhino.remote.user} property is defined.

password

Password for the Rhino user.

No, may be omitted if ${rhino.remote.password} property is defined.

install

What it does

Installs SIP Application SAR archives. Packages a SAR archive for deployment on Rhino and deploys it as a service.

Ant parameters

Attribute Description Required
url

URL that will identify the servlet application’s deployable unit in the SLEE.

Not required if srcfile is specified.

srcfile

Path to a SIP Servlet SAR application archive.

Not required if url is specified.

appname

Override the servlet application name specified in the SAR’s sip.xml.

No.

prefix

If set, this prefix will be used to create Ant properties for the installed application name and ServiceID, if installation succeeds. The properties created are:

  • prefix.app.name — the servlet application name

  • prefix.service.name — the service name

  • prefix.service.vendor —  the service vendor

  • prefix.service.version — the service version.

If deployment fails because the application is already deployed, the properties are set to the refer to the currently deployed application; so the build can continue as if installation was successful (unless failonerror is set).

No.

The location of the SAR file to read, and the URL to associate with it when passing it to Rhino is determined as follows:

  • If both srcfile and url parameters are specified, the SAR file is read from the file indicated by srcfile and the URL used is that specified by url.

  • If only srcfile is specified then the JAR file is read from this file and the filename is also used to construct a URL.

  • If only url is specified then the JAR file is read from this location and deployed using the specified URL.

Parameters available as nested elements

Element Description Required

Specifies the ServiceID for the servlet application’s container service.

No, the container will generate a ServiceID based on the application name.

uninstall

What it does

Uninstalls SIP Application SAR archives.

Ant parameters

Attribute Description Required
url

URL of the servlet application’s SAR or deployable unit in the SLEE.

Yes.

removeappname

If true, the task will remove the application name refs for all servlet applications found in the DU.

No, defaults to false.

resolve

What it does

Looks up the application name and ServiceID for a SAR deployed in the SLEE, and sets Ant properties for use later in the build. This is useful when you don’t know the application name or ServiceID in advance, but need to refer to them, for example when uninstalling a servlet application.

Ant parameters

Attribute Description Required
url

URL of servlet application’s deployable unit in the SLEE.

Yes.

prefix

Prefix that will be used to create Ant properties for the deployed application name and ServiceID, if found. The properties created are:

  • prefix.app.name — the deployed servlet application name

  • prefix.service.name — the deployed service’s name

  • prefix.service.vendor — the deployed service’s vendor

  • prefix.service.version — the deployed service’s version.

Yes.

Example

<sipservlet:resolve url="file:${jars}/proxy.sar" prefix="proxy"/>
<!-- now use ${proxy.*} properties in script -->
<sipservlet:deactivate appname="${proxy.app.name}"/>

activate

What it does

Activates a SIP Servlet service using its servlet application name instead of its ServiceID.

Ant parameters

Attribute Description Required
appname

The name of the servlet application to activate.

Yes.

deactivate

What it does

Deactivates a SIP Servlet service using its servlet application name instead of its ServiceID.

Ant parameters

Attribute Description Required
appname

The name of the servlet application to deactivate.

Yes.

wait

If true, the task will block and wait for the service to reach the INACTIVE state.

No, defaults to false.

deploy (macro)

What it does

Macro that installs a SIP Servlet application, sets its tracer level and activates it in one step. Calls the install, install and install tasks.

Ant parameters

Attribute Description Required
srcfile

Path to a SIP Servlet SAR application archive.

Yes.

prefix

If set, this prefix will be used to create Ant properties for the deployed application name and ServiceID, if deployment succeeds. The properties created are:

  • prefix.app.name — the deployed servlet application name

  • prefix.service.name — the deployed service’s name

  • prefix.service.vendor — the deployed service’s vendor

  • prefix.service.version — the deployed service’s version.

No.

tracelevel

SLEE trace level for the servlet application.

No, defaults to Info level.

Parameters available as nested elements

Element Description Required

Specifies the ServiceID for the servlet application’s container service.

No, the container will generate a ServiceID based on the application name.

undeploy (macro)

What it does

Macro that deactivates and uninstalls a SIP Servlet application, and removes its application names, in one step. Calls the deactivate and deactivate tasks.

Ant parameters

Attribute Description Required
url

URL of the servlet application’s SAR or deployable unit in the SLEE.

Yes.

wait

If true, the task will block and wait for the service to reach the INACTIVE state.

No, defaults to true.

removeappnames

Specifies if application name refs will be removed automatically.

No, defaults to true.

settracerlevel (macro)

What it does

Macro for easily setting the trace level for an application. This macro assumes the install or install tasks have run previously, to set the ${prefix.service.\*} properties (or specify these properties explicitly).

Ant parameters

Attribute Description Required
tracer

Tracer name to set the trace level on.

No, defaults to root (the top-level tracer).

tracelevel

SLEE trace level for the servlet application.

No, defaults to Info level.

prefix

Prefix that determines the ${prefix.service.\*} properties to use when setting the trace level.

Yes.

createapplicationnameref

What it does

Create a application name reference for a SIP Servlet RA entity.

Ant parameters

Attribute Description Required
name

The servlet application name to associate with a ServiceID.

Yes.

Parameters specified as nested elements

Element Description Required

Contains the SLEE ServiceID for the service.

Yes.

removeapplicationnameref

What it does

Remove an application name reference from a SIP Servlet RA entity.

Ant parameters

Attribute Description Required
name

The name of the application name reference to remove.

Yes.

createnetworkinterface

What it does

Create a network interface definition for a SIP Servlet RA entity.

Ant parameters

Attribute Description Required
name

The name for the new network interface definition.

Yes.

Parameters specified as nested elements

Element Description Required

Contains a property name and value.

Yes, the IPAddress property must be specified at a minimum. See Configuring Network Interfaces.

removenetworkinterface

What it does

Removes a network interface definition from a SIP Servlet RA entity.

Ant parameters

Attribute Description Required
name

The name of a network interface definition to remove.

Yes.

enablenetworkinterface

What it does

Enables a network interface on a SIP Servlet RA entity.

Ant parameters

Attribute Description Required
name

The name of a network interface definition to enable.

Yes.

disablenetworkinterface

What it does

Disables a network interface on a SIP Servlet RA entity.

Ant parameters

Attribute Description Required
name

The name of a network interface definition to disable.

Yes.

updatenetworkinterface

What it does

Updates a network interface definition for a SIP Servlet RA entity.

Ant parameters

Attribute Description Required
name

The name of a network interface definition.

Yes.

Parameters specified as nested elements

Element Description Required

Contains a property name and value.

No.

adddefaultnetworkroute

What it does

Adds a default network route to a SIP Servlet RA entity. An RA entity may only have a single default route.

Ant parameters

Attribute Description Required
interface

The name of the network interface to be used for the default route.

Yes.

addnetworkroute

What it does

Adds a network route to a SIP Servlet RA entity.

Ant parameters

Attribute Description Required
rule

The rule to match for this route to be selected.

Yes.

interface

The name of the network interface to be used if this route is selected.

Yes.

position

The position in the current route list in which to add this new one.

  • Values less than zero will be treated as zero; so insert at the beginning of the list.

  • Values greater than the current number of routes will be treated as equal to the current number of routes; so insert at the end of the list.

No. Default is to add to the end of the list.

removedefaultnetworkroute

What it does

Removes the default network route from a SIP Servlet RA entity.

Ant parameters

This task does not have any parameters.

removenetworkroute

What it does

Removes a network route from a SIP Servlet RA entity.

Ant parameters

Attribute Description Required
position

The position of the route in the current route list to be removed.

Yes.

updatedefaultnetworkroute

What it does

Updates an existing default network route in a SIP Servlet RA entity.

Ant parameters

Attribute Description Required
interface

The name of the network interface to be used for the default route.

Yes.

updatenetworkroute

What it does

Updates an existing network route in a SIP Servlet RA entity.

Ant parameters

Attribute Description Required
position

The position in the current route list in which to update.

Yes.

rule

The rule to match for this route to be selected.

No.

interface

The name of the network interface to be used if this route is selected.

No.

newPosition

The new position to move the route to.

No.

installdarconfig

What it does

Installs a Default Application Router (DAR) configuration in a SIP Servlet RA entity.

Ant parameters

Attribute Description Required
file

Path to a DAR properties file. The syntax of the file is defined in SIP Servlet 1.1 Appendix C.

No, if a DAR configuration has been provided inline in this element’s text.

Inline DAR configuration

If the installdarconfig element contains text, the text is parsed as a DAR configuration, as defined in SIP Servlet 1.1 Appendix C. Any Ant properties in the text will be substituted. The installdarconfig element must contain either a file attribute or an inline DAR configuration, but not both.

Examples

  • Using a configuration file:

<sipservlet:installdarconfig file="${resources}/prepay.dar.properties"/>
  • Using an inline configuration:

<sipservlet:installdarconfig>
  INVITE:    ("prepay", "DAR:From", "ORIGINATING", "", "NO_ROUTE", "0")
  SUBSCRIBE: ("presence", "DAR:From", "ORIGINATING", "", "NO_ROUTE", "1")
</sipservlet:installdarconfig>}

uninstalldarconfig

What it does

Uninstalls the Default Application Router (DAR) configuration from a SIP Servlet RA entity.

Ant parameters

Attribute Description Required

Service element

What it does

SIP Servlet tasks that require a ServiceID use this element.

Ant parameters

Attribute Description Required
name

Service name.

Yes.

vendor

Service vendor.

Yes.

version

Service version.

Yes.

Property element

What it does

This element specifies a property to pass when updating a network interface definition. See Configuring Network Interfaces.

Ant parameters

Attribute Description Required
name

Property name.

Yes.

value

Property value. A value of "null" will cause the property to be removed from the network interface.

Yes.