[sr-dev] [kamailio] RLS : Full state NOTIFY should be produced on first subscription (#276)

foucse notifications at github.com
Thu Aug 6 18:37:04 CEST 2015


Scenario :
Loading a rls-services XML file to admin at example.com (XCAP HTTP PUT) :
```xml
<?xml version="1.0" encoding="UTF-8"?>
<rls-services>
    <service uri="sip:points at example.com">
        <list name="points">
            <entry uri="sip:point1 at example.com">
                <display-name>Point 1</display-name>
            </entry>
            <entry uri="sip:point2 at example.com">
                <display-name>Point 2</display-name>
            </entry>
            <entry uri="sip:point3 at example.com">
                <display-name>Point 3</display-name>
            </entry>
        </list>
        <packages>
            <package>presence</package>
        </packages>
    </service>
</rls-services>

```
alice at example.com -> subscribes to event presence on -> point1 at example.com
bob at example.com -> subscribes to event presence on -> point1 at example.com
carol at example.com -> subscribes to event presence on -> point1 at example.com
Waiting some time (10~20 seconds, approx rls, waitn_time option)...
dave at example.com -> subscribes to event presence on -> point1 at example.com
admin at example.com -> subscribes to RLS event presence.winfo for the first time on -> points at example.com

Kamailio sends only partial state as mentioned in "fullState="false"" and "state="partial"" and only for user dave (last one subscribed) with version "5" :
```xml
NOTIFY sip:admin at 192.168.1.56:7060;transport=tcp SIP/2.0
Via: SIP/2.0/TCP 192.168.1.56;branch=z9hG4bKdfb9.fc98d020000000000000000000000000.0
To: <sip:admin at example.com>;tag=aoW7RQAYSw
From: <sip:points at example.com>;tag=8790d89920d6a95cb6b77ece9ac70b8d-80d4
CSeq: 2 NOTIFY
Call-ID: cCiV8exRxM
Content-Length: 1050
User-Agent: kamailio (4.4.0-dev2 (i386/linux))
Max-Forwards: 70
Event: presence.winfo
Contact: <sip:rls at 192.168.1.56:5060>
Subscription-State: active;expires=8
Require: eventlist
Content-Type: multipart/related;type="application/rlmi+xml";start="<1438875442.sip:points at example.com.1907048652>";boundary="LQLZpLYXZgJh5s2VPxHXdN1b"

--LQLZpLYXZgJh5s2VPxHXdN1b
Content-Transfer-Encoding: binary
Content-ID: <1438875442.sip:points at example.com.1907048652>
Content-Type: application/rlmi+xml;charset="UTF-8"

<?xml version="1.0"?>
<list uri="sip:points at example.com" xmlns="urn:ietf:params:xml:ns:rlmi" version="2" fullState="false"><resource uri="sip:point2 at example.com"><instance id="Scf8UhwQ" state="active" cid="1438875442.sip:point2 at example.com.1254686349"/></resource></list>

--LQLZpLYXZgJh5s2VPxHXdN1b
Content-Transfer-Encoding: binary
Content-ID: <1438875442.sip:point2 at example.com.1254686349>
Content-Type: application/watcherinfo+xml

<?xml version="1.0"?>
<watcherinfo xmlns="urn:ietf:params:xml:ns:watcherinfo" version="5" state="partial">
  <watcher-list resource="sip:point2 at example.com" package="presence">
    <watcher id="alice-bob-carol-dave" event="subscribe" status="active">sip:dave at example.com</watcher>
  </watcher-list>
</watcherinfo>

--LQLZpLYXZgJh5s2VPxHXdN1b--
```
If I am reading well RFC 4662 Section 4.5 (https://tools.ietf.org/html/rfc4662#section-4.5) Kamailio should send a full state NOTIFY for initial RLS subscribes and then it can send a partial state for updates.

I think we lose information here, but if a re-subscribe is performed I get a full NOTIFY, which is my current "workaround" :

1 - Initial subscribe
2 - If full state -> OK
3 - If partial state -> re-subscribe

```xml
NOTIFY sip:admin at 192.168.1.56:7060;transport=tcp SIP/2.0
Via: SIP/2.0/TCP 192.168.1.56;branch=z9hG4bK00c9.e11aad40000000000000000000000000.0
To: <sip:admin at example.com>;tag=AcM3AIKdAx
From: <sip:points at example.com>;tag=8790d89920d6a95cb6b77ece9ac70b8d-6573
CSeq: 1 NOTIFY
Call-ID: cCiV8exRxM
Content-Length: 3308
User-Agent: kamailio (4.4.0-dev2 (i386/linux))
Max-Forwards: 70
Event: presence.winfo
Contact: <sip:rls at 192.168.1.56:5060>
Subscription-State: active;expires=17
Require: eventlist
Content-Type: multipart/related;type="application/rlmi+xml";start="<1438875460.sip:points at example.com.151089623>";boundary="lxwToHs6uINUYOQjbengkND5"

--lxwToHs6uINUYOQjbengkND5
Content-Transfer-Encoding: binary
Content-ID: <1438875460.sip:points at example.com.151089623>
Content-Type: application/rlmi+xml;charset="UTF-8"

<?xml version="1.0"?>
<list uri="sip:points at example.com" xmlns="urn:ietf:params:xml:ns:rlmi" version="1" fullState="true">
  <resource uri="sip:point1 at example.com">
    <instance id="Scf8UhwQ" state="active" cid="1438875460.sip:point1 at example.com.236018746"/>
  </resource>
  <resource uri="sip:point2 at example.com">
    <instance id="Scf8UhwQ" state="active" cid="1438875460.sip:point2 at example.com.720412755"/>
  </resource>
  <resource uri="sip:point3 at example.com">
    <instance id="Scf8UhwQ" state="active" cid="1438875460.sip:point3 at example.com.1064774448"/>
  </resource>
</list>

--lxwToHs6uINUYOQjbengkND5
Content-Transfer-Encoding: binary
Content-ID: <1438875460.sip:point1 at example.com.236018746>
Content-Type: application/watcherinfo+xml

<?xml version="1.0"?>
<watcherinfo xmlns="urn:ietf:params:xml:ns:watcherinfo" version="1" state="full">
  <watcher-list resource="sip:point1 at example.com" package="presence">
    <watcher id="796ffdf4-22384 at 192.168.1.56" event="subscribe" status="active">sip:admin at example.com</watcher>
    <watcher id="796ffdf4-22381 at 192.168.1.56" event="subscribe" status="active">sip:admin at example.com</watcher>
  </watcher-list>
</watcherinfo>

--lxwToHs6uINUYOQjbengkND5
Content-Transfer-Encoding: binary
Content-ID: <1438875460.sip:point2 at example.com.720412755>
Content-Type: application/watcherinfo+xml

<?xml version="1.0"?>
<watcherinfo xmlns="urn:ietf:params:xml:ns:watcherinfo" version="1" state="full">
  <watcher-list resource="sip:point2 at example.com" package="presence">
    <watcher id="796ffdf5-22384 at 192.168.1.56" event="subscribe" status="active">sip:admin at example.com</watcher>
    <watcher id="alice-bob-carol-dave" event="subscribe" status="active">sip:alice at example.com</watcher>
    <watcher id="alice-bob-carol-dave" event="subscribe" status="active">sip:bob at example.com</watcher>
    <watcher id="alice-bob-carol-dave" event="subscribe" status="active">sip:carol at example.com</watcher>
    <watcher id="alice-bob-carol-dave" event="subscribe" status="active">sip:dave at example.com</watcher>
    <watcher id="796ffdf5-22381 at 192.168.1.56" event="subscribe" status="active">sip:admin at example.com</watcher>
  </watcher-list>
</watcherinfo>

--lxwToHs6uINUYOQjbengkND5
Content-Transfer-Encoding: binary
Content-ID: <1438875460.sip:point3 at example.com.1064774448>
Content-Type: application/watcherinfo+xml

<?xml version="1.0"?>
<watcherinfo xmlns="urn:ietf:params:xml:ns:watcherinfo" version="1" state="full">
  <watcher-list resource="sip:point3 at example.com" package="presence">
    <watcher id="796ffdf6-22384 at 192.168.1.56" event="subscribe" status="active">sip:admin at example.com</watcher>
    <watcher id="796ffdf6-22381 at 192.168.1.56" event="subscribe" status="active">sip:admin at example.com</watcher>
  </watcher-list>
</watcherinfo>

--lxwToHs6uINUYOQjbengkND5--
```


---
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/276
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20150806/0a6705a9/attachment-0001.html>


More information about the sr-dev mailing list