DesignBuddyList

Version 38 (Adrian Georgescu, 07/21/2009 10:16 pm)

1 27 Adrian Georgescu
= Presence blueprint =
2 2 Adrian Georgescu
3 2 Adrian Georgescu
[[TOC(Design*, depth=1)]]
4 1 Adrian Georgescu
5 23 Adrian Georgescu
This is a high level class that can be used to manage a buddy list driven interface of a SIP client graphical user interface.  It implements a combination of SIP SIMPLE standards related to presence event package, its storage and policy.
6 14 Adrian Georgescu
7 1 Adrian Georgescu
 * Account
8 1 Adrian Georgescu
 * Address-book
9 1 Adrian Georgescu
 * Buddy list
10 13 Adrian Georgescu
 * Presence watcher list
11 1 Adrian Georgescu
 * Presence rules
12 15 Adrian Georgescu
 * Dialog watcher list
13 1 Adrian Georgescu
 * Dialog rules
14 15 Adrian Georgescu
 * Icon exchange
15 1 Adrian Georgescu
16 38 Adrian Georgescu
'''Click on own Picture to toggle between work and private spheres'''
17 38 Adrian Georgescu
18 1 Adrian Georgescu
== Account ==
19 1 Adrian Georgescu
20 25 Adrian Georgescu
This is the same entity that Registers and does other operations in behalf of the SIP account.
21 22 Adrian Georgescu
22 1 Adrian Georgescu
On boot
23 1 Adrian Georgescu
24 25 Adrian Georgescu
 * Initialize the '''buddy list''' from XCAP documents cache if any, otherwise build an empty list to be used by the GUI at boot time
25 25 Adrian Georgescu
 * Initialize '''presentity''' from local cache
26 31 Adrian Georgescu
 * If '''account.presence.xcap_root''' is not defined locate XCAP root by doing a DNS TXT lookup for xcap.example.com, deal with DNS timeout
27 25 Adrian Georgescu
 * GET XCAP application xcap-caps 
28 25 Adrian Georgescu
 * Dependent on the content of xcap-caps, GET the default filename for pres-rules, resource-lists, pidf-manipulation, rls-services, dialog-rules, icon, xcap-directory applications from XCAP server and cache all documents, deal with HTTP timeout
29 26 Adrian Georgescu
 * If '''pres-rules''' application is supported by XCAP server, send Subscribe for event presence.info and initialize presence '''watchers''' list
30 25 Adrian Georgescu
 * If '''icon''' application is supported by XCAP server, GET curent icon image from the xcap server
31 26 Adrian Georgescu
 * If '''dialog-rules''' application is supported by XCAP server, send Subscribe for event dialog.info and initialize dialog '''watchers''' list
32 26 Adrian Georgescu
 * if '''pidf-manipulation''' application is supported by XCAP server, update the '''presentity''' with '''pidf-manipulation''' document
33 26 Adrian Georgescu
 * Send PUBLISH for '''Event: presence'''
34 26 Adrian Georgescu
 * If '''account.message_summary.enabled''' SUBSCRIBE for '''Event: message-summary'''
35 26 Adrian Georgescu
 * If '''account.presence.subscribe_xcap_diff.enabled''' SUBSCRIBE for '''Event: xcap-diff'''
36 25 Adrian Georgescu
 * Load '''buddy list'''
37 1 Adrian Georgescu
38 1 Adrian Georgescu
While running
39 1 Adrian Georgescu
40 25 Adrian Georgescu
 * Refresh XCAP server location based on DNS TTL
41 26 Adrian Georgescu
 * Refresh PUBLISH for event '''presence'''
42 26 Adrian Georgescu
 * Refresh SUBSCRIBE to '''presence.winfo'''
43 26 Adrian Georgescu
 * Refresh SUBSCRIBE to '''dialog.winfo'''
44 26 Adrian Georgescu
 * Refresh SUBSCRIBE to '''xcap-diff'''
45 1 Adrian Georgescu
 * Refresh SUBSCRIBE to '''message-summary'''
46 27 Adrian Georgescu
 * Reload XCAP documents based on '''xcap-diff''' NOTIFYs
47 29 Adrian Georgescu
 * Update '''presentity''' based on GUI actions or automatic sensors and cache it
48 1 Adrian Georgescu
49 30 Adrian Georgescu
Long term state
50 25 Adrian Georgescu
51 30 Adrian Georgescu
 * Update '''pidf-manipulation document''' and '''presentity'''
52 25 Adrian Georgescu
  
