DesignBuddyList

Version 25 (Adrian Georgescu, 07/13/2009 07:02 pm)

1 25 Adrian Georgescu
= Presence design =
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 1 Adrian Georgescu
== Account ==
17 1 Adrian Georgescu
18 25 Adrian Georgescu
This is the same entity that Registers and does other operations in behalf of the SIP account.
19 22 Adrian Georgescu
20 1 Adrian Georgescu
On boot
21 1 Adrian Georgescu
22 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
23 25 Adrian Georgescu
 * Initialize '''presentity''' from local cache
24 25 Adrian Georgescu
 * Locate XCAP server by doing a DNS TXT lookup for xcap.example.com, deal with DNS timeout
25 25 Adrian Georgescu
 * GET XCAP application xcap-caps 
26 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
27 25 Adrian Georgescu
 * If '''pres-rules'''application is supported by XCAP server, send Subscribe for event presence.info
28 25 Adrian Georgescu
 * If '''icon''' application is supported by XCAP server, GET curent icon image from the xcap server
29 25 Adrian Georgescu
 * If '''dialog-rules''' application is supported by XCAP server, send Subscribe for event dialog.info
30 25 Adrian Georgescu
 * if '''pidf-manipulation''' application is support by XCAP server, initialize '''presentity''' with based on pidf-manipulation document, if exists, otherwise initialize '''presentity''' to last cached value
31 25 Adrian Georgescu
 * Send SIP PUBLISH for '''Event: presence''' with '''presentity'''
32 25 Adrian Georgescu
 * If '''account.message_summary.enabled''' send Subscribe for '''Event: message-summary'''
33 25 Adrian Georgescu
 * If '''account.presence.subscribe_xcap_diff.enabled''' send Subscribe for '''Event: xcap-diff'''
34 25 Adrian Georgescu
 * Load '''buddy list'''
35 1 Adrian Georgescu
36 1 Adrian Georgescu
While running
37 1 Adrian Georgescu
38 25 Adrian Georgescu
 * Refresh XCAP server location based on DNS TTL
39 25 Adrian Georgescu
 * Refresh Publish for event '''presence'''
40 25 Adrian Georgescu
 * Refresh subscription to '''presence.winfo'''
41 25 Adrian Georgescu
 * Refresh subscription to '''dialog.winfo'''
42 25 Adrian Georgescu
 * Refresh subscription to '''xcap-diff'''
43 25 Adrian Georgescu
 * Refresh subscription to '''message-summary'''
44 25 Adrian Georgescu
 * Reload XCAP documents based on xcap-diff NOTIFYs
45 25 Adrian Georgescu
46 25 Adrian Georgescu
On shutdown
47 25 Adrian Georgescu
48 25 Adrian Georgescu
 * Cache last '''presentity'''
49 25 Adrian Georgescu
  
50 17 Adrian Georgescu
== Address book ==
51 1 Adrian Georgescu
52 25 Adrian Georgescu
Use the OS standard address book.
53 14 Adrian Georgescu
54 14 Adrian Georgescu
== Buddy list ==
55 1 Adrian Georgescu
56 25 Adrian Georgescu
Contains a list of buddies we subscribe to. The buddylist is indexed by a unique SIP URI. Additional, one can store full names and other attributes. Based on NOTIFY for event=presence each buddy has a '''Presentity''' attribute that contains published information. GUI displays various attributes of each presentity.
57 17 Adrian Georgescu
58 25 Adrian Georgescu
 * The buddy list is stored in the main '''resource-lists''' XCAP document '''index'''
59 25 Adrian Georgescu
 * Maintain a '''presentity''' attribute with what is received in the Notify for each buddy
60 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''' 
61 25 Adrian Georgescu
 * On buddy lists change, PUT resource-lists and rls-services documents on the XCAP server and cache them locally
62 25 Adrian Georgescu
 * account.presence.subscribe_rls_services must be normalized when set to '''auto'''
63 13 Adrian Georgescu
  
64 1 Adrian Georgescu
== Presence watcher lists ==
65 1 Adrian Georgescu
66 1 Adrian Georgescu
Built based on the body of NOTIFY for event=presence.winfo.
67 1 Adrian Georgescu
68 1 Adrian Georgescu
== Presence rules ==
69 20 Adrian Georgescu
70 20 Adrian Georgescu
 * Based on NOTIFY for event watcher.info we update the policy
71 15 Adrian Georgescu
 * PUT pres-rules document on the XCAP server and cache locally
72 15 Adrian Georgescu
73 15 Adrian Georgescu
== Dialog watcher lists ==
74 15 Adrian Georgescu
75 12 Adrian Georgescu
Built based on the body of NOTIFY for event=dialog.winfo. To be built in OpenSIPS.
76 12 Adrian Georgescu
77 15 Adrian Georgescu
== Dialog rules ==
78 4 Adrian Georgescu
79 15 Adrian Georgescu
Based on NOTIFY for event dialog.info we update the policy and PUT dialog-rules document on the XCAP server. To be built in OpenXCAP server.
80 4 Adrian Georgescu
81 11 Adrian Georgescu
== Icon exhange ==
82 11 Adrian Georgescu
83 9 Adrian Georgescu
Support in OpenXCAP server is necessary, see http://openxcap.org/ticket/100
84 1 Adrian Georgescu
85 9 Adrian Georgescu
Publishing end-point, on change:
86 9 Adrian Georgescu
87 9 Adrian Georgescu
 1. Generate a random filename: XYZ
88 9 Adrian Georgescu
 1. Build URL http://xcap.example.com/xcap-root/icon/users/sip:alice@example.com/XYZ.png
89 9 Adrian Georgescu
 1. HTTP PUT to xcap server
90 9 Adrian Georgescu
 1. Update <icon> element of pidf and PUBLISH new pidf
91 1 Adrian Georgescu
 1. HTTP GET for xcap-directory and locate previously uploaded icons
92 9 Adrian Georgescu
 1. HTTP DELETE any previous icon files
93 1 Adrian Georgescu
94 9 Adrian Georgescu
On reboot:
95 9 Adrian Georgescu
96 1 Adrian Georgescu
 1. HTTP GET for xcap-directory and locate previously uploaded icon (e.g. XYZ)
97 9 Adrian Georgescu
 1. HTTP GET http://xcap.example.com/xcap-root/icon/users/sip:alice@example.com/XYZ.png
98 9 Adrian Georgescu
99 9 Adrian Georgescu
Subscribing end-point:
100 9 Adrian Georgescu
101 9 Adrian Georgescu
 1. Parse <icon> element of pidf received in Notify
102 1 Adrian Georgescu
 2. HTTP GET http://xcap.example.com/xcap-root/icon/users/sip:alice@example.com/XYZ.png
103 1 Adrian Georgescu
 3. Cache picture and check periodically