DesignBuddyList

Version 104 (Adrian Georgescu, 02/28/2010 12:32 pm)

1 97 Adrian Georgescu
= Presence =
2 2 Adrian Georgescu
3 55 Adrian Georgescu
[[TOC(DesignBuddyList, depth=2)]]
4 1 Adrian Georgescu
5 88 Adrian Georgescu
This is a high level design for implementing the SIP SIMPLE standards related to ''presence'' and ''presence.winfo'' event packages into the ''SIP SIMPLE client'' that achieves the following goals:
6 1 Adrian Georgescu
7 94 Adrian Georgescu
 1. Manages a ''Contacts List''
8 94 Adrian Georgescu
 1. Controls the presence information published by a ''SIP account'', handles the Subscriptions and Notifications for the ''Contacts''
9 94 Adrian Georgescu
 1. Manages an ''Icon'' (a small size picture of the end user using the client)
10 100 Adrian Georgescu
 1. Managed the ''Policy'' that described who has access to what part of the published PIDF
11 1 Adrian Georgescu
12 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.
13 86 Adrian Georgescu
14 1 Adrian Georgescu
== Contacts List ==
15 1 Adrian Georgescu
16 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.
17 59 Adrian Georgescu
18 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.
19 70 Adrian Georgescu
20 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.
21 1 Adrian Georgescu
22 78 Adrian Georgescu
The following presence related payloads as used to generate the presentity payload used for publish:
23 78 Adrian Georgescu
24 78 Adrian Georgescu
 * Presence Data Model RFC4479
25 78 Adrian Georgescu
 * Rich Presence Extensions RFC4480
26 78 Adrian Georgescu
 * Contact Information for the Presence Information Data Format RFC4482
27 78 Adrian Georgescu
 * User Agent Capability Extension to Presence Information Data Format RFC5196
28 78 Adrian Georgescu
29 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.
30 1 Adrian Georgescu
 
31 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. 
32 1 Adrian Georgescu
33 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.
34 79 Adrian Georgescu
35 1 Adrian Georgescu
[[Image(BuddyList-Aggregation.png)]]
36 1 Adrian Georgescu
37 78 Adrian Georgescu
== Account ==
38 1 Adrian Georgescu
39 79 Adrian Georgescu
Each SIP Account has settings in the middleware that affect the way it interacts with its correspondent Contacts
40 78 Adrian Georgescu
41 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
42 79 Adrian Georgescu
 * Stores its data into the XCAP server corespondent with the SIP account or locally if no XCAP server is available
43 1 Adrian Georgescu
44 98 Adrian Georgescu
[[Image(contact-details.jpg)]]
45 98 Adrian Georgescu
46 87 Adrian Georgescu
=== Storage ===
47 78 Adrian Georgescu
48 1 Adrian Georgescu
If ''account.xcap'' is enabled
49 1 Adrian Georgescu
50 60 Adrian Georgescu
 * If ''account.xcap.xcap_root'' is not set, locate XCAP root by doing a DNS TXT lookup for xcap.example.com
51 1 Adrian Georgescu
 * GET XCAP application xcap-caps
52 1 Adrian Georgescu
 * GET XCAP application xcap-directory
53 1 Adrian Georgescu
 * For all supported applications returned by above step, GET their files and cache them locally
54 78 Adrian Georgescu
55 57 Adrian Georgescu
If ''Icon'' application is enabled
56 78 Adrian Georgescu
57 78 Adrian Georgescu
 * GET the previous icon using HTTP request
58 87 Adrian Georgescu
 * Refresh the location of the XCAP server based on DNS TTL
59 78 Adrian Georgescu
60 87 Adrian Georgescu
=== Publish  ===
61 78 Adrian Georgescu
62 61 Adrian Georgescu
If ''account.presence.enable_publish'' is enabled
63 78 Adrian Georgescu
64 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  
65 1 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
66 78 Adrian Georgescu
67 87 Adrian Georgescu
If ''account.xcap'' is enabled and ''account.presence.resource_lists'' is enabled
68 1 Adrian Georgescu
69 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''
70 1 Adrian Georgescu
71 87 Adrian Georgescu
If ''account.xcap'' is enabled and  ''account.presence.rls_services'' is enabled
72 1 Adrian Georgescu
73 1 Adrian Georgescu
 * Put the content of ''Subscription List'' initialized above to the XCAP document ''rls-services'' identified by SIP URI account-buddies@domain.
74 54 Adrian Georgescu
75 102 Adrian Georgescu
=== PIDF manipulation ===
76 1 Adrian Georgescu
77 104 Adrian Georgescu
 1. Add menu item with ''Offline status'' that brings up dialog window with Presence Activity and Note to be displayed while offline.
78 103 Adrian Georgescu
 1. Add a reminder icon on main interface so that we know we have set this offline status
79 1 Adrian Georgescu
80 102 Adrian Georgescu
=== Subscribe ===
81 1 Adrian Georgescu
82 104 Adrian Georgescu
If ''account.xcap'' is enabled and ''account.xcap.use_xcap_diff'' is enabled
83 87 Adrian Georgescu
84 78 Adrian Georgescu
 * Sent Subscribe for ''Event: xcap-diff'' to the account own SIP address
