3.1 Mobicents Presence Server

 

3.1.1    Mobicents SIP Presence Service: Introduction                                                                                                                                     

The Mobicents SIP Presence Service (MSPS) provides presence functionalities to SIP-based networks, and is built upon Mobicents JAIN SLEE. It provides presence functionalities to SIP-based networks using standards developed by the Internet Engineering Task Force (IETF), the Open Mobile Alliance (OMA), the 3rd Generation Partnership Project (3GPP) and the European Telecommunications Standards Institute (ETSI).

The SIP Presence Service is comprised of three separate but interrelated servers:

The Mobicents SIP Presence Server (PS) is an entity that accepts, stores and distributes SIP Presence Information.

The Presence Server performs the following functions:

The XML Document Management Server (XDMS) is responsible for handling the management of user XML documents stored on the network side, such as presence authorization rules, static presence information, contact and group lists (also known as “resource lists”), policy data, and many others.

 

The Resource List Server (RLS) handles subscriptions to presence lists. It creates and manages back-end subscriptions to all resources in the presence list. The list content is retrieved from the XDMS.

3.1.2    Mobicents SIP Presence Service: Installing, Configuring and Running                                                                                                                       

MSPS is a 100% Java application. It will run on the same hardware that the Mobicents JAIN SLEE runs on.

A working installation of the Java Development Kit (JDK) version 5 or higher is required in order to run MSPS.

A working installation of the Apache Ant 1.6 or later is required in order to install the MSPS release without Mobicents JAIN SLEE.

The environment variable JBOSS_HOME, if set, must be pointing to the JBoss AS within Mobicents JAIN SLEE.

It must be set if you are installing the Mobicents Platform or any of the Mobicents servers from source. It is not needed if you have installed the binary version.

You can download the latest version of the MSPS distribution mobicents-sip-presence-integrated-1.0.0-BETA6.zip from the

Mobicents Download page at https://sourceforge.net/projects/mobicents/files/Mobicents%20SIP%20Presence%20Service/

The client library is tested with the latest stable version of Mobicents which is 1.0.0.BETA6.

Installation instructions can be found on Mobicents web site - http://hudson.jboss.org/hudson/job/MobicentsBooks/lastSuccessfulBuild/artifact/sip-presence/index.html

Once installed, you can run server(s) by executing the run.sh (Unix) or run.bat (Microsoft Windows) startup scripts in the <install_directory>/bin directory (on Unix or Windows).

./run.sh -b 128.59.23.54

You can shut down the server by executing the shutdown.sh (UNIX) or shutdown.bat (Microsoft Windows) scripts in the <install_directory>/bin directory. Note that if you properly stop the server, you will see the following three lines as the last output in the terminal or Command Prompt:

[Server] Shutdown complete
Shutdown complete
Halting VM

To uninstall the MSPS, simply delete the directory you decompressed the binary distribution archive into.

3.1.3    Running MSPS on Lagrange                                                                                                                                                                                                   

 

Changing the SIP Port

MSPS uses port 5060 for SIP messages by default. However, SER running on lagrange.cs.columbia.edu also uses port 5060.

Therefore, we need to change the SIP port on Mobicents to 5070.

This can be done by changing the default port configuration in the file deploy-config.xml .

It is packaged in the jar file sip11-ra-DU-2.2.0.FINAL.jar found in the directory <install_directory>/server/default/deploy

 

Line to be edited in the file is

<property name="javax.sip.PORT" type="java.lang.Integer" value="5070" />

 

Changing the HTTP port

MSPS uses port 8080 for HTTP connector. Since another application on lagrange.cs.columbia.edu is already using port 8080,

we have to change the configuration on Mobicents such that it uses port 8090 instead.

This can be done by changing the port value in the file jboss-beans.xml.

It is found in the directory <install_dir>/server/default/deploy/mobicents-sip-presence/3-beans/configuration/xdms/META-INF/

 

Following are the lines that have to be edited

<property name="serverPort">8090</property>

<property name="schemeAndAuthority">http://128.59.23.54:8090</property>

 

3.1.4    XDM Server User Profile Provisioning                                                                                                    

XCAP interface is public and is used by users to manage their information such as buddy list, presence authorization rules, etc. Thus it needs to enforce user authentication. To do the user authentication, the server relies on the User Profile Enabler managed data, such as the user passwords, and this information must be provisioned. This can be done in the following manner which requires the server to be running:

User Provisioning through a JMX Client - Users can be added/removed through the MBean named

org.mobicents.slee:userprofile=UserProfileControl which can be accessed at http://128.59.23.54:8090/jmx-console/

 

3.1.5    Console Logging on Mobicents server                                                                                                                                              

If additional debugs are needed on the console of the Mobicents Presence server, the log4j config file jboss-log4j.xml can be modified to enable that option. The following operation has to be performed on lagrange.cs.columbia.edu

 

cp ~/Mobicents/backup/jboss-log4j-bk.xml ~/Mobicents/Newer/server/default/conf/jboss-log4j.xml

 

To switch back to the normal logging mode,

cp ~/Mobicents/backup/jboss-log4j.xml ~/Mobicents/Newer/server/default/conf/jboss-log4j.xml

 

