DesignBuddyList

Version 78 (Adrian Georgescu, 01/30/2010 11:44 pm)

1 65 Adrian Georgescu
= Presence Blueprint =
2 2 Adrian Georgescu
3 55 Adrian Georgescu
[[TOC(DesignBuddyList, depth=2)]]
4 1 Adrian Georgescu
5 77 Adrian Georgescu
This is a High Level representation of a mechanism that maintains a ''Contacts List'' and handles Subscriptions, Publications and Notifications that can be used by a ''SIP client'' with a graphical user interface. It implements a combination of SIP SIMPLE standards related to event packages like presence, storage and policy.
6 1 Adrian Georgescu
7 59 Adrian Georgescu
== Contacts List ==
8 59 Adrian Georgescu
9 73 Adrian Georgescu
''Contacts List'' contains is a list of contacts displayed by the GUI. It must be managed by the SIP client at a global level above the individual SIP account level.
10 59 Adrian Georgescu
11 78 Adrian Georgescu
The ''Contacts List'' is organized in ''Groups''. The SIP client maintains this central ''Groups List'' by merging all found Groups on all local and remote storages and populates each Group with all recipients found for them.
12 70 Adrian Georgescu
13 1 Adrian Georgescu
Some contacts are marked for Subscribing to them for ''Presence'' information. Based on received Notify messages for ''Event: presence'', each Contact has a ''presentity'' attribute that contains its own published information as pidf xml payload, the GUI display attributes of it. Each contact can also publish properties related to his device capabilities (e.g. can_chat, can_share, can_talk, can_video). This is conveyed via ''caps'' extensions to ''pidf'' and can be used to drive the contextual menus for each Contact related to what kind of action can be initiated to them.
14 1 Adrian Georgescu
15 78 Adrian Georgescu
The following presence related payloads as used to generate the presentity payload used for publish:
16 78 Adrian Georgescu
17 78 Adrian Georgescu
 * Presence Data Model RFC4479
18 78 Adrian Georgescu
 * Rich Presence Extensions RFC4480
19 78 Adrian Georgescu
 * Contact Information for the Presence Information Data Format RFC4482
20 78 Adrian Georgescu
 * User Agent Capability Extension to Presence Information Data Format RFC5196
21 78 Adrian Georgescu
22 78 Adrian Georgescu
> Same Contact may end up belonging to different Groups if the same SIP address is stored on multiple XCAP servers in different groups.
23 78 Adrian Georgescu
 
24 1 Adrian Georgescu
=== Storage ===
25 76 Adrian Georgescu
26 1 Adrian Georgescu
The ''SIP client'' builds the ''Contacts List'' by concatenating the individual lists stored locally or on the ''resource-lists'' documents stored on the XCAP server corespondent to each SIP account. A Contact can be stored on a single XCAP server in order to have atomic changes. When a Contact is added/modified/deleted the corespondent remote XCAP storage is updated. The remote storage is set per Contact in the Add/Edit Contact dialog of the SIP client.
27 50 Adrian Georgescu
28 1 Adrian Georgescu
[[Image(BuddyList-Aggregation.png)]]
29 1 Adrian Georgescu
30 1 Adrian Georgescu
== Account ==
31 47 Adrian Georgescu
32 78 Adrian Georgescu
Each SIP Account 
33 1 Adrian Georgescu
34 78 Adrian Georgescu
 * has settings in the middleware that affect the way it interacts with its correspondent Contacts
35 78 Adrian Georgescu
 * must subscribe to information related to who has subscribed to its own presence information and generate a policy that can be used for subsequent subscriptions and notifications
36 78 Adrian Georgescu
 * stores its data into the XCAP server corespondent with the SIP account or locally if no XCAP server is available
37 78 Adrian Georgescu
38 1 Adrian Georgescu
On boot:
39 1 Adrian Georgescu
40 78 Adrian Georgescu
=== Publish  ===
41 78 Adrian Georgescu
42 78 Adrian Georgescu
The use of XCAP server is mandatory when using Publish in order to manage the pres-rules document used by the Presence Agent
43 78 Adrian Georgescu
44 57 Adrian Georgescu
If ''account.xcap'' is enabled
45 1 Adrian Georgescu
46 1 Adrian Georgescu
 * If ''account.xcap.xcap_root'' is not set, locate XCAP root by doing a DNS TXT lookup for xcap.example.com
47 60 Adrian Georgescu
 * GET XCAP application xcap-caps
48 1 Adrian Georgescu
 * GET XCAP application xcap-directory
49 1 Adrian Georgescu
 * For all supported applications returned by above step, GET their files and cache them locally
50 1 Adrian Georgescu
51 78 Adrian Georgescu
If ''account.xcap.subscribe_xcap_diff'' is enabled
52 1 Adrian Georgescu
53 78 Adrian Georgescu
 * Sent Subscribe for ''Event: xcap-diff''
54 57 Adrian Georgescu
55 78 Adrian Georgescu
If ''Icon'' application is enabled
56 78 Adrian Georgescu
57 78 Adrian Georgescu
 * GET the previous icon using HTTP request
58 78 Adrian Georgescu
59 1 Adrian Georgescu
If ''account.presence.subscribe_winfo'' is enabled
60 1 Adrian Georgescu
61 78 Adrian Georgescu
  * Send Subscribe for ''presence.winfo''
62 78 Adrian Georgescu
  * Initialize ''Watchers List'' for ''Event: presence'' based on received Notify
