Product SiteDocumentation Site

3.3. The Call-Blocking Service

The Mobicents Call-Blocking Service, upon receiving an INVITE request, checks to see whether the sender's address is a blocked contact. If so, it returns a FORBIDDEN reply; otherwise, call setup proceeds as normal.

Blocked Contacts Cannot Currently Be Configured

Blocked contacts are currently hard-coded addresses. This model is evolving towards the eventual use of a database.
Here is the current hard-coded list of blocked contacts:

3.3.1. The Call-Blocking Service: Installing, Configuring and Running

 
Pre-Install Requirements and Prerequisites
 
Software Prerequisites
Either an MSS for JBoss or an MSS for Tomcat Installation
The Call-Blocking Service requires either an MSS for JBoss or an MSS for Tomcat binary installation.
You can find detailed instructions on installing MSS for JBoss here: Section 2.1, “SIP Servlet-Enabled JBoss Application Server: Installing, Configuring and Running”.
You can find detailed instructions on installing MSS for Tomcat here: Section 2.2, “SIP Servlet-Enabled Tomcat Servlet Container: Installing, Configuring and Running”.
Downloading
The Call-Blocking Service is comprised of two archive files, a Web Archive (WAR) and a Default Application Router (DAR) configuration file, which you need to add to your installed SIP Servlets Server. For more information about WAR files, refer to the JBoss Application Server Administration and Development Guide. For more information about DAR files, refer to the JSR 289 spec, Appendix C.
Download the Call-Blocking Service's DAR file from here: http://www.mobicents.org/call-blocking-servlet-dar.properties.
Installing
Both the call-blocking-1.1.war WAR file and the call-blocking-servlet-dar.properties DAR file that you downloaded should be placed into different directories in your SIP Servlet Server installation hierachy. Which directory depends on whether you are using the Call-Blocking Service with MSS for JBoss or with MSS for Tomcat:
MSS for JBoss
Place call-blocking-1.1.war into the JBOSS_HOME/server/default/deploy/ directory, and call-blocking-servlet-dar.properties into the JBOSS_HOME/server/default/conf/dars/ directory.
MSS for Tomcat
Place call-blocking-servlet-dar.properties into the CATALINA_HOME/webapps/ directory, and call-blocking-servlet-dar.properties into the CATALINA_HOME/conf/dars/ directory.
Configuring
The darConfigurationFileLocation attribute of the Service element must be set to the value conf/dars/call-blocking-servlet-dar.properties. The instructions for doing so 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/call-blocking-servlet-dar.properties:
<Service
	name="jboss.web"
	className="org.mobicents.servlet.sip.startup.SipStandardService"
	sipApplicationDispatcherClassName="org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl"
	darConfigurationFileLocation="conf/dars/call-blocking-servlet-dar.properties">
Example 3.4. Editing MSS for JBoss's server.xml for the Call-Blocking 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/call-blocking-servlet-dar.properties:
<Service
	name="Sip-Servlets"
	className="org.mobicents.servlet.sip.startup.SipStandardService"
	sipApplicationDispatcherClassName="org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl"
	darConfigurationFileLocation="conf/dars/call-blocking-servlet-dar.properties">
Example 3.5. Editing MSS for Tomcat's server.xml for the Call-Blocking Service

Make sure that the configuration file only contains one darConfigurationFileLocation attribute: your new one.
Running
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.
To learn how to run the SIP Servlets-enabled JBoss Application Server, refer to Section 2.1.7, “Running”.
To learn how to run the SIP Servlets-enabled Tomcat Container, refer to Section 2.2.7, “Running”.
Testing
The following procedure shows how to test the Call-Blocking Service.
Procedure 3.5. 
  1. Start a SIP softphone of your choice. The account name should be blocked-sender. The From Header should list one of the following addresses: sip:blocked-sender@sip-servlets.com or sip:blocked-sender@127.0.0.1. The SIP softphone does not need to be registered.
  2. Make a call to any address, and you should receive a FORBIDDEN response.
Stopping
To learn how to stop the SIP Servlets-enabled JBoss Application Server, refer to bssswjicar-binary-SIP_Servlets_Server_with_JBoss-Stopping.
To learn how to stop the SIP Servlets-enabled Tomcat Container, refer to bssswjicar-binary-SIP_Servlets_Server_with_Tomcat-Stopping.
Uninstalling
Unless disk space is at a premium, there is usually no need to uninstall the Call-Blocking Service. However, if you will not be using it again, you may want to unset or reset the darConfigurationFileLocation attribute of the Service element, which you set in the server.xml configuration file in Configuring.
You may also wish to delete the WAR and DAR files for the Call-Blocking Service, which you installed in Installing.