[SR-Users] Problem with xpath updates of XCAP documents
Peter Dunkley
peter.dunkley at crocodile-rcs.com
Thu Apr 5 12:55:50 CEST 2012
Hi,
The full log helped me see what is going on. Rather embarassingly it is
a Linux command line or curl error. This command:
curl --digest -u 111:111 -T pidf_modify.xml -H "Content-Type:
application/xcap-el+xml" -X PUT
http://192.168.0.130:5060/xcap-root/pidf-manipulation/users/sip:111@multifon.ru/index~~/presence/tuple%5b@id='x8eg92n'%5d/note
doesn't work, but this command:
curl --digest -u 111:111 -T pidf_modify.xml -H "Content-Type:
application/xcap-el+xml" -X PUT
http://192.168.0.130:5060/xcap-root/pidf-manipulation/users/sip:111@multifon.ru/index~~/presence/tuple%5b@id=\'x8eg92n\'%5d/note
does.
Something was removing the ' characters from the URL.
Thanks,
Peter
On Wed, 2012-04-04 at 20:15 +0200, Daniel-Constantin Mierla wrote:
> Hello,
>
> can you give the full log of such operation with debug=3? It may help
> seeing the values used internally for matching...
>
> Otherwise, if it is a valid xpath condition and no match, then could
> be something to libxml2 implementation.
>
> Cheers,
> Daniel
>
> On 4/4/12 7:01 PM, Peter Dunkley wrote:
>
> > Hi,
> >
> > I tried a simplified update URL with curl: curl --digest -u 111:111
> > -T pidf_modify.xml -H "Content-Type: application/xcap-el+xml" -X PUT
> > http://192.168.0.130:5060/xcap-root/pidf-manipulation/users/sip:111@mydomain/index~~/presence/tuple/note
> >
> > This "correctly" updated the <note/> nodes in both <tuple/> nodes of
> > the document. So, the problem with the XCAP server appears to be
> > over the %5b at id='x8eg92n'%5d that is used to identify a specific
> > <tuple/> node. I believe, from searching online, that this is valid
> > XPath syntax, so it does look like there is a bug here.
> >
> > Any idea?
> >
> > Thanks,
> >
> > Peter
> >
> > On Wed, 2012-04-04 at 17:19 +0100, Peter Dunkley wrote:
> >
> > > Hi,
> > >
> > > I have been experimenting with uploading, and modifying existing,
> > > XCAP documents. I have been trying out the example from RFC 4827
> > > and I can't get it to work with Kamailio.
> > >
> > > To upload the document (this works) I use the command: curl
> > > --digest -u 111:111 -T pidf.xml -X PUT
> > > http://192.168.0.130:5060/xcap-root/pidf-manipulation/users/sip:111@mydomain/index
> > >
> > > To modify the document (this doesn't work) I use the command: curl
> > > --digest -u 111:111 -T pidf_modify.xml -H "Content-Type:
> > > application/xcap-el+xml" -X PUT
> > > http://192.168.0.130:5060/xcap-root/pidf-manipulation/users/sip:111@mydomain/index~~/presence/tuple%5b@id='x8eg92n'%5d/note
> > >
> > > When I try to modify the document I get the error: "Apr 4
> > > 17:12:08 pd-laptop-linux kamailio[16862]: ERROR: xcap_server
> > > [xcap_server.c:596]: no new content"
> > >
> > > I went through the XCAP server code and added some debug and found
> > > that the check on xcap_misc.c:491 is succeeding (which means "no
> > > selection for xpath parent expression") and the document is not
> > > being changed. Also, from my limited understanding of XPath and
> > > libxml2, I would have expected the code path which should have
> > > been followed to go through the else clause of the conditional on
> > > xcap_misc.c:468 - which means I don't think that the
> > > xcaps_xpath_set() function is doing the right thing at all.
> > >
> > > Is there anyone here that is more familiar with libxml2 that can
> > > give me any pointers here. As far as I can tell the XCAP server
> > > code looks OK to me, and I believe the documents (attached) and my
> > > XCAP queries are correct as well.
> > >
> > > Thanks,
> > >
> > > Peter
> > >
> > > _______________________________________________
> > > SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> > > sr-users at lists.sip-router.org
> > > http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
> > >
> >
> > --
> > Peter Dunkley
> > Technical Director
> > Crocodile RCS Ltd
> >
> >
> >
> > _______________________________________________
> > SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> > sr-users at lists.sip-router.org
> > http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
>
> --
> Daniel-Constantin Mierla
> Kamailio Advanced Training, April 23-26, 2012, Berlin, Germany
> http://www.asipto.com/index.php/kamailio-advanced-training/
--
Peter Dunkley
Technical Director
Crocodile RCS Ltd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20120405/00bbfafc/attachment-0001.htm>
More information about the sr-users
mailing list