The Open Source SLEE and SIP Server

Mobicents Sip Servlets

Presence Client Example

Service Description

When receiving an INVITE request, the application will call out to the Mobicents SIP Presence Service to check if the from address is a blocked contact. If that's the case it sends out a FORBIDDEN in response and the processing stops.

If that's not the case it proxies the INVITE to the nex application in chain.

All configuration is taken from the sip.xml and used in the application to contact the XDMS for doing the user provisionning on application startup (create user and initial resource list creation) and then retrieving is the user taken from the From Header of the SIP INVITE is present in the blocked contacts of the user.

In a real world application, the users in the XDMS will be provisionned externally and the To Header of the SIP INVITE will be used to get the blocked list instead of using the default user from the sip.xml

This example is used in conjunction with the location service example as well to proxy the response to the correct location if the call is not blocked

How to activate it

From the binary

You can find the war files corresponding to this example here and here .
Drop the downloaded war files into your jboss_home/server/default/deploy directory

Get the corresponding dar configuration file .  To understand what the dar configuration file is used for, check the Application Router Documentation .
Drop it in your jboss_home/server/default/conf/dars directory.
To use this dar file for this service, specify in the Service xml tag, darConfigurationFileLocation attribute of the jboss_home/server/default/deploy/jboss-web.deployer/server.xml , the following :

You can now run your container (Mobicents Sip Servlets on JBoss).

From the source

Please check out the call-blocking example located under this location from the svn repository.

How to play with it

Download the lastest version of the Mobicents SIP Presence XDMS Server Extract it locally to a directory that we will reference as $MOBICENTS_PRESENCE_XDMS

Start it with the following command sh $MOBICENTS_PRESENCE_XDMS/bin/ -Djboss.service.binding.set=ports-01

When the Mobicents XDMS Server is completely started, start Mobicents Sip Servlets with sh $MOBICENTS_SIP_SERVLETS/bin/

Start a SIP Phone of your choice such as the account name should be or The From Header should be one of the following addresses : or

Start another SIP Phone of your choice as the account name is (as in the location service example ) on port 5090

The SIP phone doesn't have to be registered.

Make a call to address, you should receive a Forbidden.

If you change the account name of the first SIP Phone the call will go through

Mobicents Sip Servlets