Search
The Open Source SLEE and SIP Server

Mobicents Sip Servlets

Mobicents Sip Servlets Concurrency

This page is obsolete : More detailed and better looking installation instructions are available from the Mobicents Sip Servlets User Guide

Description

Although the JSR 289 Expert Group couldn't agree on a concurrency control mechanism for JSR 289, we believe this feature together with congestion control is often required in production environments.

The concurrency control modes supported in Mobicents Sip Servlets are the following:

  • None - In this mode all SIP messages are processed as soon as possible in a thread from the global thread-pool. In this mode two messages belonging to the same SipSession can be processed simultaneously, so you must take measures to ensure that access to a shared resource like the session attributes is synchronized in a thread-safe way.
  • SipSession - This mode guarantees that two messages from the same SipSession will never be processed simultaneously. These messages will be processed sequentially in the order of arrival. Note that if the messages are from different SipSession in the same SipApplicationSession they might be processed simultaneously and you must take care of the synchronization. Pay special attention to B2BUA cases where each leg of the B2BUA is a different SipSession in the same SipApplicationSession.
  • SipApplicationSession - This mode guarantees that two from the same SipApplicationSession will never be processed simultaneously. They will be processed sequentially in the order of arrival. This case is the most thread-safe, but you still need to be careful if you are accessing shared resources in an unmanaged way, for example if you access a SipSession attribute from an unmanaged thread or from EJB this access will not be synchronized.

    The messages that can not be processed immediately will go in a queue to wait for a free thread or to wait for the lock on their sessions to be released. If this queue gets full the container will apply congestion control mechanisms .

Configuration

You can configure concurrency in the following ways:

  • In your application, in a package-info.java class by using the annotation @ConcurrencyControl(mode=ConcurrencyControlMode.SipApplicationSession). See an example of package-info.java from one of our testsuite applications. You must also import the corresponding sip-servlets-annotations-1.3.jar into your application so that it can find the class.
  • From server.xml in the Service tag you can add concurrencyControlMode attributes like this:

    <Service name="jboss.web" className="org.mobicents.servlet.sip.startup.SipStandardService" sipApplicationDispatcherClassName="org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl" sipApplicationRouterClassName="org.mobicents.servlet.sip.router.DefaultApplicationRouter" darConfigurationFileLocation="conf/dars/mobicents-dar.properties" concurrencyControlMode="SipApplicationSession" >

    By default the concurrencyControlMode is None as defined per Sip Servlets 1.1 specification.

  • From the Mobicents Sip Servlets Management Console . In the Server Settings tab.
  • From Embedded Jopr . You must first install Embedded Jopr in order this link to be accessible.
  • From the dispatcher MBean . You can navigate there from the JBoss jmx console. All changes performed at runtime are effective immediately, but are not persisted for the next reboot. If you want your changes to be permanent modify your server.xml file as described above. Remember, the allowed values are None, SipSession and SipApplicationSession.