DesignBuddyList

Version 115 (Tijmen de Mes, 06/17/2012 12:43 pm)

1 114 Adrian Georgescu
h1. Presence Requirements
2 88 Adrian Georgescu
3 1 Adrian Georgescu
4 94 Adrian Georgescu
5 94 Adrian Georgescu
6 114 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:
7 1 Adrian Georgescu
8 114 Adrian Georgescu
# Manages a _Contacts List_
9 114 Adrian Georgescu
# Controls the presence information published by a _SIP account_, handles the Subscriptions and Notifications for the _Contacts_
10 114 Adrian Georgescu
# Manages an _Icon_ (a small size picture of the end user using the client)
11 114 Adrian Georgescu
# Managed the _Policy_ that described who has access to what part of the published PIDF
12 1 Adrian Georgescu
13 114 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.
14 1 Adrian Georgescu
15 1 Adrian Georgescu
16 114 Adrian Georgescu
h2. Contacts List
17 114 Adrian Georgescu
18 114 Adrian Georgescu
19 114 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.
20 114 Adrian Georgescu
21 114 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.
22 114 Adrian Georgescu
23 114 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.
24 114 Adrian Georgescu
25 1 Adrian Georgescu
The following presence related payloads as used to generate the presentity payload used for publish:
26 1 Adrian Georgescu
27 114 Adrian Georgescu
* Presence Data Model RFC4479
28 114 Adrian Georgescu
* Rich Presence Extensions RFC4480
29 114 Adrian Georgescu
* Contact Information for the Presence Information Data Format RFC4482
30 114 Adrian Georgescu
* User Agent Capability Extension to Presence Information Data Format RFC5196
31 1 Adrian Georgescu
32 1 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.
33 1 Adrian Georgescu
 
