DesignBuddyList

Version 86 (Adrian Georgescu, 01/31/2010 12:05 am)

1 82 Adrian Georgescu
= Presence Functionality =
2 2 Adrian Georgescu
3 55 Adrian Georgescu
[[TOC(DesignBuddyList, depth=2)]]
4 1 Adrian Georgescu
5 86 Adrian Georgescu
This is a high level design of a mechanism that manages a ''Contacts List'' and handles Subscriptions, Publications and Notifications that can be used by a ''SIP client'' with a graphical user interface.
6 1 Adrian Georgescu
7 86 Adrian Georgescu
The goal of the design is to help implementing the SIP SIMPLE standards related to ''presence'' and ''presence.winfo'' event packages into the ''SIP client''. 
8 1 Adrian Georgescu
9 86 Adrian Georgescu
The design requires a ''Presence Agent'' and an ''XCAP server'' serving the domain of the SIP account for which this functionality is desired.
10 86 Adrian Georgescu
11 1 Adrian Georgescu
== Contacts List ==
12 1 Adrian Georgescu
13 86 Adrian Georgescu
''Contacts List'' contains is a list of discrete contacts displayed by the GUI. It must be managed by the SIP client at a global level above the individual SIP account level.
14 59 Adrian Georgescu
15 86 Adrian Georgescu
The ''Contacts List'' is organized into ''Groups''. The ''SIP client'' maintains this central ''Groups List'' by merging all found groups on local and remote storage(s) and populates each group with all contacts found for them.
16 70 Adrian Georgescu
17 86 Adrian Georgescu
Some contacts are marked to Subscribe to them for ''Event: presence''. 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 can display attributes of it.
18 1 Adrian Georgescu
19 78 Adrian Georgescu
The following presence related payloads as used to generate the presentity payload used for publish:
20 78 Adrian Georgescu
21 78 Adrian Georgescu
 * Presence Data Model RFC4479
22 78 Adrian Georgescu
 * Rich Presence Extensions RFC4480
23 78 Adrian Georgescu
 * Contact Information for the Presence Information Data Format RFC4482
24 78 Adrian Georgescu
 * User Agent Capability Extension to Presence Information Data Format RFC5196
25 78 Adrian Georgescu
26 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.
27 1 Adrian Georgescu
 
28 1 Adrian Georgescu
=== Storage ===
29 76 Adrian Georgescu
30 79 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. 
31 1 Adrian Georgescu
32 79 Adrian Georgescu
When a Contact is added/modified/deleted the corespondent remote XCAP storage documents are also updated. The remote storage is set per Contact in the Add/Edit Contact dialog of the SIP client. This remote server storage is used for initializing the locally cached Contacts List between restarts and to synchronize changes between multiple SIP UAs configured for the same SIP account.
33 79 Adrian Georgescu
34 1 Adrian Georgescu
[[Image(BuddyList-Aggregation.png)]]
35 1 Adrian Georgescu
36 78 Adrian Georgescu
== Account ==
37 1 Adrian Georgescu
38 79 Adrian Georgescu
Each SIP Account has settings in the middleware that affect the way it interacts with its correspondent Contacts
39 78 Adrian Georgescu
40 79 Adrian Georgescu
 * Subscribes to information related to who has subscribed to its own presence information and generate a policy document that is used for subsequent subscriptions and notifications by the Presence Agent
41 79 Adrian Georgescu
 * Stores its data into the XCAP server corespondent with the SIP account or locally if no XCAP server is available
42 1 Adrian Georgescu
43 1 Adrian Georgescu
On boot:
44 78 Adrian Georgescu
45 78 Adrian Georgescu
=== Publish  ===
46 78 Adrian Georgescu
47 1 Adrian Georgescu
If ''account.xcap'' is enabled
48 1 Adrian Georgescu
49 60 Adrian Georgescu
 * If ''account.xcap.xcap_root'' is not set, locate XCAP root by doing a DNS TXT lookup for xcap.example.com
50 1 Adrian Georgescu
 * GET XCAP application xcap-caps
51 1 Adrian Georgescu
 * GET XCAP application xcap-directory
52 1 Adrian Georgescu
 * For all supported applications returned by above step, GET their files and cache them locally
53 78 Adrian Georgescu
54 1 Adrian Georgescu
If ''account.xcap.subscribe_xcap_diff'' is enabled
55 78 Adrian Georgescu
56 57 Adrian Georgescu
 * Sent Subscribe for ''Event: xcap-diff''
57 78 Adrian Georgescu
58 78 Adrian Georgescu
If ''Icon'' application is enabled
59 78 Adrian Georgescu
60 78 Adrian Georgescu
 * GET the previous icon using HTTP request
61 1 Adrian Georgescu
62 1 Adrian Georgescu
If ''account.presence.subscribe_winfo'' is enabled
63 78 Adrian Georgescu
64 78 Adrian Georgescu
  * Send Subscribe for ''presence.winfo''
65 61 Adrian Georgescu
  * Initialize ''Watchers List'' for ''Event: presence'' based on received Notify
