<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello Laura,<br>
    <br>
    thanks for testing and further patching. I just committed on master
    branch. Are you working with 3.1? Just to see how fast to plan the
    backports.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    On 9/8/11 3:22 PM, laura testi wrote:
    <blockquote
cite="mid:CAHFjjJNr4ubjf_B5PV6V2hpSASZ==AYc0YB72Zci1OvGfzvY=A@mail.gmail.com"
      type="cite">
      <pre wrap="">Hi,
we have tested the patch, it does not work. We have done some minor
changes. Now it works.

Here are the diff:

diff -u xcap_misc.c  xcap_misc.c_patch
--- xcap_misc.c       2011-09-08 14:23:37.000000000 +0200
+++ xcap_misc.c_patch 2011-09-08 14:29:24.000000000 +0200
@@ -465,7 +465,7 @@
                goto error;
        }
     nodes = xpathObj-&gt;nodesetval;
-       if(nodes==NULL)
+       if(nodes==NULL || nodes-&gt;nodeNr==0 || nodes-&gt;nodeTab == NULL)
        {
                /* no selection for xpath expression */
                LM_DBG("no selection for xpath expression [%s]\n", xpaths-&gt;s);
@@ -488,7 +488,7 @@
                }
                *p = '/';
                nodes = xpathObj-&gt;nodesetval;