34 114 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. 
35 1 Adrian Georgescu
36 1 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.
37 1 Adrian Georgescu
38 115 Tijmen de Mes
!BuddyList-Aggregation.png!
39 87 Adrian Georgescu
40 78 Adrian Georgescu
41 114 Adrian Georgescu
h2. Account
42 114 Adrian Georgescu
43 114 Adrian Georgescu
44 1 Adrian Georgescu
Each SIP Account has settings in the middleware that affect the way it interacts with its correspondent Contacts
45 1 Adrian Georgescu
46 114 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
47 1 Adrian Georgescu
* Stores its data into the XCAP server corespondent with the SIP account or locally if no XCAP server is available
48 1 Adrian Georgescu
49 115 Tijmen de Mes
!contact-details.jpg!
50 1 Adrian Georgescu
51 1 Adrian Georgescu
52 114 Adrian Georgescu
h3. Storage
53 1 Adrian Georgescu
54 1 Adrian Georgescu
55 114 Adrian Georgescu
If _account.xcap_ is enabled
56 1 Adrian Georgescu
57 114 Adrian Georgescu
* If _account.xcap.xcap_root_ is not set, locate XCAP root by doing a DNS TXT lookup for xcap.example.com
58 114 Adrian Georgescu
* GET XCAP application xcap-caps
59 114 Adrian Georgescu
* GET XCAP application xcap-directory
60 114 Adrian Georgescu
* For all supported applications returned by above step, GET their files and cache them locally
61 1 Adrian Georgescu
62 114 Adrian Georgescu
If _Icon_ application is enabled
63 1 Adrian Georgescu
64 114 Adrian Georgescu
* GET the previous icon using HTTP request
65 114 Adrian Georgescu
* Refresh the location of the XCAP server based on DNS TTL
66 102 Adrian Georgescu
67 1 Adrian Georgescu
68 114 Adrian Georgescu
h3. Publish 
69 1 Adrian Georgescu
70 1 Adrian Georgescu
71 114 Adrian Georgescu
If _account.presence.enabled_ is True
72 1 Adrian Georgescu
73 114 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
74 1 Adrian Georgescu
75 114 Adrian Georgescu
If _account.xcap_ is enabled and _account.presence.enabled_ is True
76 1 Adrian Georgescu
77 114 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_
78 1 Adrian Georgescu
79 114 Adrian Georgescu
If _account.xcap_ is enabled and  _account.presence.use_rls_services_ is enabled
80 1 Adrian Georgescu
81 114 Adrian Georgescu
* Put the content of _Subscription List_ initialized above to the XCAP document _rls-services_ identified by SIP URI account-buddies@domain.
82 1 Adrian Georgescu
83 1 Adrian Georgescu
84 114 Adrian Georgescu
h3. PIDF manipulation
85 1 Adrian Georgescu
86 1 Adrian Georgescu
87 114 Adrian Georgescu
# Add menu item with _Offline status_ that brings up dialog window with Presence Activity and Note to be displayed while offline.
88 114 Adrian Georgescu
# Add a reminder icon on main interface so that we know we have set this offline status
89 1 Adrian Georgescu
90 1 Adrian Georgescu
91 114 Adrian Georgescu
h3. Subscribe
92 114 Adrian Georgescu
93 114 Adrian Georgescu
94 114 Adrian Georgescu
If _account.xcap_ is enabled and _account.xcap.use_xcap_diff_ is enabled
95 114 Adrian Georgescu
96 114 Adrian Georgescu
* Sent Subscribe for _Event: xcap-diff_ to the account own SIP address
97 114 Adrian Georgescu
98 114 Adrian Georgescu
If _account.presence.enabled_ is True
99 114 Adrian Georgescu
100 114 Adrian Georgescu
* Send Subscribe for _presence.winfo_ to the account own SIP address
101 114 Adrian Georgescu
102 114 Adrian Georgescu
If _account.presence.use_rls_services_ is True
103 114 Adrian Georgescu
104 114 Adrian Georgescu
* Send one Subscribe for _Event: presence_, and header _Supported: eventlist_ to sip:account-buddies@domain
105 114 Adrian Georgescu
106 1 Adrian Georgescu
else
107 1 Adrian Georgescu
108 114 Adrian Georgescu
* For each contact in the _Subscriptions List_ send individual Subscribe for _Event: presence_
109 1 Adrian Georgescu
110 1 Adrian Georgescu
111 114 Adrian Georgescu
h3. Notify
112 1 Adrian Georgescu
113 114 Adrian Georgescu
114 114 Adrian Georgescu
* On Notify for _Event: xcap-diff_ that a supported XCAP document has been changed by other SIP UA GET the new document
115 114 Adrian Georgescu
* On Notify for _Event: presence_ update the presentity of affected Contacts
116 114 Adrian Georgescu
* On Notify for _Event: presence.winfo_ trigger notifications end user to update its policy
117 114 Adrian Georgescu
118 96 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). 
119 96 Adrian Georgescu
120 96 Adrian Georgescu
121 114 Adrian Georgescu
h3. Policy change
122 96 Adrian Georgescu
123 114 Adrian Georgescu
124 114 Adrian Georgescu
* Based on Notify for _Event: presence.winfo_ alert the user about new watchers
125 114 Adrian Georgescu
* If _account.xcap_ is enabled PUT _pres-rules_ document on the XCAP server
126 114 Adrian Georgescu
127 1 Adrian Georgescu
Transformations are required to support the following functionality:
128 91 Adrian Georgescu
129 114 Adrian Georgescu
#  First degree watchers - access to entire PIDF
130 114 Adrian Georgescu
#  Second degree watchers - access to subset of PIDF
131 114 Adrian Georgescu
#  Third degree watchers - access to basic presence online/offline
132 1 Adrian Georgescu
133 84 Adrian Georgescu
134 114 Adrian Georgescu
h3. Notifications
135 114 Adrian Georgescu
136 114 Adrian Georgescu
137 84 Adrian Georgescu
The SIP client must be notified by the middleware when a network event related to Presence occurs:
138 91 Adrian Georgescu
139 114 Adrian Georgescu
# _Watcher list_ has changed
140 114 Adrian Georgescu
# Account has activated/deactivated to update the _Contacts List_
141 114 Adrian Georgescu
# Presence information of a Contact has changed
142 114 Adrian Georgescu
# A conflict exists between the server version and the local version of an XCAP document
143 99 Adrian Georgescu
 
