Dear list,
we are running Kamailio 3.2 together with the included OpenXcap server.
I try to retrieve only part of a certain resource list using XPath, but the server always returns the full list, see example below. I was so far not able to retrieve only part of a resource list, independent of the XPath expression I'm using.
Do I make something wrong or is this a bug?
Thanks and regards,
Fabian
fubeh@orion:~$ curl --digest -u test4:XXXX http://192.168.1.134:5060/xcap-root/resource-lists/users/sip:test4@192.168.1... <?xml version="1.0"?> <resource-lists xmlns="urn:ietf:params:xml:ns:resource-lists"> <list name="Business"> <entry uri="sip:test1@192.168.1.134"> <display-name>Test 1</display-name> </entry> <entry uri="sip:test122@192.168.1.134"> <display-name>Test 1</display-name> </entry> </list> <list name="Family"> <entry uri="sip:test2@192.168.1.134"> <display-name>Test 2</display-name> </entry> <entry uri="sip:test222@192.168.1.134"> <display-name>Test 2</display-name> </entry> </list> <list name="Friends"> <entry uri="sip:test3@192.168.1.134"> <display-name>Test 3</display-name> </entry> <entry uri="sip:test322@192.168.1.134"> <display-name>Test 3</display-name> </entry> </list> <list name="Blocked" /> </resource-lists>
Hello,
On 4/25/12 2:04 PM, Fabian Bernhard wrote:
Dear list,
we are running Kamailio 3.2 together with the included OpenXcap server.
by the "included openxcap" server do you mean the xcap_server module?
* http://kamailio.org/docs/modules/stable/modules_k/xcap_server.html
I try to retrieve only part of a certain resource list using XPath, but the server always returns the full list, see example below. I was so far not able to retrieve only part of a resource list, independent of the XPath expression I'm using.
Do I make something wrong or is this a bug?
Can you try with the master branch (which is upcoming 3.3.0, development being frozen already and we are in testing phase for it)? Just to be sure it is not a feature we added afterwards - I cannot look right now in the sources.
Cheers, Daniel
Thanks and regards,
Fabian
fubeh@orion:~$ curl --digest -u test4:XXXX http://192.168.1.134:5060/xcap-root/resource-lists/users/sip:test4@192.168.1... http://192.168.1.134:5060/xcap-root/resource-lists/users/sip:test4@192.168.1.134/index/%7E%7E/resource-lists/list%5b@name=Family%5d
<?xml version="1.0"?>
<resource-lists xmlns="urn:ietf:params:xml:ns:resource-lists"> <list name="Business"> <entry uri="sip:test1@192.168.1.134 <mailto:sip%3Atest1@192.168.1.134>"> <display-name>Test 1</display-name> </entry> <entry uri="sip:test122@192.168.1.134 <mailto:sip%3Atest122@192.168.1.134>"> <display-name>Test 1</display-name> </entry> </list> <list name="Family"> <entry uri="sip:test2@192.168.1.134 <mailto:sip%3Atest2@192.168.1.134>"> <display-name>Test 2</display-name> </entry> <entry uri="sip:test222@192.168.1.134 <mailto:sip%3Atest222@192.168.1.134>"> <display-name>Test 2</display-name> </entry> </list> <list name="Friends"> <entry uri="sip:test3@192.168.1.134 <mailto:sip%3Atest3@192.168.1.134>"> <display-name>Test 3</display-name> </entry> <entry uri="sip:test322@192.168.1.134 <mailto:sip%3Atest322@192.168.1.134>"> <display-name>Test 3</display-name> </entry> </list> <list name="Blocked" /> </resource-lists>
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
Hi Daniel
we are running Kamailio 3.2 together with the included OpenXcap server.
by the "included openxcap" server do you mean the xcap_server module?
* http://kamailio.org/docs/modules/stable/modules_k/xcap_server.html
Yes
Can you try with the master branch (which is upcoming 3.3.0, development being frozen already and we are in testing phase for it)? Just to be sure it is not a feature we added afterwards - I cannot look right now in the sources.
The issue still exists in 3.3.0: The function "w_xcaps_get()" in xcap_server.c actually never evaluates an XPath expression.
There is a function "xcaps_xpath_get()" in xcap_misc.c which is afaik not used within Kamailio. To resolve my issue I have - to the best of my knowledge - fixed that function and included a call to it in "w_xcaps_get()", see attached diff.
Best regards
Fabian
Hello,
On 4/29/12 12:02 PM, Fabian Bernhard wrote:
Hi Daniel
we are running Kamailio 3.2 together with the included OpenXcap server.
by the "included openxcap" server do you mean the xcap_server module?
Yes
Can you try with the master branch (which is upcoming 3.3.0, development being frozen already and we are in testing phase for it)? Just to be sure it is not a feature we added afterwards - I cannot look right now in the sources.
The issue still exists in 3.3.0: The function "w_xcaps_get()" in xcap_server.c actually never evaluates an XPath expression.
There is a function "xcaps_xpath_get()" in xcap_misc.c which is afaik not used within Kamailio. To resolve my issue I have - to the best of my knowledge - fixed that function and included a call to it in "w_xcaps_get()", see attached diff.
can you details a bit the changes you done to xcaps_xpath_get()? IIRC, it may be there as a generic function to get xpath nodes, but your patch removes lot of its content.
Can you send the full new xcaps_xpath_get() function here? Cannot apply the patch for the moment to check the result, but I see at some point the output buffer len is set to 1, which is a bit strange, I would say by now.
Once all aspects of the patch will be clarified and all is fine, it will be applied.
Cheers, Daniel
Hi Daniel
we are running Kamailio 3.2 together with the included OpenXcap server.
by the "included openxcap" server do you mean the xcap_server module?
* http://kamailio.org/docs/modules/stable/modules_k/xcap_server.html
Yes
Can you try with the master branch (which is upcoming 3.3.0, development being frozen already and we are in testing phase for it)? Just to be sure it is not a feature we added afterwards - I cannot look right now in the sources.
The issue still exists in 3.3.0: The function "w_xcaps_get()" in xcap_server.c actually never evaluates an XPath expression.
There is a function "xcaps_xpath_get()" in xcap_misc.c which is afaik not used within Kamailio. To resolve my issue I have - to the best of my knowledge - fixed that function and included a call to it in "w_xcaps_get()", see attached diff.
can you details a bit the changes you done to xcaps_xpath_get()? IIRC, it may be there as a generic function to get xpath nodes, but your patch removes lot of its content.
I have removed too much, indeed.
Please find attached a new patch that resolves my initial issue without any changes to xcaps_xpath_get(). I don't fully understand why xcaps_xpath_hack() is needed, but its done so in other parts of the xcap_server code too, so I assume that there is a good reason for it.
The following in the patch might look suspicious:
xcaps_xpath_get(&body, &xuri.node, &body)
I'd say its ok because xcaps_xpath_get() does not read the input buffer (first argument) after it started to write into the output buffer (last argument).
Also attached, as requested, the full code of both functions involved.
Hope this helps!
Best regards
Fabian