DesignBuddyList

Version 114 (Adrian Georgescu, 11/11/2010 01:04 pm)

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