144 114 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.
145 101 Adrian Georgescu
146 101 Adrian Georgescu
147 114 Adrian Georgescu
h3. Actions
148 1 Adrian Georgescu
149 106 Adrian Georgescu
150 114 Adrian Georgescu
# Display and manages the _Contacts List_
151 114 Adrian Georgescu
# Display attributes of the Presence information of each Contact 
152 114 Adrian Georgescu
# Manage the content of the _Policy_ document
153 114 Adrian Georgescu
# Update the _Icon_ of the SIP account
154 114 Adrian Georgescu
155 114 Adrian Georgescu
156 114 Adrian Georgescu
h2. Icon
157 114 Adrian Georgescu
158 114 Adrian Georgescu
159 106 Adrian Georgescu
Publishing end-point:
160 106 Adrian Georgescu
161 114 Adrian Georgescu
# Generate a new random filename: XYZ
162 114 Adrian Georgescu
# Build URL http://xcap.example.com/xcap-root/org.openmobilealliance.pres-content/users/sip:alice@example.com/oma_status-icon/XYZ
163 114 Adrian Georgescu
# PUT the new icon document to XCAP server
164 114 Adrian Georgescu
# Update <icon> element of pidf and PUBLISH new pidf
165 114 Adrian Georgescu
# DELETE any previously uploaded icon file
166 106 Adrian Georgescu
167 106 Adrian Georgescu
Subscribing end-point:
168 106 Adrian Georgescu
169 114 Adrian Georgescu
# Parse <icon> element of pidf cipid extension received in Notify
170 114 Adrian Georgescu
# HTTP GET http://xcap.example.com/xcap-root/org.openmobilealliance.pres-content/users/sip:alice@example.com/oma_status-icon/XYZ
171 114 Adrian Georgescu
# Cache picture until next Notify with diferent <icon> element is received
172 106 Adrian Georgescu
173 106 Adrian Georgescu
The icon is common across all accounts, it must be put on all XCAP servers for all active accounts.
174 106 Adrian Georgescu
175 106 Adrian Georgescu
176 106 Adrian Georgescu
177 114 Adrian Georgescu
h2. Policy
178 114 Adrian Georgescu
179 114 Adrian Georgescu
180 1 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.  
181 106 Adrian Georgescu
182 106 Adrian Georgescu
183 115 Tijmen de Mes
!PresencePolicy.png!
184 113 Adrian Georgescu
185 1 Adrian Georgescu
186 114 Adrian Georgescu
h1. Presence Design
187 112 Adrian Georgescu
188 112 Adrian Georgescu
189 114 Adrian Georgescu
# Contact management
190 114 Adrian Georgescu
## local vs xcap (resourcelist) storage
191 114 Adrian Georgescu
# Incoming presence
192 114 Adrian Georgescu
## Subscribe to presence
193 114 Adrian Georgescu
## Subscribe to dialog-event
194 114 Adrian Georgescu
## RLS Services document management
195 114 Adrian Georgescu
# Outgoing presence
196 114 Adrian Georgescu
## Publish presence, dialog-event
197 114 Adrian Georgescu
## PIDF-manipulation
198 114 Adrian Georgescu
## Subscribe .winfo
199 114 Adrian Georgescu
## Pres-rules, dialog-rules
200 114 Adrian Georgescu
## Icon
201 1 Adrian Georgescu
202 1 Adrian Georgescu
203 114 Adrian Georgescu
h2. Published items
204 114 Adrian Georgescu
205 114 Adrian Georgescu
206 114 Adrian Georgescu
# presence activity
207 114 Adrian Georgescu
# presence note
208 114 Adrian Georgescu
# icon
209 114 Adrian Georgescu
# location URL
210 114 Adrian Georgescu
# display name
211 114 Adrian Georgescu
# idle status (keyboard idle)
212 114 Adrian Georgescu
# privacy information
213 114 Adrian Georgescu
# time offset from UTC
214 114 Adrian Georgescu
# device capabilities
215 114 Adrian Georgescu
216 114 Adrian Georgescu
217 114 Adrian Georgescu
h2. Design notes
218 114 Adrian Georgescu
219 114 Adrian Georgescu
220 114 Adrian Georgescu
* XCAPManager (DONE)
221 114 Adrian Georgescu
** offers high-level API for accessing different types of resources (resource-lists, rls-services, pres-rules, dialog-rules, pidf)
222 114 Adrian Georgescu
** keeps cached copies of XCAP-stored files in case there is lack of connectivity
223 114 Adrian Georgescu
** keeps journal with high-level described changes made to files (in case of lack of connectivity, these will be retried later)
224 114 Adrian Georgescu
** subscribes to xcap-diff so it can be informed of changes to xcap files
225 114 Adrian Georgescu
* Contacts Manager (DONE except subscriptions which are work in progress)
226 114 Adrian Georgescu
** per-account
227 114 Adrian Georgescu
** communicates with XCAPManager to find out information about the contacts
228 114 Adrian Georgescu
** integrate with contact list: contacts should have attributes with various information that can be retrieved by subscribing to presence and dialog events (tree structure most likely, rather than having all attributes at the same level)
229 114 Adrian Georgescu
** solve conflicts and aggregate information from multiple publishing agents
230 114 Adrian Georgescu
* Presence Manager
231 114 Adrian Georgescu
** offer API for fine-grained control of published info (pres-rules and dialog-rules)
232 114 Adrian Georgescu
** be able to understand any valid policy because it can be changed by another client and notify the application when the policy is changed
233 114 Adrian Georgescu
** subscribe to .winfo of presence and dialog events and manage information about active, pending and blocked subscriptions (integrate with contact list)
234 114 Adrian Georgescu
** notify user of new subscription requests
235 114 Adrian Georgescu
** information published via presence and dialog events
236 114 Adrian Georgescu
** accounts should have attributes which can store information to be published (probably similar to contacts)
237 114 Adrian Georgescu
** accounts should publish this information automatically if configured to
238 114 Adrian Georgescu
** manage persistent presence information via xcap pidf-manipulation
239 114 Adrian Georgescu
** publish icon via xcap
240 114 Adrian Georgescu
** estimated time of development: 1 weeks
241 1 Adrian Georgescu