3.1.6    Authentication of users                                                                                                                                                                                

 

All the SIP  messages are authenticated by the Sip Express Router (SER) Proxy server. All the REGISTER messages are handled by the registrar running on lagrange

and other SIP methods like SUBSCRIBE, PUBLISH and NOTIFY are proxied to the Mobicents server listening on port 5070.

We have to make sure that SER has configurations for forwarding the SIP messages after authentication to the Mobicents server.

The list of the authorized users of Mobicents should also be updated in the database of SER for authentication.

 

Digest authentication for XCAP requests

Mobicents uses HTTP digest authentication for authenticating XCAP requests coming from the outside. Local authentication is turned off by default.

Other configurable features related to the XCAP interface can be found and edited at

$JBOSS_HOME/server/<server-profile>/deploy/mobicents-xdms/3-beans/configuration/xdms/META-INF/jboss-beans.xml

Users have to be added for authentication as descibed in section 6.1.4

 

The configuration on the SIP clients should be as follows

Registrar - lagrange.cs.columbia.edu - port 5060

Proxy     - lagrange.cs.columbia.edu - port 5060

 

3.1.7    Authorization using presence rules document                                                                                                                                               

n

By uploading the presence rules document to the XDM server, users can authorize which other users are allowed to subscribe to them.

Application unique ID to be used for this document is "org.openmobilealliance.pres-rules"

MIME type to be used for this document is "application/auth-policy+xml"

 

<?xml version="1.0" encoding="UTF-8"?>
<cr:ruleset xmlns="urn:ietf:params:xml:ns:pres-rules" xmlns:cr="urn:ietf:params:xml:ns:common-policy">
    <cr:rule id="a">
        <cr:conditions>
            <cr:identity><cr:many domain="<domain>"/></cr:identity>
        </cr:conditions>
        <cr:actions><sub-handling>allow</sub-handling></cr:actions>
        <cr:transformations>
            <provide-devices><all-devices/></provide-devices>
            <provide-services><all-services/></provide-services>
            <provide-persons><all-persons/></provide-persons>
            <provide-all-attributes/>
        </cr:transformations>
    </cr:rule>
</cr:ruleset>
 

3.1.8    Resource List document                                                                                                                                                                   

 

Application unique ID to be used for this document is "resource-lists"

MIME type to be used for this document is "application/resource-lists+xml"

 

Example document with 2 other users in the list "friends-list"

 <?xml version="1.0" encoding="UTF-8"?>
<resource-lists xmlns="urn:ietf:params:xml:ns:resource-lists"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <list name="friends-list">
        <entry uri="sip:user1@lagrange.cs.columbia.edu">
            <display-name>User 1</display-name>
        </entry>
        <entry uri="sip:user2@lagrange.cs.columbia.edu">
            <display-name>User 2</display-name>
        </entry>
    </list>
</resource-lists>

 

3.1.9    RLS Services document                                                                                                                                                                      

 

Application unique ID to be used for this document is "rls-services"

MIME type to be used for this document is "application/rls-services+xml"

 

 <?xml version="1.0" encoding="UTF-8"?>
<rls-services xmlns="urn:ietf:params:xml:ns:rls-services">
    <service uri="sip:mybuddies@lagrange.cs.columbia.edu">
        <resource-list>
            "http://128.59.23.54:8090/resource-lists/users/sip:user1@lagrange.cs.columbia.edu/mybuddies/~~/resource-lists/list[@name="friends-list"]
        </resource-list>
        <packages>
            <package>presence</package>
        </packages>
    </service>
</rls-services>
 

3.1.10    Mobicents XCAP API's

 

The XML Configuration Access Protocol (XCAP), is an application layer protocol that allows a client to read, write and modify application configuration data stored in XML format on a server. XCAP maps XML document sub-trees and element attributes to HTTP URIs, so that these components can be directly accessed by clients using HTTP protocol. The operations supported via XCAP protocol in a client server application are adding, deleting, modifying or retrieving a document, element or attribute. The XCAP addressing mechanism is based on XPath, that provides ability to navigate around XML tree.

 

 

Mobicents XCAP client API's - This client API provides a XCAPClient object to send requests to an XCAP server. It hides all the JAXB xml content marshalling/unmarshalling,  HTTP connection and multi thread complexity. It is built on top of Apache Jakarta commons Http Client.

xcap-client-api-2.0.0.GA.jar has to be downloaded and the list of dependencies for the API is

httpcore-4.0.1.jar, httpclient-4.0.1.jar, httpmime-4.0.1.jar, commons-codec-1.3.jar, apache-mime4j-0.6.jar, commons-logging-1.1.1.jar and commons-1.0.0.BETA4.jar

 

XCAP URI Keys

XCAP resources (document, element, attribute or namespace bindings) are selected by complex HTTP URI's and one of the typical difficulty is creating them. The XDM "commons" API hides that complexity by providing a package (org.openxdm.xcap.common.key) of XCAP URI Key objects that was easy to build and use.

More information about the usage and examples can be found at http://groups.google.com/group/mobicents-public/web/xcap-client-api