Login | Register


Documentation -> Tutorials -> Presence -> Presence Server

1. Features

  • privacy rules with XCAP storage
    • a faster integrated xcap mode that uses a database as an interface with the XCAP server ( works with OpenXCAP )
  • fast caching with periodic update in database
    • a fallback to database mode can be configured useful when more than one server is used for a domain
  • extensible - new events to be handled by the server can be added easily due to the layered architecture

2. Architecture

Presence Diagram (click to enlarge)

3. Module Description

  • PRESENCE module - a general, event package independent Subscribe, Publish handler Notify generator according to RFCs 3265 and 3903
  • PRESENCE_XML and PRESENCE_MWI modules - clients for PRESENCE module; register specific events to be handled by PRESENCE module:
    • presence_xml: 'presence'( RFC 3856) , 'presence.winfo' (RFC 3857), 'dialog;sla' (draft-anil-sipping- bla-03.txt)
    • presence_mwi: 'message-summary' (RFC 3842)
  • XCAP_CLIENT module - an XCAP client interface with data retrieving functionality only, for OpenSIPS modules.

4. Configuration

The architecture in the diagram corresponds to a full configuration, when no restrictions are imposed, with privacy permission rules handling enabled and the use of a general XCAP server. There is the possibility to simplify the scheme according to the needs and resources. This can be done by configuring the modules so that some connections are removed or others appear.

4.1  Basic Presence Server

The most simple configuration is a presence server without privacy rules, when anybody is allowed to see the presence status of anybody and there is no need for an xcap server. In this case the xcap part disappears from the scheme.. This mode of operation is configured by setting the flag force_active which is a module parameter for presence_xml module.
You can see a configuration file example for this case here.

4.2  Presence Server with integrated XCAP

If you want presence privacy rules enabled and you use a XCAP server, but one that communicates with the OpenSIPS Presence Server through a database table ( like OpenXCAP) than you can configure the presence server to work in an integrated xcap sever mode. For this you have to set the integrated_xcap_server parameter from presence_xml module. In this case the scheme simplifies by removing the xcap_client module and having the presence_xml module communicates only with the database.
You will notice in the configuration file that the mi_xmlrpc module is also loaded. The MI interface needs to be activated, so that OpenXCAP can signal to OpenSIPS when a change occurs in the presence rules documents. In this way the changes be effective immediately.The MI command that is sent in this case is 'refreshWatchers'.
See configuration file example here.

4.3  Presence Server with external XCAP

If you decide to have a presence server with privacy authorization and not use an integrated xcap server, an improvement can be made in this case also. For a non integrated XCAp server, xcap_client module has to be used and the address of the server( or servers) must be set using the presence_xml modules parameter - xcap_server. The xcap_client module has the task to retrieve XCAP documents from XCAP servers and store them in database. Also the module can be asked to synchronize documents saved in database with those on the server. For this a mean of detecting an update is required. The general mean, that apply to every XCAP server is periodical query. There is however the possibility for the server to signal an update to the module. For this the module has to be able to send refreshXcapDoc MI command when an update occurs. If you are using a XCAP server able to send this command then you can configure the server to work in no periodical query mode. For this you have to unset the xcap_client module parameter periodical_query ( set it to 0).

4.4  Presence server with shared DB

Another configuration option refers to the way the presence module stores information. The default method is caching with periodical update in database for fast processing. However, if you have more presence servers serving the same domain and sharing the same database, this mode will not work. In this case you need to ensure that the servers will be able to communicate through the database. This can be achieved by setting the presence module parameter fallback2db.

5. Database

Presence Server requires 4 tables in database:

  1. active_watchers : stores the active Subscribe dialogs
  2. presentity: stores the published information
  3. watchers: stores the subscription status of the watchers
  4. xcap: stores the XCAP documents

The first three tables are only used internally by the server. The xcap table is either used as a communication interface between the XCAP server (if the server is working in 'integrated_xcap' mode) or as a communication means between the xcap_client module which populates the table and presence_xml module which uses that information.

Page last modified on July 02, 2014, at 03:28 PM