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.
|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.
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
# 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:
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';
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.
Edit the JDBC location service’s deployment descriptor to refer to the new data source
Edit the extension deployment descriptor
<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>
Deploy the location service
|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