Page MenuHomePhabricator

Sip Subscribe RLS
Updated 2,279 Days AgoPublic

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.

This script implements sending SUBSCRIBE to a RLS server and receiving NOTIFY messages from it.

This script is available in the Sip Clients package which must be installed separately from the SIP SIMPLE client SDK package.

Simple RLS Services

adigeo@ag-imac3:~$sip-subscribe-rls -h
Usage: sip-subscribe-rls [options] [target-user@target-domain.com]

This script will SUBSCRIBE to the presence event published by the specified
SIP target assuming it is a resource list handled by a RLS server. The RLS
server will then SUBSCRIBE in behalf of the account, collect NOTIFYs with the
presence information of the recipients and provide periodically aggregated
NOTIFYs back to the subscriber. If a target address is not specified, it will
subscribe to the account's own address. It will then interprete PIDF bodies
contained in NOTIFYs and display their meaning. The program will un-SUBSCRIBE
and quit when CTRL+D is pressed.

Options:
  -h, --help            show this help message and exit
  -a NAME, --account-name=NAME
                        The account name from which to read account settings.
                        Corresponds to section Account_NAME in the
                        configuration file. If not supplied, the section
                        Account will be read.
  --sip-address=SIP_ADDRESS
                        SIP address of the user in the form user@domain
  -p PASSWORD, --password=PASSWORD
                        Password to use to authenticate the local account.
                        This overrides the setting from the config file.
  -n DISPLAY_NAME, --display-name=DISPLAY_NAME
                        Display name to use for the local account. This
                        overrides the setting from the config file.
  -e EXPIRES, --expires=EXPIRES
                        "Expires" value to set in SUBSCRIBE. Default is 300
                        seconds.
  -o IP[:PORT], --outbound-proxy=IP[:PORT]
                        Outbound SIP proxy to use. By default a lookup of the
                        domain is performed based on SRV and A records. This
                        overrides the setting from the config file.
  -c CONTENT_TYPE, --content-type=CONTENT_TYPE
                        "Content-Type" the UA expects to receving in a NOTIFY
                        for this subscription. For the known events this does
                        not need to be specified, but may be overridden".
  -s, --trace-sip       Dump the raw contents of incoming and outgoing SIP
                        messages (disabled by default).
  -l, --log-pjsip       Print PJSIP logging output (disabled by default).

Example

adigeo@ag-imac3:~$sip-subscribe-rls 
Using account 31208005169@ag-projects.com
Subscribing to sip:31208005169-buddies@ag-projects.com for the presence event
Subscription succeeded at 81.23.228.150:5060;transport=udp
Received NOTIFY:
--kDhCK3ub5XA4X3gQoEF5Mugt
Content-Transfer-Encoding: binary
Content-ID: <1239691491.sip:31208005169-buddies@ag-projects.com.615954109>
Content-Type: application/rlmi+xml;charset="UTF-8r"

<?xml version="1.0"?>
<list uri="sip:31208005169-buddies@ag-projects.com" xmlns="urn:ietf:params:xml:ns:rlmi" version="1" fullState="true">
  <resource uri="sip:adi@umts.ro"/>
  <resource uri="sip:alice@ag-projects.com"/>
  <resource uri="sip:luci@umts.ro"/>
</list>

--kDhCK3ub5XA4X3gQoEF5Mugt--


Available control keys:
  t: toggle SIP trace on the console
  j: toggle PJSIP trace on the console
  n: toggle notifications trace on the console
  Ctrl-d: quit the program
  ?: display this help message
Last Author
tijmen
Last Edited
Sep 17 2018, 3:44 PM

Event Timeline

tijmen edited the content of this document. (Show Details)
tijmen edited the content of this document. (Show Details)