XCAP module
Admin Guide
Section titled “Admin Guide”Overview
Section titled “Overview”The module contains several parameters and functions common to all modules using XCAP capabilities.
The module is currently used by the following modules: presence_xml, rls and xcap_client.
Dependencies
Section titled “Dependencies”OpenSIPS Modules
Section titled “OpenSIPS Modules”The following modules must be loaded before this module:
- a database module.
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("xcap", "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("xcap", "xcap_table", "xcap")...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 OpenXCAP 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.
Default value is “0”.
...modparam("xcap", "integrated_xcap_server", 1)...Exported Functions
Section titled “Exported Functions”None to be used in configuration file.
Developer Guide
Section titled “Developer Guide”The module exports a number of parameters and functions that are used in several other modules.
bind_xcap_api(xcap_api_t* api)
Section titled “bind_xcap_api(xcap_api_t* api)”This function allows binding the needed functions.
...typedef struct xcap_api { int integrated_server; str db_url; str xcap_table; normalize_sip_uri_t normalize_sip_uri; parse_xcap_uri_t parse_xcap_uri; get_xcap_doc_t get_xcap_doc;} xcap_api_t;...normalize_xcap_uri
Section titled “normalize_xcap_uri”This function normalizes a SIP URI found in a XCAP document. It un-escapes it and adds the SIP scheme in case it was missing. Returns a statically allocated string buffer containing the normalized form.
Parameters:
- uri- the URI that needs to be normalized
parse_xcap_uri
Section titled “parse_xcap_uri”This function parses the given XCAP URI.
Parameters:
- uri- the URI that needs to be parsed in string format
- xcap_uri-
xcap_uri_t structure that will be filled with the parsed information
Parameter type:...typedef struct {char buf[MAX_URI_SIZE];str uri;str root;str auid;str tree;str xui;str filename;str selector;} xcap_uri_t;...
get_xcap_doc
Section titled “get_xcap_doc”This function queries the local DB for the required XCAP document. It will return the document and its corresponding etag.
Parameters:
- user- user part od the URI of the document owner
- domain- domain part od the URI of the document owner
- type- type of the requested document, represents the AUID, can be one of PRES_RULES, RESOURCE_LISTS, RLS_SERVICES, PIDF_MANIPULATION, OMA_PRES_RULES
- filename- if specified it will be used to match the document filename, it defaults to ‘index’
- match_etag- if specified the document is only returned its etag matches this one
- doc- reference to the storage for the returned document
- etag- reference to the storage for the returned document’s etag
db_url
Section titled “db_url”URL of the database to which the XCAP mdoules witll connect.
xcap_table
Section titled “xcap_table”Name of the table used to store XCAP documents. Defaults to ‘xcap’.
integrated_server
Section titled “integrated_server”Boolean flag indicating if the XCAP server has access to the local database or xcap_client will be used to fetch documents.
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. | Saúl Ibarra Corretgé (@saghul) | 15 | 3 | 1224 | 5 |
| 2. | Liviu Chircu (@liviuchircu) | 10 | 8 | 27 | 58 |
| 3. | Razvan Crainea (@razvancrainea) | 8 | 6 | 16 | 14 |
| 4. | Stefan Darius (@dariusstefan) | 8 | 4 | 257 | 34 |
| 5. | Bogdan-Andrei Iancu (@bogdan-iancu) | 5 | 3 | 3 | 9 |
| 6. | Ovidiu Sas (@ovidiusas) | 3 | 1 | 13 | 3 |
| 7. | Maksym Sobolyev (@sobomax) | 3 | 1 | 3 | 3 |
| 8. | Ken Rice | 3 | 1 | 1 | 1 |
| 9. | Peter Lemenkov (@lemenkov) | 3 | 1 | 1 | 1 |
| 10. | Vlad Patrascu (@rvlad-patrascu) | 2 | 1 | 1 | 0 |
(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) | Aug 2015 - Jun 2026 |
| 3. | Ken Rice | Sep 2025 - Sep 2025 |
| 4. | Liviu Chircu (@liviuchircu) | Jul 2014 - May 2024 |
| 5. | Maksym Sobolyev (@sobomax) | Feb 2023 - Feb 2023 |
| 6. | Bogdan-Andrei Iancu (@bogdan-iancu) | Oct 2014 - Mar 2020 |
| 7. | Peter Lemenkov (@lemenkov) | Jun 2018 - Jun 2018 |
| 8. | Vlad Patrascu (@rvlad-patrascu) | May 2017 - May 2017 |
| 9. | Ovidiu Sas (@ovidiusas) | Jan 2013 - Jan 2013 |
| 10. | Saúl Ibarra Corretgé (@saghul) | Nov 2012 - Jan 2013 |
(1) including any documentation-related commits, excluding merge commits
Documentation
Section titled “Documentation”Contributors
Section titled “Contributors”Last edited by: Razvan Crainea (@razvancrainea), Peter Lemenkov (@lemenkov), Liviu Chircu (@liviuchircu), Saúl Ibarra Corretgé (@saghul).
License
Section titled “License”All documentation files (i.e. .md extension) are licensed under the Creative Common License 4.0