DesignBuddyList

Version 53 (Adrian Georgescu, 01/28/2010 12:13 pm)

1 27 Adrian Georgescu
= Presence blueprint =
2 2 Adrian Georgescu
3 2 Adrian Georgescu
[[TOC(Design*, depth=1)]]
4 1 Adrian Georgescu
5 46 Adrian Georgescu
This is a high level representation of a mechanism that maintains a '''Contacts list''' that can be used by a GUI.  It implements a combination of SIP SIMPLE standards related to presence event package, storage and policy.
6 14 Adrian Georgescu
7 1 Adrian Georgescu
 * Account
8 41 Adrian Georgescu
 * Contacts
9 44 Adrian Georgescu
 * Watcher list
10 1 Adrian Georgescu
 * Presence rules
11 1 Adrian Georgescu
 * Icon exchange
12 41 Adrian Georgescu
 * Preferences
13 1 Adrian Georgescu
14 53 Adrian Georgescu
== Storage ==
15 1 Adrian Georgescu
16 51 Adrian Georgescu
The client maintains a '''Contacts list''' that is a concatenated list of resource-lists XCAP documents 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.
17 50 Adrian Georgescu
18 1 Adrian Georgescu
[[Image(BuddyList-Aggregation.png)]]
19 1 Adrian Georgescu
20 49 Adrian Georgescu
== Prerequisites ==
21 49 Adrian Georgescu
22 50 Adrian Georgescu
To implement full presence support the following functionality must be available in the servers side.
23 50 Adrian Georgescu
24 53 Adrian Georgescu
 1. ~~Support in OpenXCAP for '''icon''' application, http://openxcap.org/ticket/100~~
25 53 Adrian Georgescu
 1. ~~Support in OpenXCAP for '''xcap-directory''' application, http://openxcap.org/ticket/101~~
26 1 Adrian Georgescu
 1. OpenSIPS '''xcap-diff''' module to perform refresh_watchers()
27 53 Adrian Georgescu
 1. ~~OpenSIPS '''dialog-info''' module to use XCAP document dialog-rules for authorization~~
28 50 Adrian Georgescu
 1. OpenSIPS '''dialog-info''' module to sent notify for dialog-info.winfo Event 
29 50 Adrian Georgescu
 1. OpenXCAP to perform PUBLISH for xcap-diff when any xcap doc changes
30 53 Adrian Georgescu
 1. ~~Implement caps payload type in client (device capabilities)~~ 
31 53 Adrian Georgescu
 1. ~~Implement dialog-info event package in client~~
32 53 Adrian Georgescu
 1. Replace OpenXCAP mi command for xcap-diff with a SIP PUBLISH
33 47 Adrian Georgescu
34 48 Adrian Georgescu
== Account ==
35 1 Adrian Georgescu
36 48 Adrian Georgescu
On boot if presence enabled
37 1 Adrian Georgescu
38 53 Adrian Georgescu
 * If '''account.xcap.xcap_root''' is not defined, locate XCAP root by doing a DNS TXT lookup for xcap.example.com
39 1 Adrian Georgescu
 * GET XCAP application xcap-caps
40 48 Adrian Georgescu
 * GET the default filename for all applications supported in xcap-caps and cache them locally
41 48 Adrian Georgescu
 * Initialize own '''presentity''' 
42 48 Adrian Georgescu
 * Initialize '''watchers list''' for Event presence
43 48 Adrian Georgescu
 * Initialize '''watchers list''' for Event dialog-info
44 52 Adrian Georgescu
 * If '''pidf-manipulation''' application is supported by XCAP server, update the '''presentity''' with the PIDF stored on the XCAP server
45 1 Adrian Georgescu
 * Initialize '''Contacts''' using the content of the XCAP document '''resource-lists'''
46 53 Adrian Georgescu
 * If '''account.xcap.subscribe_xcap_diff''' is Enabled, SUBSCRIBE for '''Event: xcap-diff'''
47 1 Adrian Georgescu
48 48 Adrian Georgescu
While running
49 1 Adrian Georgescu
50 1 Adrian Georgescu
 * Refresh the XCAP server location based on DNS TTL
51 1 Adrian Georgescu
 * Reload XCAP documents based on '''xcap-diff''' NOTIFYs
