Sip subscribe winfo » History » Version 18
Adrian Georgescu, 04/13/2009 10:54 AM
1 | 8 | Adrian Georgescu | == sip_subscribe_winfo == |
---|---|---|---|
2 | 15 | Adrian Georgescu | [[TOC(SipTesting*, sip_*,xcap*, depth=2)]] |
3 | |||
4 | 8 | Adrian Georgescu | === Description === |
5 | 1 | Adrian Georgescu | |
6 | 16 | Adrian Georgescu | [[Image(http://www.openxcap.org/chrome/site/SIMPLE-Winfo.png)]] |
7 | 11 | Adrian Georgescu | |
8 | 6 | Adrian Georgescu | Watchers are defined as entities that request (i.e., subscribe to) |
9 | information about a resource, using the SIP event framework, RFC 3265. There |
||
10 | is fairly complex state associated with these subscriptions. This state |
||
11 | includes the identity of the subscriber, the state of the subscription, and |
||
12 | so on. The union of the state for all subscriptions to a particular resource |
||
13 | is called the watcher information for that resource. This state is dynamic, |
||
14 | changing as subscribers come and go. As a result, it is possible, and |
||
15 | indeed useful, to subscribe to the watcher information for a particular |
||
16 | resource. An important application of this is the ability for a user to find |
||
17 | out the set of subscribers to their presentity. This would allow the user to |
||
18 | provide an authorization decision for the subscription. |
||
19 | |||
20 | This script implements SUBSCRIBE for the watcher info event package and |
||
21 | manipulation of the pres-rules document that holds the presence policy of |
||
22 | the subscribing user. |
||
23 | 3 | Adrian Georgescu | |
24 | 2 | Adrian Georgescu | Source code: [source:scripts/sip_subscribe_winfo.py scripts/sip_subscribe_winfo.py] |
25 | |||
26 | 1 | Adrian Georgescu | {{{ |
27 | adigeo@ag-imac3:~$sip_subscribe_winfo -h |
||
28 | 17 | Adrian Georgescu | Usage: sip_subscribe_winfo [options] [target-user@target-domain.com] |
29 | 1 | Adrian Georgescu | |
30 | 17 | Adrian Georgescu | This script displays the current presence rules, SUBSCRIBEs to the |
31 | presence.winfo event of itself and prompts the user to update the presence |
||
32 | rules document when a new watcher is in 'pending'/'waiting' state. The program |
||
33 | will un-SUBSCRIBE and quit when CTRL+D is pressed. |
||
34 | 1 | Adrian Georgescu | |
35 | Options: |
||
36 | -h, --help show this help message and exit |
||
37 | 17 | Adrian Georgescu | -a ACCOUNT_NAME, --account-name=ACCOUNT_NAME |
38 | The name of the account to use. |
||
39 | 1 | Adrian Georgescu | -s, --trace-sip Dump the raw contents of incoming and outgoing SIP |
40 | messages (disabled by default). |
||
41 | 17 | Adrian Georgescu | -j, --trace-pjsip Print PJSIP logging output (disabled by default). |
42 | 1 | Adrian Georgescu | }}} |
43 | |||
44 | === Example === |
||
45 | |||
46 | {{{ |
||
47 | adigeo@ag-imac3:~/work/pypjua$sip_subscribe_winfo |
||
48 | Accounts available: 'alice', 'bob', 'ew', 'mrg', 'pbx', 'tf', 'umts', 'unet', default |
||
49 | Using default account: 31208005169@ag-projects.com |
||
50 | Resolved DNS SRV record "_sip._udp.ag-projects.com" --> proxy.sipthor.net:5060 |
||
51 | Resolved DNS A record "proxy.sipthor.net" --> 85.17.186.7, 81.23.228.150, 81.23.228.129 |
||
52 | Retrieving current presence rules from https://xcap.sipthor.net/xcap-root/ |
||
53 | Allowed list: |
||
54 | sip:2233350608@sip2sip.info |
||
55 | sip:31208005163@ag-projects.com |
||
56 | sip:31208005166@ag-projects.com |
||
57 | sip:31208005167@ag-projects.com |
||
58 | sip:adi@umts.ro |
||
59 | sip:alice@example.com |
||
60 | sip:ruud@umts.ro |
||
61 | sip:317105169@eurovoice.ro |
||
62 | Blocked list: |
||
63 | Polite-blocked list: |
||
64 | Subscribing to "31208005169@ag-projects.com" for the presence.winfo event, at 81.23.228.129:5060 |
||
65 | Received NOTIFY: |
||
66 | ---- |
||
67 | Active watchers: |
||
68 | Terminated watchers: |
||
69 | Pending watchers: |
||
70 | sip:bob@example.com |
||
71 | Waiting watchers: |
||
72 | ---- |
||
73 | pending watcher sip:bob@example.com wants to subscribe to your presence information. Press (a) to allow, (d) to deny, (p) to polite block: |
||
74 | Watcher sip:bob@example.com is now allowed |
||
75 | |||
76 | }}} |