63 61 Adrian Georgescu
64 78 Adrian Georgescu
If ''account.presence.enable_publish'' is enabled
65 78 Adrian Georgescu
66 78 Adrian Georgescu
  * If ''pidf-manipulation'' application is supported by the XCAP server, update the pidf with its content and update GUI with the fact that we have server based PIDF set  
67 78 Adrian Georgescu
  * Send Publish with the current pidf if pidf_manipulation is not set, let the user change his state manually if pidf_manipulation is set
68 78 Adrian Georgescu
69 54 Adrian Georgescu
If ''account.presence.resource_lists'' is enabled
70 61 Adrian Georgescu
71 1 Adrian Georgescu
 * Initialize the ''Contacts List'' by using the content of the XCAP document ''resource-lists'', filename ''index''. Initialize the ''Subscriptions List'' using the Contacts marked for ''Subscribe to Presence''
72 54 Adrian Georgescu
73 57 Adrian Georgescu
If ''account.presence.rls_services'' is enabled
74 57 Adrian Georgescu
75 78 Adrian Georgescu
 * Put the content of ''Subscription List'' initialized above to the XCAP document ''rls-services'' identified by SIP URI account-buddies@domain.
76 1 Adrian Georgescu
77 78 Adrian Georgescu
=== Subscribe ===
78 78 Adrian Georgescu
79 1 Adrian Georgescu
If ''account.presence.subscribe_presence'' is enabled
80 1 Adrian Georgescu
81 1 Adrian Georgescu
 * If ''account.presence.subscribe_rls_services'' is True send one Subscribe for ''Event: presence'', and header ''Supported: eventlist'' to account-buddies@domain
82 78 Adrian Georgescu
 * Else for each contact in the ''Subscriptions List'' send individual Subscribe for ''Event: presence''
83 62 Adrian Georgescu
84 1 Adrian Georgescu
While running:
85 1 Adrian Georgescu
86 1 Adrian Georgescu
 * Refresh the XCAP server location based on DNS TTL
87 78 Adrian Georgescu
 * Refresh the Publish
88 78 Adrian Georgescu
 * Refresh the Subscribes
89 78 Adrian Georgescu
90 78 Adrian Georgescu
=== Notify ===
91 78 Adrian Georgescu
92 78 Adrian Georgescu
 * On Notify for ''Event: xcap-diff'' that a supported XCAP document has been changed by other SIP UA GET the new document
93 78 Adrian Georgescu
 * On Notify for ''Event: presence'' update the presentity of affected Contacts
94 78 Adrian Georgescu
 * On Notify for 'Event: presence,winfo'' trigger notifications end user to update its policy 
95 74 Adrian Georgescu
96 1 Adrian Georgescu
> Each individual contact list stored in a resource-lists document is indexed by a unique SIP URI, a random SIP URI must be generated for Contacts that do not have a real SIP URI and we must mark the contacts that we want to Subscribe to for presence information. Additional, one can store full names and other attributes related to remote recipient by using extensions to PIDF for contact information (cipid extension). 
97 59 Adrian Georgescu
98 54 Adrian Georgescu
== Policy change ==
99 62 Adrian Georgescu
100 62 Adrian Georgescu
 * Based on Notify for ''Event: presence.winfo'' alert the user about new watchers and update the policy stored in the pres-rules XCAP document
101 35 Adrian Georgescu
 * PUT ''pres-rules'' document on the XCAP server
102 54 Adrian Georgescu
103 32 Adrian Georgescu
Transformations are required to support the following functionality:
104 1 Adrian Georgescu
105 56 Adrian Georgescu
 1.  First degree watchers - access to entire PIDF
106 9 Adrian Georgescu
 1.  Second degree watchers - access to subset of PIDF
107 1 Adrian Georgescu
 1.  Third degree watchers - access to basic presence online/offline
108 59 Adrian Georgescu
109 32 Adrian Georgescu
== Icon change ==
110 68 Adrian Georgescu
111 1 Adrian Georgescu
OMA has specified the use of XCAP server for icon application [http://www.openmobilealliance.org/technical/release_program/docs/PresenceSIMPLE/V2_0-20081223-C/OMA-TS-Presence_SIMPLE_Content_XDM-V1_0-20081223-C.pdf Presence Content XDM Specification]
112 59 Adrian Georgescu
113 9 Adrian Georgescu
Publishing end-point:
114 9 Adrian Georgescu
115 41 Adrian Georgescu
 1. Generate a new random filename: XYZ
116 59 Adrian Georgescu
 1. Build URL http://xcap.example.com/xcap-root/org.openmobilealliance.pres-content/users/sip:alice@example.com/oma_status-icon/XYZ
117 41 Adrian Georgescu
 1. PUT the new icon document to XCAP server
118 59 Adrian Georgescu
 1. Update <icon> element of pidf and PUBLISH new pidf
119 48 Adrian Georgescu
 1. DELETE any previously uploaded icon file
120 56 Adrian Georgescu
121 1 Adrian Georgescu
Subscribing end-point:
122 69 Adrian Georgescu
123 1 Adrian Georgescu
 1. Parse <icon> element of pidf cipid extension received in Notify
124 69 Adrian Georgescu
 2. HTTP GET http://xcap.example.com/xcap-root/org.openmobilealliance.pres-content/users/sip:alice@example.com/oma_status-icon/XYZ
125 1 Adrian Georgescu
 3. Cache picture until next Notify with diferent <icon> element is received