[SR-Users] service uri not found in rls-services document
Juha Heinanen
jh at tutpro.com
Wed May 1 21:34:43 CEST 2013
Juha Heinanen writes:
> it clearly shows that the reason for not finding the uri are the escaped
> chars in xcap rls-services doc.
i stole some code from opensips and normalized the rls-services uri.
after that, the match was found:
May 1 22:15:45 siika /usr/sbin/pres-serv[29546]: INFO: rls [subscribe.c:213]: searching document for user sip:jh at test.tutpro.com
May 1 22:15:45 siika /usr/sbin/pres-serv[29546]: INFO: rls [subscribe.c:298]: rls_services document:#012<?xml version='1.0' encoding='UTF-8'?>#012<rls-services xmlns="urn:ietf:params:xml:ns:rls-services"><service uri="sip%3Ajh%2Bpresence%40test.tutpro.com"><resource-list>http%3A//192.98.102.10%3A8080/xcap-root/resource-lists/users/sip%3Ajh%40test.tutpro.com/index/%7E%7E/resource-lists/list%5B%40name%3D%22sipsimple_presence_rls%22%5D</resource-list><packages><package>presence</package></packages></service><service uri="sip%3Ajh%2Bdialog%40test.tutpro.com"><resource-list>http%3A//192.98.102.10%3A8080/xcap-root/resource-lists/users/sip%3Ajh%40test.tutpro.com/index/%7E%7E/resource-lists/list%5B%40name%3D%22sipsimple_dialog_rls%22%5D</resource-list><packages><package>dialog</package></packages></service></rls-services>
May 1 22:15:45 siika /usr/sbin/pres-serv[29546]: INFO: rls [subscribe.c:149]: comparing xcap doc uri <sip:jh+presence at test.tutpro.com> to uri <sip:jh+presence at test.tutpro.com>
May 1 22:15:45 siika /usr/sbin/pres-serv[29546]: INFO: rls [subscribe.c:154]: uris matched
that, however, didn't get me much further. next i got error:
May 1 22:15:45 siika /usr/sbin/pres-serv[29546]: ERROR: rls [notify.c:1171]: resource list 'http%3A//192.98.102.10%3A8080/xcap-root/resource-lists/users/sip%3Ajh%40test.tutpro.com/index/%7E%7E/resource-lists/list%5B%40name%3D%22sipsimple_presence_rls%22%5D' is unidentifiable
the reason this time is escaped http uri, because uri scheme comparison does
not take into account escaped : char. in rls/notify.c:
#define HTTP_PREFIX "http://"
#define HTTP_PREFIX_LEN 7
...
if(strncmp(uri, HTTP_PREFIX, HTTP_PREFIX_LEN) == 0)
looks like there is lots of work to be done on rls module before these
things are sorted out.
-- juha
More information about the sr-users
mailing list