The sample SIP Registrar, Proxy, and Presence services require a location service, as defined by RFC3261 section 10. The location service stores SIP registrations, mapping a user’s public SIP address to actual contact addresses.

Tip If you don’t care how this is done, you can skip this step and use the default location service.

Below are instructions for selecting a location service, specifying an external database for the JDBC location service, and deploying the selected location service,

Selecting Activity Context Naming, JDBC, or Profile location services

Rhino’s SIP examples include three implementations of the location-service interface, which demonstrate different SLEE features:

  • Activity Context Naming (Default) — stores registration information in memory using null activities, looked up using the SLEE Activity Context Naming Facility. This is deployed by default.

  • JDBC — stores registrations in an external database.

  • Profile — stores registrations in a writeable SLEE 1.1 profile table.

Many other implementations are possible, such as LDAP.

The build.properties file specifies the type of location service that build.xml deploys. To select one of the three available implementations, edit build.properties, changing the locationservice property:

# The locationservice property should be set to one of "ac", "profile" or "jdbc".
# If undefined or a different value, defaults to "ac".
locationservice=ac

Using an external database for JDBC

If you select the JDBC location service, you’ll need to select a database other than the default, which uses Rhino’s embedded database (Apache Derby in the SDK and PostgreSQLin the production versions of Rhino).

To select an external database, you need to:

1

Create a table with the correct schema for the SIP Registrar

The SQL script fragment below demonstrates how to create the table. This works on PostgreSQL and may need to be adjusted to suit your particular database server.

create table registrations (
    sipaddress varchar(80) not null,
    contactaddress varchar(80) not null,
    expiry bigint,
    qvalue integer,
    cseq integer,
    callid varchar(80),
    flowid varchar(80),
    primary key (sipaddress, contactaddress)
);
COMMENT ON TABLE registrations IS 'SIP Location Service registrations';

2

Configure the JDBC data source in Rhino

Please see External Databases in the Rhino Administration and Deployment Guide for instructions on setting up an external data source.

3

Edit the JDBC location service’s deployment descriptor to refer to the new data source

Edit the extension deployment descriptor src/com/opencloud/slee/services/sip/location/jdbc/META-INF/oc-sbb-jar.xml. The data source is specified in the resource-ref element:

<resource-ref>
    <res-ref-name>jdbc/SipRegistry</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
    <res-jndi-name>jdbc/JDBCResource</res-jndi-name>
</resource-ref>
Note The res-jndi-name element must refer to a data source configured in rhino-config.xml (see External Databases).

Deploy the location service

Warning Normally you do not need to deploy the location service explicitly, since deploying the Registrar, Proxy, or Presence services will automatically deploy the location service as a dependency.

If necessary you can deploy a location service separately using the Ant target deploylocationservice. For example:

$ ant deploylocationservice

This will automatically deploy the location service that you specified in build.properties.

Previous page Next page