85 90 Adrian Georgescu
86 104 Adrian Georgescu
If ''account.presence.enabled'' is True
87 1 Adrian Georgescu
88 104 Adrian Georgescu
 * Send Subscribe for ''presence.winfo'' to the account own SIP address
89 87 Adrian Georgescu
90 104 Adrian Georgescu
If ''account.presence.use_rls_services'' is True
91 90 Adrian Georgescu
92 104 Adrian Georgescu
 * Send one Subscribe for ''Event: presence'', and header ''Supported: eventlist'' to sip:account-buddies@domain
93 104 Adrian Georgescu
94 104 Adrian Georgescu
else
95 104 Adrian Georgescu
96 104 Adrian Georgescu
 * For each contact in the ''Subscriptions List'' send individual Subscribe for ''Event: presence''
97 87 Adrian Georgescu
98 78 Adrian Georgescu
=== Notify ===
99 78 Adrian Georgescu
100 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
101 78 Adrian Georgescu
 * On Notify for ''Event: presence'' update the presentity of affected Contacts
102 87 Adrian Georgescu
 * On Notify for ''Event: presence.winfo'' trigger notifications end user to update its policy
103 1 Adrian Georgescu
104 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). 
105 54 Adrian Georgescu
106 91 Adrian Georgescu
=== Policy change ===
107 62 Adrian Georgescu
108 87 Adrian Georgescu
 * Based on Notify for ''Event: presence.winfo'' alert the user about new watchers
109 87 Adrian Georgescu
 * If ''account.xcap'' is enabled PUT ''pres-rules'' document on the XCAP server
110 32 Adrian Georgescu
111 1 Adrian Georgescu
Transformations are required to support the following functionality:
112 56 Adrian Georgescu
113 1 Adrian Georgescu
 1.  First degree watchers - access to entire PIDF
114 1 Adrian Georgescu
 1.  Second degree watchers - access to subset of PIDF
115 59 Adrian Georgescu
 1.  Third degree watchers - access to basic presence online/offline
116 32 Adrian Georgescu
117 96 Adrian Georgescu
=== Notifications ===
118 96 Adrian Georgescu
119 96 Adrian Georgescu
The SIP client must be notified by the middleware when a network event related to Presence occurs:
120 96 Adrian Georgescu
121 96 Adrian Georgescu
 1. ''Watcher list'' has changed
122 96 Adrian Georgescu
 1. Account has activated/deactivated to update the ''Contacts List''
123 96 Adrian Georgescu
 1. Presence information of a Contact has changed
124 96 Adrian Georgescu
 1. A conflict exists between the server version and the local version of an XCAP document
125 96 Adrian Georgescu
 
126 96 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.
127 96 Adrian Georgescu
128 96 Adrian Georgescu
=== Actions ===
129 96 Adrian Georgescu
130 96 Adrian Georgescu
 1. Display and manages the ''Contacts List''
131 96 Adrian Georgescu
 1. Display attributes of the Presence information of each Contact 
132 96 Adrian Georgescu
 1. Manage the content of the ''Policy'' document
133 96 Adrian Georgescu
 1. Update the ''Icon'' of the SIP account
134 96 Adrian Georgescu
135 92 Adrian Georgescu
== Icon ==
136 84 Adrian Georgescu
137 92 Adrian Georgescu
Publishing end-point:
138 1 Adrian Georgescu
139 91 Adrian Georgescu
 1. Generate a new random filename: XYZ
140 91 Adrian Georgescu
 1. Build URL http://xcap.example.com/xcap-root/org.openmobilealliance.pres-content/users/sip:alice@example.com/oma_status-icon/XYZ
141 84 Adrian Georgescu
 1. PUT the new icon document to XCAP server
142 84 Adrian Georgescu
 1. Update <icon> element of pidf and PUBLISH new pidf
143 1 Adrian Georgescu
 1. DELETE any previously uploaded icon file
144 84 Adrian Georgescu
145 84 Adrian Georgescu
Subscribing end-point:
146 92 Adrian Georgescu
147 84 Adrian Georgescu
 1. Parse <icon> element of pidf cipid extension received in Notify
148 84 Adrian Georgescu
 2. HTTP GET http://xcap.example.com/xcap-root/org.openmobilealliance.pres-content/users/sip:alice@example.com/oma_status-icon/XYZ
149 91 Adrian Georgescu
 3. Cache picture until next Notify with diferent <icon> element is received
150 84 Adrian Georgescu
151 84 Adrian Georgescu
The icon is common across all accounts, it must be put on all XCAP servers for all active accounts.
152 99 Adrian Georgescu
153 99 Adrian Georgescu
154 99 Adrian Georgescu
== Policy ==
155 99 Adrian Georgescu
156 101 Adrian Georgescu
All PIDF attributes that can be published must register themselves with the Policy manager. This Policy Manager renders these PIDF attributes in a Window where the user can associate the attributes with Contacts that subscribe to his presentity.  
157 101 Adrian Georgescu
158 101 Adrian Georgescu
159 99 Adrian Georgescu
[[Image(PresencePolicy.png)]]