paStandard-dep This module implements a presence server, i.e. entity that receives SUBSCRIBE requests and sends NOTIFY when presence status of a user changes and allows user to use PUBLISH request for publishing presence status information. This module implements a presence server, i.e. entity that receives SUBSCRIBE requests and sends NOTIFY when presence status of a user changes and allows user to use PUBLISH request for publishing presence status information.
User's presence status is hold internaly (in memory); it can be taken from:
TODO: cache mode needed by large setups, when the presence status will be in memory only cached, not fully stored (limited size of cache, possibility to switch it off). [status: design in progress, coding will start after Ottendorf will be branched] Supported document formats in PUBLISH:
Supported document formats in NOTIFY:
Modules
Libraries
Short notes to be remembered... There are two possibilities how to get authorization rules from XCAP when creating new presentity (controled by module parameter async_auth_queries):
Other SUBSCRIBE requests than the first one which creates the presentity already have authorization document which is stored within presentity's data and don't need to wait for XCAP. But this can consume lots of memory [TODO: this will be solved by intelligent document caching within XCAP module only]. Re-authorization is done by timer - authorization document queries for each presentity are sent time after time and all presentity's watchers are reauthorized. This is due to missing implementation of notification mechanism for XCAP server data changes (might be implemented in the future, but XCAP server able to do it is needed!). One of reasons which lead to timer-based reauthorization was that previous method, when reauthorization was done only when watcher is resubscribing, was not acceptable for users which want to propagate changes in authorization document immediately. When a non-2xx final response to a NOTIFY comes, the subscription is destroyed (really needed under high load). It is possible to say that 408 responses are ignored (see parameter ignore_408_on_notify) but this should be used for testing only. PA modules does state aggregation from multiple sources:
Presence authorization documents are described in [presence auth] and they are not fully supported now. We ignore sphere, transformations and date and time conditions. [Are there any clients supporting this?]. Example 1. presence authorization document This document has two rules: one named “blacklist” disabling subscriptions from user “smith” and one named “whitelist” enabling subscriptions from all other users from domain “test-domain.com”. (It doesn't depend on names of rules but on actions for them.) <?xml version="1.0" encoding="UTF-8" standalone="no" ?> <ruleset xmlns="urn:ietf:params:xml:ns:common-policy" xmlns:pr="urn:ietf:params:xml:ns:pres-rules"> <rule id="blacklist"> <conditions> <identity> <id>sip:smith@test-domain.com</id> </identity> </conditions> <actions> <pr:sub-handling>block</pr:sub-handling> </actions> <transformations/> </rule> <rule id="whitelist"> <conditions> <identity> <domain domain="test-domain.com"/> <except entity="smith"/> </identity> </conditions> <actions> <pr:sub-handling>allow</pr:sub-handling> </actions> <transformations/> </rule> </ruleset> 1.5.2. Presence authorization document URIiAuthorization documents are read for presentities according to their presentity URIs (presentity URI is URI in To header of SUBSCRIBE request). Resulting XCAP URI with authorization document is: <xcap-root>/pres-rules/users/<username>/presence-rules.xml, where <xcap-root> is set in configuration of XCAP module and <username> is UUID (unique user identification used in SERi everywhere) discovered from presentity URI. If you need to use other filename than default “presence-rules.xml”, you can redefine it by parameter pres_rules_file. Problem can be, that pres_rules_file is specified as module parameter and thus common for all users. Message authorization documents are described in MESSAGE authorization rules. We ignore sphere, transformations and date and time conditions like in the case of presence authorization. Example 3. message authorization document This document has one rule named “blacklist” disabling messages sent from users “jan@test-domain.com” and “jana@test-domain.com”. <?xml version="1.0" encoding="UTF-8" standalone="no" ?> <ruleset xmlns="urn:ietf:params:xml:ns:common-policy" xmlns:im="urn:iptel:xml:ns:im-rules"> <rule id="blacklist"> <conditions> <identity> <id>sip:jana@test-domain.com</id> <id>sip:jan@test-domain.com</id> </identity> </conditions> <actions> <im:im-handling>block</im:im-handling> </actions> <transformations/> </rule> </ruleset> Authorization documents are read for recipients according to To URIs. Resulting URI for XCAP query will be: <xcap-root>/im-rules/users/<username>/im-rules.xml where <xcap-root> is set in configuration of XCAP module, im-rules.xml is default filename for message authorization rules (may be redefined in authorize_message call parameter) and <username> is UUID discovered from To URI. One of the worst disadvantages of XCAP authorization is slowness of XCAP queries compared to - for example - data stored in local database. This is the reason for caching XCAP queries and responses, but there is a problem - how to detect changes in data stored on XCAP server. One of possible solutions is to implement client for “XCAP change notifications” described in [xcap_diff] and [xcap_profiles] (planned in future versions). XCAP authorization support is not finished yet, there are some standard incompliances now:
Table 1. Table "presentity"
Table 2. Table "presentity_notes"
Table 3. Table "presentity_extensions"
Table 4. Table "presentity_contact"
Table 5. Table "watcherinfo"
Table 6. Table "tuple_notes"
Table 7. Table "tuple_extensions"
Table 8. Table "offline_winfo"
NoteThere might be new versions of internet drafts and thus links to them my be obsolete. In such case try increment version in link or find the draft on IETF by name. XCAP[xcap] draft-ietf-simple-xcap-07.txt - XCAP specification. [xcap_diff] draft-ietf-simple-xcap-diff-01.txt - XCAP changes notifications format. [xcap_profiles] draft-ietf-sipping-config-framework-07.txt -XCAP user profiles. Presence[events] RFC 3265 - SIP Events. [presence] RFC 3856 - Presence Event package. [publish] RFC 3903 - Event state publication. [winfo_doc] RFC 3858 - Data Format for watcher info. [reg] RFC 3680 - SIP Reg Events. Authorization[common auth] draft-ietf-geopriv-common-policy-05.txt. [presence auth] draft-ietf-simple-presence-rules-03.txt - presence authorization XML based data format and usage with XCAP. Resource lists[rls] draft-ietf-simple-xcap-list-usage-05.txt - XML formats for representing resource lists. [sip rls] draft-ietf-simple-event-list-07.txt - Event Notification Extension for Resource Lists. |
Navigation |