-               if(nodes==NULL)
+               if(nodes==NULL || nodes-&gt;nodeNr==0 || nodes-&gt;nodeTab == NULL)
                {
                        LM_DBG("no selection for xpath parent
expression [%s]\n",
                                        xpaths-&gt;s);



Please see the patch file in the attachment.

Thanks  again

Best Regards,
Laura

On Wed, Sep 7, 2011 at 10:12 PM, Daniel-Constantin Mierla
<a class="moz-txt-link-rfc2396E" href="mailto:miconda@gmail.com">&lt;miconda@gmail.com&gt;</a> wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">Hello,

inserting a new node seems not to be possible through xpath operations only,
so I made a patch to be able to add new nodes (entries) -- see it attached
-- it is for devel version (master branch), hopefully it applies clean to
3.1 if you are using that version.

There was no option to test it at all, I just made sure it compiles. Let me
know the results, if it runs but fails, send me the output with debug=4. If
all is ok, I will commit to git repository.

Cheers,
Daniel

On 9/7/11 3:21 PM, laura testi wrote:
</pre>
        <blockquote type="cite">
          <pre wrap="">
Hi,
we have patch the xcap_misc.h with "#define XCAP_MAX_URI_SIZE &nbsp; 255"
which was 127, and extended the length of field doc_uri in the xcap
table to 256 from 128. Now the errror is gone.

After that we have done some test with curl, following are the results:
- DELETE an Entry from the list: OK
&nbsp; i.e.: curl &nbsp;-X DELETE

<a class="moz-txt-link-freetext" href="http://">http://</a>&lt;ip&gt;:5060/xcap-root/resource-lists/users/<a class="moz-txt-link-freetext" href="sip:user@domain/index/~~/resource-lists/list/entry%5b@uri=%22sip:u1@d1%22%5d">sip:user@domain/index/~~/resource-lists/list/entry%5b@uri=%22sip:u1@d1%22%5d</a>
&nbsp;after this command, the contact u1@d1 is removed from the contact list.

- UPDATE an Entry from the list: OK
&nbsp;i.e.,
curl -T entry.xml -X PUT

<a class="moz-txt-link-freetext" href="http://">http://</a>&lt;ip&gt;:5060/xcap-root/resource-lists/users/<a class="moz-txt-link-freetext" href="sip:user@domain/index/~~/resource-lists/list%5b@name=%22RootGroup%22%5d/entry%5b@uri=%22sip:u2@d2%22%5d">sip:user@domain/index/~~/resource-lists/list%5b@name=%22RootGroup%22%5d/entry%5b@uri=%22sip:u2@d2%22%5d</a>

if the <a class="moz-txt-link-freetext" href="sip:u2@d2">sip:u2@d2</a> entry exists, the entry is replaced with the entry in
the entry.xml (&lt;entry
uri=<a class="moz-txt-link-rfc2396E" href="sip:u3@d3">"sip:u3@d3"</a>&gt;&lt;display-name&gt;u3&lt;/display-name&gt;&lt;/entry&gt;), which is
<a class="moz-txt-link-freetext" href="sip:u3@d3">sip:u3@d3</a>

if the <a class="moz-txt-link-freetext" href="sip:u2@d2">sip:u2@d2</a> entry is not exists, the entry of u3@d3 is not added
to the list!!! follow the rfc4825, it should be added to the list if
the entry does not exits.

- Add an Entry from the list: KO
&nbsp;i.e.,
curl -T entry.xml -X PUT

<a class="moz-txt-link-freetext" href="http://">http://</a>&lt;ip&gt;:5060/xcap-root/resource-lists/users/<a class="moz-txt-link-freetext" href="sip:user@domain/index/~~/resource-lists/list%5b@name=%22RootGroup%22%5d/entry%5b@uri=%22sip:u2@d2%22%5d">sip:user@domain/index/~~/resource-lists/list%5b@name=%22RootGroup%22%5d/entry%5b@uri=%22sip:u2@d2%22%5d</a>

&nbsp;the entry.xml is (&lt;entry
uri=<a class="moz-txt-link-rfc2396E" href="sip:u2@d2">"sip:u2@d2"</a>&gt;&lt;display-name&gt;u2&lt;/display-name&gt;&lt;/entry&gt;)

&nbsp;the entry <a class="moz-txt-link-freetext" href="sip:u2@d2">sip:u2@d2</a> was not in the list before the command and is not
added after the command.

I think it's a bug of xcap server.


Many thanks!

Laura




On Wed, Sep 7, 2011 at 12:17 PM, Juha Heinanen<a class="moz-txt-link-rfc2396E" href="mailto:jh@tutpro.com">&lt;jh@tutpro.com&gt;</a> &nbsp;wrote:
</pre>
          <blockquote type="cite">
            <pre wrap="">
Daniel-Constantin Mierla writes:

</pre>
            <blockquote type="cite">
              <pre wrap="">Feel free to do it, however I think it has to be reviewed where is used,
though -- it should be safe even size in db is longer as long as the
insert is done by kamailio itself, not sure we have affected cases when
the insert is done by external apps, so better double check...
</pre>
            </blockquote>
            <pre wrap="">
every module that reads data from db should check size of received
string so that it is not longer than space reserved for it in data
structures. i hope that no module assumes that received data cannot be
bigger than what db schema says.

-- juha

</pre>
          </blockquote>
          <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
        </blockquote>
        <pre wrap="">
--
Daniel-Constantin Mierla -- <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
Kamailio Advanced Training, Oct 10-13, Berlin: <a class="moz-txt-link-freetext" href="http://asipto.com/u/kat">http://asipto.com/u/kat</a>
<a class="moz-txt-link-freetext" href="http://linkedin.com/in/miconda">http://linkedin.com/in/miconda</a> -- <a class="moz-txt-link-freetext" href="http://twitter.com/miconda">http://twitter.com/miconda</a>

</pre>
      </blockquote>
      <pre wrap="">&gt;</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a></pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
Kamailio Advanced Training, Oct 10-13, Berlin: <a class="moz-txt-link-freetext" href="http://asipto.com/u/kat">http://asipto.com/u/kat</a>
<a class="moz-txt-link-freetext" href="http://linkedin.com/in/miconda">http://linkedin.com/in/miconda</a> -- <a class="moz-txt-link-freetext" href="http://twitter.com/miconda">http://twitter.com/miconda</a></pre>
  </body>
</html>