Re: [SR-Users] Presence + RLS + XCAP

2017-03-27 Thread Paul Smith
Hi Daniel,
Thanks for the response and link.  My config is broadly similar.

Presence is working over SIP (e.g. I can SUBSCRIBE and revive NOTIFY messages 
from the Kamailio Presence server)
and XCAP is working over HTTP (e.g I can GET, edit and PUT rls-service and 
resource-list documents into the XCAP table using curl over HTTP)

I don’t understand what the rls.so module is doing or how to debug.  I expect 
to PUT an resource-list document over the XCAP HTTP interface and then 
SUBSCRIBE to an eventlist over SIP…. at present I cannot SUBSCRIBE to the 
resource-list.  Any calls to rls_handle_subscribe() are getting the failure 
value back.

Any pointers on how to debug, or have I fundamentally misunderstood something?

Thanks

  

> On 27 Mar 2017, at 13:02, Daniel-Constantin Mierla  wrote:
> 
> Hello,
> 
> I haven't used snom with rls and xcap, however, my working configs with xcap 
> and based on the config snippet presented at:
> 
>   - http://lists.sip-router.org/pipermail/sr-users/2013-October/079988.html 
> 
> If you are not familiar with, be aware that XCAP should be over http(s).
> 
> Should you be still stuck on something related to this topic, let us know if 
> you already used a config like the one linked above, to follow up more on 
> this.
> 
> Cheers,
> Daniel
> 
> On 23/03/2017 14:04, Paul Smith wrote:
>> Hi
>>  I am struggling to figure out how to build and test an integrated presence 
>> server with Resource-List (rls.so) and XCAP (xcap_server.so).
>> 
>> I am confused about what is meant to happen and how to debug it.  Not sure 
>> if I am suffering from incompatibilities, configuration errors, or bugs…
>> 
>> I have not found an up to date guide on configuring an integrated presence, 
>> rls, xcap server so I have used old tutorials, module documentation and some 
>> course code review … but I’m pretty confused now!
>> 
>> I am using Snom phones and Jitsi (on Mac) to test.
>> 
>> I have a kamailio Registrar which proxies all presence messages to the 
>> separate kamailio 4.2 Presence server.
>> 
>> REQUIREMENT : Contact Presence
>> =
>> I would like to get a SUBSCRIBE from the Snom phone to subscribe to a 
>> contact-list resource list, and to receive a NOTIFY with all of the presence 
>> states for those contacts.  
>> 
>> Relevant snom settings?
>>  Contact List URI:  this generates a SUBSCRIBE with event:presence 
>> 
>> 
>> I believe that:
>> ==
>> presence module should be managing the individual user presence and dialog 
>> states
>> xcap module should allow me to use HTTP / curl to edit the resource lists
>> rls module should be managing the mapping from a resource list subscription 
>> to the individual presence states and generating the aggregated NOTIFY 
>> messages.
>> each device should then be able to SUBSCRIBE to a resource list uri and then 
>> receive an aggregated NOTIFY for all of the watched entities.
>> 
>> 
>> Current status:
>> ===
>> 
>> SUBSCRIBE sip:org1a-contacts@*.co.uk  
>> SIP/2.0
>> v: SIP/2.0/UDP 192.168.1.15:59594;branch=z9hG4bK-qllzlgs3xf43;rport
>> f: >;tag=wwasqc6lmb
>> t: >
>> i: 313439303236383530323234313530-x3hlb3j6b5ef
>> CSeq: 1 SUBSCRIBE
>> Max-Forwards: 70
>> User-Agent: snomD375/8.9.3.46
>> m: >;reg-id=1
>> Event: presence
>> Accept: application/pidf+xml, application/rlmi+xml, multipart/related
>> Supported: eventlist
>> Expires: 3600
>> l: 0
>> 
>> 
>>  … auth handshake
>> 
>>  
>> SIP/2.0 202 OK
>> Record-Route: > >
>> Record-Route: > >
>> v: SIP/2.0/UDP 
>> 192.168.1.15:59594;received=**recvip**;branch=z9hG4bK-8wufiv1ua3ne;rport=60554
>> f: >;tag=wwasqc6lmb
>> t: > >;tag=a6a1c5f60faecf035a1ae5b6e96e979a-d30e
>> i: 313439303236383530323234313530-x3hlb3j6b5ef
>> CSeq: 2 SUBSCRIBE
>> Expires: 3600
>> Contact: > >
>> Server: kamailio (4.2.0 (x86_64/linux))
>> Content-Length: 0
>> 
>> 
>>  … and then the snom receives an empty NOTIFY.
>> 
>> NOTIFY sip:org1a@192.168.1.15:58325  SIP/2.0
>> Via: SIP/2.0/UDP 
>> 109.104.108.18;branch=z9hG4bKc54a.20db45097fb44595ccd5a30827ca2a62.0
>> Via: SIP/2.0/UDP 
>> 10.210.160.16;rport=5060;branch=z9hG4bKc54a.40150886.0
>> To: >;tag=sx4ne9jpcl
>> From: 

