Sip subscribe rls » History » Version 19
Adrian Georgescu, 04/14/2009 08:45 AM
1 | 10 | Adrian Georgescu | == sip_subscribe_rls == |
---|---|---|---|
2 | 14 | Adrian Georgescu | [[TOC(SipTesting*, sip_*,xcap*, depth=2)]] |
3 | 1 | Adrian Georgescu | |
4 | 10 | Adrian Georgescu | === Description === |
5 | 1 | Adrian Georgescu | |
6 | 8 | Adrian Georgescu | A Resource List Server (RLS) services application is a Session Initiation Protocol (SIP) application whereby a server receives SUBSCRIBE requests for a resource, and generates subscriptions towards a resource list. The received NOTIFY messages are the aggregated downstream to the original subscriber generating less traffic to the subscriber end-user device. |
7 | 1 | Adrian Georgescu | |
8 | This script implements sending SUBSCRIBE to a RLS server and receiving NOTIFY messages from it. |
||
9 | 17 | Adrian Georgescu | |
10 | [[Image(http://www.openxcap.org/chrome/site/SIMPLE-RLS-services.png)]] |
||
11 | 6 | Adrian Georgescu | |
12 | 2 | Adrian Georgescu | Source code: [source:scripts/sip_subscribe_rls.py scripts/sip_subscribe_rls.py] |
13 | 1 | Adrian Georgescu | |
14 | {{{ |
||
15 | 3 | Adrian Georgescu | adigeo@ag-imac3:~$sip_subscribe_rls -h |
16 | Usage: sip_subscribe_rls [options] [target-user@target-domain.com] |
||
17 | 1 | Adrian Georgescu | |
18 | This script will SUBSCRIBE to the presence event published by the specified |
||
19 | 3 | Adrian Georgescu | SIP target assuming it is a resource list handled by a RLS server. The RLS |
20 | server will then SUBSCRIBE in behalf of the account, collect NOTIFYs with the |
||
21 | presence information of the recipients and provide periodically aggregated |
||
22 | NOTIFYs back to the subscriber. If a target address is not specified, it will |
||
23 | subscribe to the account's own address. It will then interprete PIDF bodies |
||
24 | 1 | Adrian Georgescu | contained in NOTIFYs and display their meaning. The program will un-SUBSCRIBE |
25 | and quit when CTRL+D is pressed. |
||
26 | |||
27 | Options: |
||
28 | -h, --help show this help message and exit |
||
29 | -a NAME, --account-name=NAME |
||
30 | The account name from which to read account settings. |
||
31 | Corresponds to section Account_NAME in the |
||
32 | configuration file. If not supplied, the section |
||
33 | Account will be read. |
||
34 | --sip-address=SIP_ADDRESS |
||
35 | SIP address of the user in the form user@domain |
||
36 | -p PASSWORD, --password=PASSWORD |
||
37 | Password to use to authenticate the local account. |
||
38 | This overrides the setting from the config file. |
||
39 | -n DISPLAY_NAME, --display-name=DISPLAY_NAME |
||
40 | Display name to use for the local account. This |
||
41 | overrides the setting from the config file. |
||
42 | -e EXPIRES, --expires=EXPIRES |
||
43 | "Expires" value to set in SUBSCRIBE. Default is 300 |
||
44 | seconds. |
||
45 | -o IP[:PORT], --outbound-proxy=IP[:PORT] |
||
46 | Outbound SIP proxy to use. By default a lookup of the |
||
47 | domain is performed based on SRV and A records. This |
||
48 | overrides the setting from the config file. |
||
49 | -c CONTENT_TYPE, --content-type=CONTENT_TYPE |
||
50 | "Content-Type" the UA expects to receving in a NOTIFY |
||
51 | for this subscription. For the known events this does |
||
52 | not need to be specified, but may be overridden". |
||
53 | -s, --trace-sip Dump the raw contents of incoming and outgoing SIP |
||
54 | messages (disabled by default). |
||
55 | -l, --log-pjsip Print PJSIP logging output (disabled by default). |
||
56 | }}} |
||
57 | 19 | Adrian Georgescu | |
58 | === Example === |
||
59 | |||
60 | {{{ |
||
61 | adigeo@ag-imac3:~$sip_subscribe_rls |
||
62 | Using account 31208005169@ag-projects.com |
||
63 | Subscribing to sip:31208005169-buddies@ag-projects.com for the presence event |
||
64 | Subscription succeeded at 81.23.228.150:5060;transport=udp |
||
65 | Received NOTIFY: |
||
66 | --kDhCK3ub5XA4X3gQoEF5Mugt |
||
67 | Content-Transfer-Encoding: binary |
||
68 | Content-ID: <1239691491.sip:31208005169-buddies@ag-projects.com.615954109> |
||
69 | Content-Type: application/rlmi+xml;charset="UTF-8r" |
||
70 | |||
71 | <?xml version="1.0"?> |
||
72 | <list uri="sip:31208005169-buddies@ag-projects.com" xmlns="urn:ietf:params:xml:ns:rlmi" version="1" fullState="true"> |
||
73 | <resource uri="sip:adi@umts.ro"/> |
||
74 | <resource uri="sip:alice@ag-projects.com"/> |
||
75 | <resource uri="sip:luci@umts.ro"/> |
||
76 | </list> |
||
77 | |||
78 | --kDhCK3ub5XA4X3gQoEF5Mugt-- |
||
79 | |||
80 | |||
81 | Available control keys: |
||
82 | t: toggle SIP trace on the console |
||
83 | j: toggle PJSIP trace on the console |
||
84 | n: toggle notifications trace on the console |
||
85 | Ctrl-d: quit the program |
||
86 | ?: display this help message |
||
87 | }}} |