DesignBuddyList

Version 55 (Adrian Georgescu, 01/28/2010 12:44 pm)

1 27 Adrian Georgescu
= Presence blueprint =
2 2 Adrian Georgescu
3 55 Adrian Georgescu
[[TOC(DesignBuddyList, depth=2)]]
4 1 Adrian Georgescu
5 41 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 GUI.  It implements a combination of SIP SIMPLE standards related to presence event package, storage and policy.
6 1 Adrian Georgescu
7 53 Adrian Georgescu
== Storage ==
8 1 Adrian Georgescu
9 54 Adrian Georgescu
The client maintains a '''Contacts list''' that is a concatenated list of resource-lists stored on multiple XCAP servers. A Contact is stored on exactly one XCAP server to provide atomic transaction. When a Contact is added/modified/deleted the corespondent remote XCAP storage is accessed. The remote storage is set per Contact in the Add/Edit Contact dialog.
10 50 Adrian Georgescu
11 1 Adrian Georgescu
[[Image(BuddyList-Aggregation.png)]]
12 1 Adrian Georgescu
13 49 Adrian Georgescu
== Prerequisites ==
14 49 Adrian Georgescu
15 50 Adrian Georgescu
To implement full presence support the following functionality must be available in the servers side.
16 50 Adrian Georgescu
17 53 Adrian Georgescu
 1. ~~Support in OpenXCAP for '''icon''' application, http://openxcap.org/ticket/100~~
18 53 Adrian Georgescu
 1. ~~Support in OpenXCAP for '''xcap-directory''' application, http://openxcap.org/ticket/101~~
19 1 Adrian Georgescu
 1. OpenSIPS '''xcap-diff''' module to perform refresh_watchers()
20 53 Adrian Georgescu
 1. ~~OpenSIPS '''dialog-info''' module to use XCAP document dialog-rules for authorization~~
21 50 Adrian Georgescu
 1. OpenSIPS '''dialog-info''' module to sent notify for dialog-info.winfo Event 
22 50 Adrian Georgescu
 1. OpenXCAP to perform PUBLISH for xcap-diff when any xcap doc changes
23 53 Adrian Georgescu
 1. ~~Implement caps payload type in client (device capabilities)~~ 
24 53 Adrian Georgescu
 1. ~~Implement dialog-info event package in client~~
25 53 Adrian Georgescu
 1. Replace OpenXCAP mi command for xcap-diff with a SIP PUBLISH
26 47 Adrian Georgescu
27 1 Adrian Georgescu
== Account ==
28 1 Adrian Georgescu
29 54 Adrian Georgescu
On boot:
30 1 Adrian Georgescu
31 54 Adrian Georgescu
If account.xcap is enabled
32 54 Adrian Georgescu
33 1 Adrian Georgescu
 * If '''account.xcap.xcap_root''' is not defined, locate XCAP root by doing a DNS TXT lookup for xcap.example.com
34 1 Adrian Georgescu
 * GET XCAP application xcap-caps
35 1 Adrian Georgescu
 * GET the default filename for all applications supported in xcap-caps and cache them locally
36 54 Adrian Georgescu
 * If '''account.xcap.subscribe_xcap_diff''' is enabled, SUBSCRIBE for '''Event: xcap-diff'''
37 54 Adrian Georgescu
38 54 Adrian Georgescu
If account.presence.enable_publish is enabled
39 54 Adrian Georgescu
40 54 Adrian Georgescu
 * If '''pidf-manipulation''' application is supported by XCAP server, update the '''presentity''' with the PIDF stored on the XCAP server
41 1 Adrian Georgescu
 * Initialize own '''presentity''' 
42 54 Adrian Georgescu
43 54 Adrian Georgescu
If account.presence.subscribe_winfo is enabled
44 54 Adrian Georgescu
45 1 Adrian Georgescu
 * Initialize '''watchers list''' for Event presence
46 54 Adrian Georgescu
 * Send Subscribe for ''presence.winfo''
47 1 Adrian Georgescu
48 54 Adrian Georgescu
If account.presence.resource_lists is enabled
49 54 Adrian Georgescu
50 54 Adrian Georgescu
 * Initialize the '''Contact List''' by using the content of the XCAP document '''resource-lists'''
51 54 Adrian Georgescu
52 1 Adrian Georgescu
While running
53 1 Adrian Georgescu
54 1 Adrian Georgescu
 * Refresh the XCAP server location based on DNS TTL
55 48 Adrian Georgescu
 * Reload XCAP documents based on '''xcap-diff''' NOTIFYs