Re: [SR-Users] Presence + RLS + XCAP

2017-03-27 Thread Daniel-Constantin Mierla
Hello,

I haven't used snom with rls and xcap, however, my working configs with
xcap and based on the config snippet presented at:

  - http://lists.sip-router.org/pipermail/sr-users/2013-October/079988.html

If you are not familiar with, be aware that XCAP should be over http(s).

Should you be still stuck on something related to this topic, let us
know if you already used a config like the one linked above, to follow
up more on this.

Cheers,
Daniel


On 23/03/2017 14:04, Paul Smith wrote:
> Hi
>  I am struggling to figure out how to build and test an integrated
> presence server with Resource-List (rls.so) and XCAP (xcap_server.so).
>
> I am confused about what is meant to happen and how to debug it.  Not
> sure if I am suffering from incompatibilities, configuration errors,
> or bugs…
>
> I have not found an up to date guide on configuring an integrated
> presence, rls, xcap server so I have used old tutorials, module
> documentation and some course code review … but I’m pretty confused now!
>
> I am using Snom phones and Jitsi (on Mac) to test.
>
> I have a kamailio Registrar which proxies all presence messages to the
> separate kamailio 4.2 Presence server.
>
> REQUIREMENT : Contact Presence
> =
> I would like to get a SUBSCRIBE from the Snom phone to subscribe to a
> contact-list resource list, and to receive a NOTIFY with all of the
> presence states for those contacts.  
>
> Relevant snom settings?
> Contact List URI:  this generates a SUBSCRIBE with event:presence 
>
>
> I believe that:
> ==
> presence module should be managing the individual user presence and
> dialog states
> xcap module should allow me to use HTTP / curl to edit the resource lists
> rls module should be managing the mapping from a resource list
> subscription to the individual presence states and generating the
> aggregated NOTIFY messages.
> each device should then be able to SUBSCRIBE to a resource list uri
> and then receive an aggregated NOTIFY for all of the watched entities.
>
>
> Current status:
> ===
>
> SUBSCRIBE sip:org1a-contacts@*.co.uk SIP/2.0
> v: SIP/2.0/UDP 192.168.1.15:59594;branch=z9hG4bK-qllzlgs3xf43;rport
> f: ;tag=wwasqc6lmb
> t: 
> i: 313439303236383530323234313530-x3hlb3j6b5ef
> CSeq: 1 SUBSCRIBE
> Max-Forwards: 70
> User-Agent: snomD375/8.9.3.46
> m: ;reg-id=1
> Event: presence
> Accept: application/pidf+xml, application/rlmi+xml, multipart/related
> Supported: eventlist
> Expires: 3600
> l: 0
>
>
>
> … auth handshake
>
> SIP/2.0 202 OK
> Record-Route: 
> Record-Route: 
> v: SIP/2.0/UDP
> 
> 192.168.1.15:59594;received=**recvip**;branch=z9hG4bK-8wufiv1ua3ne;rport=60554
> f: ;tag=wwasqc6lmb
> t:
> ;tag=a6a1c5f60faecf035a1ae5b6e96e979a-d30e
> i: 313439303236383530323234313530-x3hlb3j6b5ef
> CSeq: 2 SUBSCRIBE
> Expires: 3600
> Contact: 
> Server: kamailio (4.2.0 (x86_64/linux))
> Content-Length: 0
>
>
>
> … and then the snom receives an empty NOTIFY.
>
> NOTIFY sip:org1a@192.168.1.15:58325 SIP/2.0
> Via: SIP/2.0/UDP
> 109.104.108.18;branch=z9hG4bKc54a.20db45097fb44595ccd5a30827ca2a62.0
> Via: SIP/2.0/UDP
> 
> 10.210.160.16;rport=5060;branch=z9hG4bKc54a.40150886.0
> To: ;tag=sx4ne9jpcl
> From:
> ;tag=a6a1c5f60faecf035a1ae5b6e96e979a-ed89
> CSeq: 2 NOTIFY
> Call-ID: 313439303237323938323235353133-2du221e6okvf
> Content-Length: 0
> User-Agent: kamailio (4.2.0 (x86_64/linux))
> Max-Forwards: 69
> Event: presence
> Contact:
>  >
> Subscription-State: active;expires=3600
>
>
>
> The Subscription is showing up in the watchers table, not the
> rls_watchers table, so I believe it is being rejected by the
> rls_handle_subscribe() and then parsed by the presence module.  *Is
> that correct?*
>
> There is noting in rls_watchers or rls_presentity tables.  *Should
> there be?*
>
> I have a rows in the XCAP table for the Resource-List
>
> curl -d @/tmp/contacts-resource-list.xml -vvv -X PUT
> 
> http://109.104.108.23:5060/xcap-root/resource-lists/users/sip:org1a-conta...@hpbx449vb531.sip.byphone.co.uk/index
>
> relevant row in xcap table:
>
> |  3 | org1a-contacts | *.co.uk  |  version="1.0" encoding="UTF-8" standalone="no"?> xmlns="urn:ietf:params:xml:ns:resource-lists"> name="team">http://co.uk>"/>http://co.uk>">bob uri="sip:1003@.co.uk
> 