52 47 Adrian Georgescu
53 1 Adrian Georgescu
== Contacts ==
54 1 Adrian Georgescu
55 48 Adrian Georgescu
Contains is a list of contacts displayed in a GUI. For some contacts we SUBSCRIBE for '''Event: presence''' and '''Event: dialog-info'''. 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. 
56 47 Adrian Georgescu
57 47 Adrian Georgescu
Additional, one can store full names and other attributes for each contact by using extensions to PIDF for contact information. 
58 47 Adrian Georgescu
59 47 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'''.
60 41 Adrian Georgescu
61 41 Adrian Georgescu
 * The contacts list is stored in the main '''resource-lists''' XCAP document '''index'''
62 48 Adrian Georgescu
 * Maintain a '''presentity''' attribute with what is received in the Notify for presence for each contact
63 48 Adrian Georgescu
 * Maintain a '''dialog-info''' attribute with what is received in the Notify for dialog-info event for each contact
64 48 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''' 
65 47 Adrian Georgescu
 * On contacts list change, PUT resource-lists and rls-services documents on the XCAP server
66 15 Adrian Georgescu
 
67 28 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
68 1 Adrian Georgescu
 
69 1 Adrian Georgescu
== Watcher lists ==
70 1 Adrian Georgescu
71 1 Adrian Georgescu
 * Built based on the body of NOTIFY for '''Event=presence.winfo'''.
72 1 Adrian Georgescu
 * Built based on the body of NOTIFY for '''Event=dialog-info.winfo'''.
73 1 Adrian Georgescu
74 1 Adrian Georgescu
== Presence rules ==
75 1 Adrian Georgescu
76 1 Adrian Georgescu
 * Based on NOTIFY for event '''watcher.info''' we update the policy
77 48 Adrian Georgescu
 * PUT '''pres-rules''' document on the XCAP server and cache locally
78 53 Adrian Georgescu
79 53 Adrian Georgescu
We must transformations to support the following functionality:
80 53 Adrian Georgescu
81 53 Adrian Georgescu
 1.  Close watchers - access to entire PIDF
82 53 Adrian Georgescu
 1.  Far watchers - access to subset of PIDF
83 53 Adrian Georgescu
 1.  Farther watchers - access to basic presence
84 35 Adrian Georgescu
85 36 Adrian Georgescu
== Icon exhange ==
86 35 Adrian Georgescu
87 33 Adrian Georgescu
There is how OMA has specified such XCAP application: 
88 9 Adrian Georgescu
89 26 Adrian Georgescu
'"Presence Content XDM Specification'"
90 32 Adrian Georgescu
91 32 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
92 1 Adrian Georgescu
93 1 Adrian Georgescu
Publishing end-point, on boot:
94 26 Adrian Georgescu
95 32 Adrian Georgescu
 1. HTTP GET for xcap-directory and locate previously uploaded icon (e.g. ABC)
96 1 Adrian Georgescu
 1. HTTP GET http://xcap.example.com/xcap-root/org.openmobilealliance.pres-content/users/sip:alice@example.com/oma_status-icon/ABC
97 1 Adrian Georgescu
98 48 Adrian Georgescu
Publishing end-point, on icon change:
99 1 Adrian Georgescu
100 1 Adrian Georgescu
 1. Generate a new random filename: XYZ
101 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
102 1 Adrian Georgescu
 1. HTTP PUT to xcap server
103 32 Adrian Georgescu
 1. Update <icon> element of pidf and PUBLISH new pidf
104 9 Adrian Georgescu
 1. HTTP DELETE any previous icon file ABC
105 1 Adrian Georgescu
106 32 Adrian Georgescu
Subscribing end-point:
107 9 Adrian Georgescu
108 9 Adrian Georgescu
 1. Parse <icon> element of pidf received in Notify
109 41 Adrian Georgescu
 2. HTTP GET http://xcap.example.com/xcap-root/org.openmobilealliance.pres-content/users/sip:alice@example.com/oma_status-icon/XYZ
110 41 Adrian Georgescu
 3. Cache picture until next NOTIFY with diferent <icon> element is received
111 41 Adrian Georgescu
112 41 Adrian Georgescu
== Preferences ==
113 1 Adrian Georgescu
114 48 Adrian Georgescu
Manage the '''pres-rules''' and '''dialog-rules''' policy documents on XCAP server
115 48 Adrian Georgescu