53 17 Adrian Georgescu
== Address book ==
54 1 Adrian Georgescu
55 28 Adrian Georgescu
Use the OS standard address book. It is used only when searching for a contact in the main GUI interface.
56 14 Adrian Georgescu
57 14 Adrian Georgescu
== Buddy list ==
58 1 Adrian Georgescu
59 28 Adrian Georgescu
Contains a list of buddies we SUBSCRIBE to for '''Event: presence'''. The buddy 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 e must musk buddies we want to subscribe to by setting a particular flag for each of them. Additional, one can store full names and other attributes for each buddy by using extensions to pidf for contact information. Based on NOTIFY for Event=presence each buddy has a '''presentity''' attribute that contains its published information. The GUI displays various attributes of each '''presentity'''.
60 17 Adrian Georgescu
61 25 Adrian Georgescu
 * The buddy list is stored in the main '''resource-lists''' XCAP document '''index'''
62 25 Adrian Georgescu
 * Maintain a '''presentity''' attribute with what is received in the Notify for each buddy
63 25 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 buddy for '''Event: presence''' 
64 25 Adrian Georgescu
 * On buddy lists change, PUT resource-lists and rls-services documents on the XCAP server and cache them locally
65 25 Adrian Georgescu
 * account.presence.subscribe_rls_services must be normalized when set to '''auto'''
66 37 Adrian Georgescu
 
67 37 Adrian Georgescu
A buddy must have properties related to his device capabilities (e.g. can_chat, can_share, can_talk, can_video). This is conveyed via '''caps'''
68 37 Adrian Georgescu
 
69 1 Adrian Georgescu
== Presence watcher lists ==
70 1 Adrian Georgescu
71 28 Adrian Georgescu
Built based on the body of NOTIFY for '''Event=presence.winfo'''.
72 1 Adrian Georgescu
73 1 Adrian Georgescu
== Presence rules ==
74 20 Adrian Georgescu
75 28 Adrian Georgescu
 * Based on NOTIFY for event '''watcher.info''' we update the policy
76 28 Adrian Georgescu
 * PUT '''pres-rules''' document on the XCAP server and cache locally
77 15 Adrian Georgescu
78 15 Adrian Georgescu
== Dialog watcher lists ==
79 1 Adrian Georgescu
80 28 Adrian Georgescu
Built based on the body of NOTIFY for '''event=dialog.winfo'''. To be built in OpenSIPS.
81 1 Adrian Georgescu
82 1 Adrian Georgescu
== Dialog rules ==
83 1 Adrian Georgescu
84 28 Adrian Georgescu
Based on NOTIFY for event '''dialog.winfo''' we update the policy and PUT '''dialog-rules''' document on the XCAP server. To be built in OpenXCAP server.
85 1 Adrian Georgescu
86 9 Adrian Georgescu
== Icon exhange ==
87 1 Adrian Georgescu
88 35 Adrian Georgescu
There is how OMA has specified such XCAP application: 
89 1 Adrian Georgescu
90 35 Adrian Georgescu
'"Presence Content XDM Specification'"
91 36 Adrian Georgescu
92 35 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
93 33 Adrian Georgescu
94 1 Adrian Georgescu
Support in OpenXCAP server is necessary, see http://openxcap.org/ticket/100
95 9 Adrian Georgescu
96 26 Adrian Georgescu
Publishing end-point, on boot:
97 32 Adrian Georgescu
98 32 Adrian Georgescu
 1. HTTP GET for xcap-directory and locate previously uploaded icon (e.g. ABC)
99 26 Adrian Georgescu
 1. HTTP GET http://xcap.example.com/xcap-root/org.openmobilealliance.pres-content/users/sip:alice@example.com/oma_status-icon/ABC
100 32 Adrian Georgescu
101 1 Adrian Georgescu
Publishing end-point, on change:
102 9 Adrian Georgescu
103 1 Adrian Georgescu
 1. Generate a new random filename: XYZ
104 32 Adrian Georgescu
 1. Build URL http://xcap.example.com/xcap-root/org.openmobilealliance.pres-content/users/sip:alice@example.com/oma_status-icon/XYZ
105 9 Adrian Georgescu
 1. HTTP PUT to xcap server
106 1 Adrian Georgescu
 1. Update <icon> element of pidf and PUBLISH new pidf
107 32 Adrian Georgescu
 1. HTTP DELETE any previous icon file ABC
108 9 Adrian Georgescu
109 9 Adrian Georgescu
Subscribing end-point:
110 9 Adrian Georgescu
111 9 Adrian Georgescu
 1. Parse <icon> element of pidf received in Notify
112 32 Adrian Georgescu
 2. HTTP GET http://xcap.example.com/xcap-root/org.openmobilealliance.pres-content/users/sip:alice@example.com/oma_status-icon/XYZ
113 26 Adrian Georgescu
 3. Cache picture until next NOTIFY with diferent <icon> element is received