66 78 Adrian Georgescu
67 78 Adrian Georgescu
If ''account.presence.enable_publish'' is enabled
68 78 Adrian Georgescu
69 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  
70 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
71 54 Adrian Georgescu
72 61 Adrian Georgescu
If ''account.presence.resource_lists'' is enabled
73 1 Adrian Georgescu
74 54 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''
75 57 Adrian Georgescu
76 57 Adrian Georgescu
If ''account.presence.rls_services'' is enabled
77 78 Adrian Georgescu
78 1 Adrian Georgescu
 * Put the content of ''Subscription List'' initialized above to the XCAP document ''rls-services'' identified by SIP URI account-buddies@domain.
79 78 Adrian Georgescu
80 78 Adrian Georgescu
=== Subscribe ===
81 1 Adrian Georgescu
82 1 Adrian Georgescu
If ''account.presence.subscribe_presence'' is enabled
83 1 Adrian Georgescu
84 78 Adrian Georgescu
 * If ''account.presence.subscribe_rls_services'' is True send one Subscribe for ''Event: presence'', and header ''Supported: eventlist'' to account-buddies@domain
85 62 Adrian Georgescu
 * Else for each contact in the ''Subscriptions List'' send individual Subscribe for ''Event: presence''
86 1 Adrian Georgescu
87 1 Adrian Georgescu
While running:
88 1 Adrian Georgescu
89 80 Adrian Georgescu
 * Refresh the location of the XCAP server based on DNS TTL
90 78 Adrian Georgescu
 * Refresh the Publish
91 80 Adrian Georgescu
 * Refresh the Subscribe
92 78 Adrian Georgescu
93 78 Adrian Georgescu
=== Notify ===
94 78 Adrian Georgescu
95 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
96 78 Adrian Georgescu
 * On Notify for ''Event: presence'' update the presentity of affected Contacts
97 74 Adrian Georgescu
 * On Notify for 'Event: presence,winfo'' trigger notifications end user to update its policy 
98 1 Adrian Georgescu
99 59 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). 
100 54 Adrian Georgescu
101 62 Adrian Georgescu
== Policy change ==
102 62 Adrian Georgescu
103 35 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
104 54 Adrian Georgescu
 * PUT ''pres-rules'' document on the XCAP server
105 32 Adrian Georgescu
106 1 Adrian Georgescu
Transformations are required to support the following functionality:
107 56 Adrian Georgescu
108 9 Adrian Georgescu
 1.  First degree watchers - access to entire PIDF
109 1 Adrian Georgescu
 1.  Second degree watchers - access to subset of PIDF
110 59 Adrian Georgescu
 1.  Third degree watchers - access to basic presence online/offline
111 32 Adrian Georgescu
112 68 Adrian Georgescu
== Icon change ==
113 1 Adrian Georgescu
114 59 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]
115 9 Adrian Georgescu
116 9 Adrian Georgescu
Publishing end-point:
117 41 Adrian Georgescu
118 59 Adrian Georgescu
 1. Generate a new random filename: XYZ
119 41 Adrian Georgescu
 1. Build URL http://xcap.example.com/xcap-root/org.openmobilealliance.pres-content/users/sip:alice@example.com/oma_status-icon/XYZ
120 59 Adrian Georgescu
 1. PUT the new icon document to XCAP server
121 48 Adrian Georgescu
 1. Update <icon> element of pidf and PUBLISH new pidf
122 56 Adrian Georgescu
 1. DELETE any previously uploaded icon file
123 1 Adrian Georgescu
124 69 Adrian Georgescu
Subscribing end-point:
125 1 Adrian Georgescu
126 69 Adrian Georgescu
 1. Parse <icon> element of pidf cipid extension received in Notify
127 1 Adrian Georgescu
 2. HTTP GET http://xcap.example.com/xcap-root/org.openmobilealliance.pres-content/users/sip:alice@example.com/oma_status-icon/XYZ
128 1 Adrian Georgescu
 3. Cache picture until next Notify with diferent <icon> element is received
129 80 Adrian Georgescu
130 80 Adrian Georgescu
== GUI notifications ==
131 80 Adrian Georgescu
132 84 Adrian Georgescu
The GUI client must be notified by the middleware when a network event related to Presence occurs:
133 80 Adrian Georgescu
134 80 Adrian Georgescu
 1. Watcher list has changed
135 84 Adrian Georgescu
 1. Presence information of a Contact has changed
136 84 Adrian Georgescu
 1. A conflict exists between the server version and the local version of an XCAP document
137 1 Adrian Georgescu
 
138 1 Adrian Georgescu
Each ''Contact'' can publish properties related to his device capabilities (e.g. chat, audio, video). This is conveyed via ''caps'' extension to ''pidf'' and can be used to drive the contextual menu presented for each Contact related to what kind of action can be initiated to it.
139 84 Adrian Georgescu
140 84 Adrian Georgescu
== GUI actions ==
141 84 Adrian Georgescu
142 84 Adrian Georgescu
 1. Display and manages the ''Contacts List''
143 86 Adrian Georgescu
 1. Display the several attributes of the Presence information of each Contact 
144 84 Adrian Georgescu
 1. Manage the content of the ''Policy'' document
145 84 Adrian Georgescu
 1. Update the ''Icon'' of the SIP account