[SR-Users] Presence + RLS + XCAP

2017-03-23 Thread Paul Smith
Hi
 I am struggling to figure out how to build and test an integrated presence 
server with Resource-List (rls.so) and XCAP (xcap_server.so).

I am confused about what is meant to happen and how to debug it.  Not sure if I 
am suffering from incompatibilities, configuration errors, or bugs…

I have not found an up to date guide on configuring an integrated presence, 
rls, xcap server so I have used old tutorials, module documentation and some 
course code review … but I’m pretty confused now!

I am using Snom phones and Jitsi (on Mac) to test.

I have a kamailio Registrar which proxies all presence messages to the separate 
kamailio 4.2 Presence server.

REQUIREMENT : Contact Presence
=
I would like to get a SUBSCRIBE from the Snom phone to subscribe to a 
contact-list resource list, and to receive a NOTIFY with all of the presence 
states for those contacts.  

Relevant snom settings?
Contact List URI:  this generates a SUBSCRIBE with event:presence 


I believe that:
==
presence module should be managing the individual user presence and dialog 
states
xcap module should allow me to use HTTP / curl to edit the resource lists
rls module should be managing the mapping from a resource list subscription to 
the individual presence states and generating the aggregated NOTIFY messages.
each device should then be able to SUBSCRIBE to a resource list uri and then 
receive an aggregated NOTIFY for all of the watched entities.


Current status:
===

SUBSCRIBE sip:org1a-contacts@*.co.uk SIP/2.0
v: SIP/2.0/UDP 192.168.1.15:59594;branch=z9hG4bK-qllzlgs3xf43;rport
f: ;tag=wwasqc6lmb
t: 
i: 313439303236383530323234313530-x3hlb3j6b5ef
CSeq: 1 SUBSCRIBE
Max-Forwards: 70
User-Agent: snomD375/8.9.3.46
m: ;reg-id=1
Event: presence
Accept: application/pidf+xml, application/rlmi+xml, multipart/related
Supported: eventlist
Expires: 3600
l: 0


… auth handshake


SIP/2.0 202 OK
Record-Route: 
Record-Route: 
v: SIP/2.0/UDP 
192.168.1.15:59594;received=**recvip**;branch=z9hG4bK-8wufiv1ua3ne;rport=60554
f: ;tag=wwasqc6lmb
t: ;tag=a6a1c5f60faecf035a1ae5b6e96e979a-d30e
i: 313439303236383530323234313530-x3hlb3j6b5ef
CSeq: 2 SUBSCRIBE
Expires: 3600
Contact: 
Server: kamailio (4.2.0 (x86_64/linux))
Content-Length: 0


… and then the snom receives an empty NOTIFY.

NOTIFY sip:org1a@192.168.1.15:58325 SIP/2.0
Via: SIP/2.0/UDP 
109.104.108.18;branch=z9hG4bKc54a.20db45097fb44595ccd5a30827ca2a62.0
Via: SIP/2.0/UDP 
10.210.160.16;rport=5060;branch=z9hG4bKc54a.40150886.0
To: ;tag=sx4ne9jpcl
From: ;tag=a6a1c5f60faecf035a1ae5b6e96e979a-ed89
CSeq: 2 NOTIFY
Call-ID: 313439303237323938323235353133-2du221e6okvf
Content-Length: 0
User-Agent: kamailio (4.2.0 (x86_64/linux))
Max-Forwards: 69
Event: presence
Contact: 
Subscription-State: active;expires=3600


