Skip to content

PRESENCE_XML module

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.

The following modules must be loaded before this module:

  • a database module.
  • presence.
  • signaling.
  • xcap.
  • xcap_client. Only compulsory if not using an integrated xcap server (if ‘integrated_xcap_server’ parameter is not set).

The following libraries or applications must be installed before running OpenSIPS with this module loaded:

  • libxml-dev.

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”.

Set force_active parameter
...
modparam("presence_xml", "force_active", 1)
...

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”.

Set pidf_manipulation parameter
...
modparam("presence_xml", "pidf_manipulation", 1)
...

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.

Set xcap_server parameter
...
modparam("presence_xml", "xcap_server", "xcap_server.example.org")
modparam("presence_xml", "xcap_server", "xcap_server.ag.org")
...

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’.

Set pres_rules_auid parameter
...
modparam("presence_xml", "pres_rules_auid", "org.openmobilealliance.pres-rules")
...

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’.

Set pres_rules_filename parameter
...
modparam("presence_xml", "pres_rules_filename", "pres-rules")
...

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).

Set generate_offline_body parameter
...
modparam("presence_xml", "generate_offline_body", 0)
...

None to be used in configuration file.

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, https://opensips.org/docs/db/db-schema-devel.html.

The module exports no function to be used in other OpenSIPS modules.

Top contributors by DevScore(1), authored commits(2) and lines added/removed(3)

#NameDevScoreCommitsLines++Lines—
1.Anca Vamanu1295449301961
2.Saúl Ibarra Corretgé (@saghul)3191516488
3.Bogdan-Andrei Iancu (@bogdan-iancu)2723108158
4.Liviu Chircu (@liviuchircu)1711158184
5.Razvan Crainea (@razvancrainea)16144537
6.Daniel-Constantin Mierla (@miconda)861514
7.Stefan Darius (@dariusstefan)7422740
8.Henning Westerholt (@henningw)644853
9.Dan Pascu (@danpascu)4233
10.Ovidiu Sas (@ovidiusas)3260

All remaining contributors: Kennard White, Vlad Paiu (@vladpaiu), Walter Doekes (@wdoekes), Konstantin Bokarius, Zero King (@l2dy), Peter Lemenkov (@lemenkov), UnixDev, Edson Gellert Schubert, Vlad Patrascu (@rvlad-patrascu), 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

#NameCommit Activity
1.Stefan Darius (@dariusstefan)Jun 2026 - Jul 2026
2.Razvan Crainea (@razvancrainea)Feb 2012 - Jun 2026
3.Liviu Chircu (@liviuchircu)Mar 2014 - May 2024
4.Bogdan-Andrei Iancu (@bogdan-iancu)Jul 2007 - Mar 2020
5.Zero King (@l2dy)Mar 2020 - Mar 2020
6.Dan Pascu (@danpascu)Oct 2007 - Nov 2018
7.Peter Lemenkov (@lemenkov)Jun 2018 - Jun 2018
8.Vlad Patrascu (@rvlad-patrascu)May 2017 - May 2017
9.Saúl Ibarra Corretgé (@saghul)May 2012 - Mar 2013
10.Anca VamanuApr 2007 - Jun 2012

All remaining contributors: Vlad Paiu (@vladpaiu), Ovidiu Sas (@ovidiusas), Kennard White, Walter Doekes (@wdoekes), UnixDev, Denis Bilenko, Henning Westerholt (@henningw), Daniel-Constantin Mierla (@miconda), Konstantin Bokarius, Edson Gellert Schubert.

(1) including any documentation-related commits, excluding merge commits

Last edited by: Razvan Crainea (@razvancrainea), Peter Lemenkov (@lemenkov), Liviu Chircu (@liviuchircu), Bogdan-Andrei Iancu (@bogdan-iancu), Saúl Ibarra Corretgé (@saghul), Anca Vamanu, Henning Westerholt (@henningw), Daniel-Constantin Mierla (@miconda), Konstantin Bokarius, Edson Gellert Schubert, Dan Pascu (@danpascu).

All documentation files (i.e. .md extension) are licensed under the Creative Common License 4.0