56 47 Adrian Georgescu
57 54 Adrian Georgescu
== Contacts List ==
58 48 Adrian Georgescu
59 54 Adrian Georgescu
The ''Contacts List'' contains is a list of contacts displayed by the GUI. For some contacts we SUBSCRIBE for '''Event: presence'''. The list is indexed by a unique SIP URI, a random SIP URI must be generated for contacts that do not have a SIP URI and we must mark the contacts that we want to subscribe to. 
60 15 Adrian Georgescu
61 54 Adrian Georgescu
Additional, one can store full names and other attributes for each contact by using extensions to PIDF for contact information (cipid extension). 
62 1 Adrian Georgescu
63 1 Adrian Georgescu
Based on received NOTIFY messages for Event=presence, each contact has a '''presentity''' attribute that contains its own published information. The GUI can display attributes of each '''presentity'''.
64 1 Adrian Georgescu
65 1 Adrian Georgescu
 * The contacts list is stored in the main '''resource-lists''' XCAP document '''index'''
66 1 Adrian Georgescu
 * Maintain a '''presentity''' attribute with what is received in the Notify for presence for each contact
67 1 Adrian Georgescu
 * If '''account.presence.subscribe_rls_services''' is True, a RLS document that contains a list of discrete SIP URIs we subscribe to and PUT it on the server under SIP URI account-buddies@domain. Then a Subscribe is sent with Supported: eventlist for this SIP URI. /otherwise send SUBSCRIBVE to each contact for '''Event: presence''' 
68 1 Adrian Georgescu
 * On contacts list change, PUT resource-lists and rls-services documents on the XCAP server
69 1 Adrian Georgescu
 
70 1 Adrian Georgescu
A contact has properties related to his device capabilities (e.g. can_chat, can_share, can_talk, can_video). This is conveyed via '''presence caps''' and updates the preferences set by the local user
71 1 Adrian Georgescu
 
72 1 Adrian Georgescu
== Watcher lists ==
73 1 Adrian Georgescu
74 1 Adrian Georgescu
 * Built based on the body of NOTIFY for '''Event=presence.winfo'''.
75 48 Adrian Georgescu
76 53 Adrian Georgescu
== Presence rules ==
77 53 Adrian Georgescu
78 54 Adrian Georgescu
 * Based on NOTIFY for event '''watcher.info''' we alert the user about new watchers and we update the policy stored in pres-rules document
79 54 Adrian Georgescu
 * PUT '''pres-rules''' document on the XCAP server and cache it locally
80 53 Adrian Georgescu
81 54 Adrian Georgescu
Transformations are required to support the following functionality:
82 35 Adrian Georgescu
83 54 Adrian Georgescu
 1.  First degree watchers - access to entire PIDF
84 54 Adrian Georgescu
 1.  Second degree watchers - access to subset of PIDF
85 54 Adrian Georgescu
 1.  Third degree watchers - access to basic presence online/offline
86 32 Adrian Georgescu
87 1 Adrian Georgescu
== Icon exhange ==
88 1 Adrian Georgescu
89 26 Adrian Georgescu
There is how OMA has specified such XCAP application: 
90 32 Adrian Georgescu
91 1 Adrian Georgescu
'"Presence Content XDM Specification'"
92 1 Adrian Georgescu
93 48 Adrian Georgescu
http://www.openmobilealliance.org/technical/release_program/docs/PresenceSIMPLE/V2_0-20081223-C/OMA-TS-Presence_SIMPLE_Content_XDM-V1_0-20081223-C.pdf
94 1 Adrian Georgescu
95 1 Adrian Georgescu
Publishing end-point, on boot:
96 9 Adrian Georgescu
97 1 Adrian Georgescu
 1. HTTP GET for xcap-directory and locate previously uploaded icon (e.g. ABC)
98 32 Adrian Georgescu
 1. HTTP GET http://xcap.example.com/xcap-root/org.openmobilealliance.pres-content/users/sip:alice@example.com/oma_status-icon/ABC
99 9 Adrian Georgescu
100 1 Adrian Georgescu
Publishing end-point, on icon change:
101 32 Adrian Georgescu
102 9 Adrian Georgescu
 1. Generate a new random filename: XYZ
103 9 Adrian Georgescu
 1. Build URL http://xcap.example.com/xcap-root/org.openmobilealliance.pres-content/users/sip:alice@example.com/oma_status-icon/XYZ
104 41 Adrian Georgescu
 1. HTTP PUT to xcap server
105 41 Adrian Georgescu
 1. Update <icon> element of pidf and PUBLISH new pidf
106 41 Adrian Georgescu
 1. HTTP DELETE any previous icon file ABC
107 41 Adrian Georgescu
108 1 Adrian Georgescu
Subscribing end-point:
109 48 Adrian Georgescu
110 48 Adrian Georgescu
 1. Parse <icon> element of pidf received in Notify
111 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
112 1 Adrian Georgescu
 3. Cache picture until next NOTIFY with diferent <icon> element is received
113 1 Adrian Georgescu
114 1 Adrian Georgescu