3.1. The Location Service
The Mobicents Location Service contains a list of mappings of request URIs to destination addresses. When the Location Service receives a request, it performs a lookup on that mapping and proxies the request simultaneously to the destination address (or addresses) associated with that URI.
Regardless of whether you are using the JBoss Application Server or the Tomcat Servlet Container as the Servlets Server, the application, container and Location Service perform the following steps:
3.1.1. The Location Service: Installing, Configuring and Running
Software Prerequisites
- Either an MSS for JBoss or an MSS for Tomcat Installation
The Location Service requires either an MSS for JBoss or an MSS for Tomcat binary installation.
Both the location-service-1.1.war WAR file and the locationservice-dar.properties DAR file that you downloaded should be placed into different directories in your SIP Servlet Server installation hierarchy. Which directory depends on whether you are using the Location Service with MSS for JBoss or with MSS for Tomcat:
- MSS for JBoss
Place location-service-1.1.war into the JBOSS_HOME/server/default/deploy/ directory, and locationservice-dar.properties into the JBOSS_HOME/server/default/conf/dars/ directory.
- MSS for Tomcat
Place location-service-1.1.war into the CATALINA_HOME/webapps/ directory, and locationservice-dar.properties into the CATALINA_HOME/conf/dars/ directory.
The darConfigurationFileLocation attribute of the Service element must be set to the value conf/dars/locationservice-dar.properties. The instructions are given below by SIP Servlets Server type:
- MSS for JBoss
Open the JBOSS_HOME/server/default/deploy/jboss-web.deployer/server.xml configuration file and find the Service element. Add an attribute to it called darConfigurationFileLocation, and set it to conf/dars/locationservice-dar.properties:
<Service
name="jboss.web"
className="org.mobicents.servlet.sip.startup.SipStandardService"
sipApplicationDispatcherClassName="org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl"
darConfigurationFileLocation="conf/dars/locationservice-dar.properties">
Example 3.1. Editing MSS for JBoss's server.xml for the Location Service
Make sure that the configuration file only contains one darConfigurationFileLocation attribute: your new one.
- MSS for Tomcat
Open the CATALINA_HOME/conf/server.xml configuration file and find the Service element. Add an attribute to it called darConfigurationFileLocation, and set it to conf/dars/locationservice-dar.properties:
<Service
name="Sip-Servlets"
className="org.mobicents.servlet.sip.startup.SipStandardService"
sipApplicationDispatcherClassName="org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl"
darConfigurationFileLocation="conf/dars/locationservice-dar.properties">
Example 3.2. Editing MSS for Tomcat's server.xml for the Location Service
Make sure that the configuration file only contains one darConfigurationFileLocation attribute: your new one.
Once the WAR and DAR files have been placed in the right directories, and the JBoss Application Server or Tomcat Servlet Container knows where to find them (which you specified in a server.xml file), then you should go ahead and run SIP Servlets Server.
The following procedure shows how to test the Location Service.
Procedure 3.1.
Start two SIP softphones. The first phone should be set up as sip:receiver@sip-servlets.com at IP address 127.0.0.1 on port 5090. The second phone can be set up in any way you like. Note that the SIP phones do not have to be registered.
Using the second phone, make a call to sip:receiver@sip-servlets.com. If the Location Service has been set up correctly and is running, the first phone—as the receiver or callee—should now be ringing.
You may also wish to delete the WAR and DAR files for the Location Service, which you installed in
Installing.