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.

Previous page