Sip subscribe rls

Version 22 (Tijmen de Mes, 04/19/2012 09:24 pm)

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