PRESENCE_XML module
Admin Guide
Section titled “Admin Guide”Overview
Section titled “Overview”The module does specific handling for notify-subscribe events using xml bodies. It is used with the general event handling module, presence. It constructs and adds 3 events to it: presence, presence.winfo, dialog;sla.
This module takes the xcap permission rule documents from xcap_table.
The presence permission rules are interpreted according to the specifications in RFC 4745 and RFC 5025.
Dependencies
Section titled “Dependencies”OpenSIPS Modules
Section titled “OpenSIPS Modules”The following modules must be loaded before this module:
- a database module.
- presence.
- signaling.
- xcap_client. Only compulsory if not using an integrated xcap server (if ‘integrated_xcap_server’ parameter is not set).
External Libraries or Applications
Section titled “External Libraries or Applications”The following libraries or applications must be installed before running OpenSIPS with this module loaded:
- libxml-dev.
Exported Parameters
Section titled “Exported Parameters”db_url(str)
Section titled “db_url(str)”The database url.
Default value is “mysql://opensips:opensipsrw@localhost/opensips”.
...modparam("presence_xml", "db_url", "dbdriver://username:password@dbhost/dbname")...xcap_table(str)
Section titled “xcap_table(str)”The name of the db table where XCAP documents are stored.
Default value is “xcap”.
...modparam("presence_xml", "xcap_table", "xcaps")...force_active (int)
Section titled “force_active (int)”This parameter is used for permissions when handling Subscribe messages. If set to 1, subscription state is considered active and the presentity is not queried for permissions(should be set to 1 if not using an xcap server). Otherwise,the xcap server is queried and the subscription states is according to user defined permission rules. If no rules are defined for a certain watcher, the subscriptions remains in pending state and the Notify sent will have no body.
Default value is “0”.
...modparam("presence_xml", "force_active", 1)...pidf_manipulation (int)
Section titled “pidf_manipulation (int)”Setting this parameter to 1 enables the features described in RFC 4827. It gives the possibility to have a permanent state notified to the users even in the case in which the phone is not online. The presence document is taken from the xcap server and aggregated together with the other presence information, if any exist, for each Notify that is sent to the watchers. It is also possible to have information notified even if not issuing any Publish (useful for services such as email, SMS, MMS).
Default value is “0”.
...modparam("presence_xml", "pidf_manipulation", 1)...integrated_xcap_server (int)
Section titled “integrated_xcap_server (int)”This parameter is a flag for the type of XCAP server or servers used. If integrated ones, like XCAP-lite from AG Projects, with direct access to database table, the parameter should be set to a positive value. Apart from updating in xcap table, the integrated server must send an MI command refershWatchers [pres_uri] [event] when a user modifies a rules document.
Otherwise, it uses xcap_client module to fetch documents from the XCAP servers with HTTP requests.
Default value is “0”.
...modparam("presence_xml", "integrated_xcap_server", 1)...xcap_server (str)
Section titled “xcap_server (str)”The address of the xcap servers used for storage. This parameter is compulsory if the integrated_xcap_server parameter is not set. It can be set more that once, to construct an address list of trusted XCAP servers.
...modparam("presence_xml", "xcap_server", "xcap_server.example.org")modparam("presence_xml", "xcap_server", "xcap_server.ag.org")...pres_rules_auid (str)
Section titled “pres_rules_auid (str)”This parameter should be configured if you are using the non integrated xcap mode and you need to use another pres-rules auid than the default ‘pres-rules’.
...modparam("presence_xml", "pres_rules_auid", "org.openmobilealliance.pres-rules")...pres_rules_filename (str)
Section titled “pres_rules_filename (str)”This parameter should be configured if you are using the non integrated xcap mode and you need to configure another filename than the default ‘index’.
...modparam("presence_xml", "pres_rules_filename", "pres-rules")...generate_offline_body (str)
Section titled “generate_offline_body (str)”This parameter should be set to 0 if you want to prevent OpenSIPS from automatically generating a PIDF body when a publication expires or is explicitly terminated (a PUBLISH request is received with Expires: 0).
...modparam("presence_xml", "generate_offline_body", 0)...Exported Functions
Section titled “Exported Functions”None to be used in configuration file.
Installation
Section titled “Installation”The module requires 1 table in OpenSIPS database: xcap. The SQL
syntax to create it can be found in presence-create.sql
script in the database directories in the opensips/scripts folder.
You can also find the complete database documentation on the
project webpage, http://www.opensips.org/html/docs/db/db-schema-devel.html.
Developer Guide
Section titled “Developer Guide”The module exports no function to be used in other OpenSIPS modules.
Contributors
Section titled “Contributors”By Commit Statistics
Section titled “By Commit Statistics”Top contributors by DevScore(1), authored commits(2) and lines added/removed(3)
| # | Name | DevScore | Commits | Lines++ | Lines— |
|---|---|---|---|---|---|
| 1. | Anca Vamanu | 129 | 54 | 4930 | 1961 |
| 2. | Bogdan-Andrei Iancu (@bogdan-iancu) | 19 | 16 | 67 | 111 |
| 3. | Saúl Ibarra Corretgé (@saghul) | 10 | 3 | 541 | 106 |
| 4. | Daniel-Constantin Mierla (@miconda) | 8 | 6 | 15 | 14 |
| 5. | Stefan Darius (@dariusstefan) | 8 | 4 | 292 | 49 |
| 6. | Henning Westerholt (@henningw) | 6 | 4 | 48 | 53 |
| 7. | Razvan Crainea (@razvancrainea) | 4 | 2 | 4 | 7 |
| 8. | Ovidiu Sas (@ovidiusas) | 3 | 2 | 6 | 0 |
| 9. | Kennard White | 3 | 1 | 39 | 23 |
| 10. | Vlad Paiu (@vladpaiu) | 3 | 1 | 21 | 2 |
All remaining contributors: Walter Doekes (@wdoekes), Konstantin Bokarius, Dan Pascu (@danpascu), UnixDev, Edson Gellert Schubert, Denis Bilenko.
(1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted / (project_lines_deleted / project_commits)
(2) including any documentation-related commits, excluding merge commits
(3) ignoring whitespace edits, renamed files and auto-generated files
By Commit Activity
Section titled “By Commit Activity”| # | Name | Commit Activity |
|---|---|---|
| 1. | Stefan Darius (@dariusstefan) | Jun 2026 - Jul 2026 |
| 2. | Razvan Crainea (@razvancrainea) | Feb 2012 - Jun 2026 |
| 3. | Saúl Ibarra Corretgé (@saghul) | May 2012 - Oct 2012 |
| 4. | Anca Vamanu | Apr 2007 - Jun 2012 |
| 5. | Bogdan-Andrei Iancu (@bogdan-iancu) | Jul 2007 - Dec 2011 |
| 6. | Vlad Paiu (@vladpaiu) | Oct 2011 - Oct 2011 |
| 7. | Ovidiu Sas (@ovidiusas) | Oct 2010 - Mar 2011 |
| 8. | Kennard White | Jul 2010 - Jul 2010 |
| 9. | Walter Doekes (@wdoekes) | Apr 2010 - Apr 2010 |
| 10. | UnixDev | Feb 2009 - Feb 2009 |
All remaining contributors: Denis Bilenko, Henning Westerholt (@henningw), Daniel-Constantin Mierla (@miconda), Konstantin Bokarius, Edson Gellert Schubert, Dan Pascu (@danpascu).
(1) including any documentation-related commits, excluding merge commits
Documentation
Section titled “Documentation”Contributors
Section titled “Contributors”Last edited by: Razvan Crainea (@razvancrainea), Saúl Ibarra Corretgé (@saghul), Bogdan-Andrei Iancu (@bogdan-iancu), Anca Vamanu, Henning Westerholt (@henningw), Daniel-Constantin Mierla (@miconda), Konstantin Bokarius, Edson Gellert Schubert, Dan Pascu (@danpascu).
License
Section titled “License”All documentation files (i.e. .md extension) are licensed under the Creative Common License 4.0