The Subscription is showing up in the watchers table, not the rls_watchers 
table, so I believe it is being rejected by the rls_handle_subscribe() and then 
parsed by the presence module.  Is that correct?

There is noting in rls_watchers or rls_presentity tables.  Should there be?

I have a rows in the XCAP table for the Resource-List
curl -d @/tmp/contacts-resource-list.xml -vvv -X PUT 
http://109.104.108.23:5060/xcap-root/resource-lists/users/sip:org1a-conta...@hpbx449vb531.sip.byphone.co.uk/index

relevant row in xcap table:

|  3 | org1a-contacts | *.co.uk | bobtest1test1006test1007test1008test1009
testing1005
testingorg1a
testingorg1c
 |4 | sr-1490270411-10965-2 |  0 | 
/xcap-root/resource-lists/users/sip:org1a-contacts@co.uk/index |0 |


I have rows in the presence table for the entities that I want to track e.g.
   ||
| 2889 | org1c| .co.uk | presence| a.1490270411.10942.42.1083 | 
1490277099 |1490273499 | 


open
Available

sip:org1c@.co.uk
Available


I am running kamaiio 4.2



Question : Should I have an resource-services row too? Or does rls.so infer the 
relationship using the URI?  When I use jitsi to manipulate its contact list it 
only inserts 2 rows into the xcap table and  I cannot get a SIP Subscribe to 
connect to that resource list either.

Question : What should the curl PUT commands and XML docs look like to build a 
valid RLS service (is there a good example anywhere)?

Question : Is there an example config or doc anywhere showing how to build 
integrated presence, rls, xcap?

Question : Has anyone got this working with Snom and or other handsets… the 
standards and implementations 

[SR-Users] Presence + RLS + XCAP

2017-03-23 Thread Paul Smith
Longer version of this got blocked by the mail list earlier today… and I have 
dug a bit deeper since then…

I am trying to SUBSCRIBE to a resource-list (rls.so) but the 
rls_handle_subscribe() is returning with a “list not found"

Mar 23 16:36:11 presence kamailio[12536]: DEBUG: rls [subscribe.c:211]: 
rls_get_service_list(): No rl document found
Mar 23 16:36:11 presence kamailio[12536]: DEBUG:  [db_res.c:81]: 
db_free_columns(): freeing 2 columns
Mar 23 16:36:11 presence kamailio[12536]: DEBUG:  [db_res.c:85]: 
db_free_columns(): freeing RES_NAMES[0] at 0x7f70b50ebee8
Mar 23 16:36:11 presence kamailio[12536]: DEBUG:  [db_res.c:85]: 
db_free_columns(): freeing RES_NAMES[1] at 0x7f70b50afb90
Mar 23 16:36:11 presence kamailio[12536]: DEBUG:  [db_res.c:94]: 
db_free_columns(): freeing result names at 0x7f70b50eaf98
Mar 23 16:36:11 presence kamailio[12536]: DEBUG:  [db_res.c:99]: 
db_free_columns(): freeing result types at 0x7f70b50cc0a0
Mar 23 16:36:11 presence kamailio[12536]: DEBUG:  [db_res.c:136]: 
db_free_result(): freeing result set at 0x7f70b50cc2d0
Mar 23 16:36:11 presence kamailio[12536]: DEBUG: rls [subscribe.c:634]: 
rls_handle_subscribe(): list not found - searched for uri 


I have tried various permutations of xml docs in the xcap table for the 
rls-service and resource-list but nothing have not yet managed to get a success 
from the rls_handle_subscribe()

Latest version of data in my mysql database / xcap table:
|  3 | org1a-contacts | **MYDOMAIN** | bobtest1test1006test1007test1008test1009
testing1005
testingorg1a  
  testingorg1c  
  1002 
dnd |4 | 
sr-1490270411-10960-2 |  0 | 
/xcap-root/resource-lists/users/sip:org1a-contacts@**MYDOMAIN**/index |0 |
|  4 | org1a-contacts | **MYDOMAIN** | presence







   |
8 | sr-1490285288-12551-1 |  0 | 
/xcap-root/rls-services/users/sip:org1a-contacts@**MYDOMAIN**/index   |0 |


Is there a reference doc somewhere with an example of a successful SUBSCRIBE 
and associated XCAP docs for a resource-list?

Thanks

Paul___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users