<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hi Peter,<br>
    <br>
    I found the source of the problem. For the case when publish with
    expires 0 is received, the order of operations has changed:<br>
    <br>
    Now the delete in database is performed before sending the Notifies,
    and before it was the other way around. We had to perform the delete
    first, to find out if the record actually existed and if we need to
    send a Notify.<br>
    <br>
    And actually the code relies on finding the record in database even
    for unPublish. The main reason is that it wants to build a pidf with
    status closed from the previous published state - to keep the same
    tuple id. I don't know if there are actually clients interpreting
    the tuple id (which should identify a certain device), but it was
    designed like this to be safe.<br>
    <br>
    For this reason, we will have to give up on using affected_rows on
    delete and do the query each time. We will do the fix tomorrow.<br>
    <br>
    Regards,<br>
    Anca<br>
    <br>
    <br>
    On 03/13/2012 05:40 PM, Peter Dunkley wrote:
    <blockquote cite="mid:1331653248.2830.54.camel@pd-laptop-linux"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="GENERATOR" content="GtkHTML/4.2.3">
      Hi Anca,<br>
      <br>
      I just tried this change on my system.  With the change present
      and two presence/RLS clients signed in I get some error messages
      displayed when I log one of the clients out:<br>
      <blockquote> Mar 13 15:36:09 pd-laptop-linux ./kamailio[1493]:
        ERROR: presence_xml [notify_body.c:176]: while parsing the xml
        body message<br>
        Mar 13 15:36:09 pd-laptop-linux ./kamailio[1493]: ERROR:
        presence_xml [notify_body.c:133]: in function
        get_final_notify_body<br>
        Mar 13 15:36:09 pd-laptop-linux ./kamailio[1493]: ERROR:
        presence [notify.c:1396]: in function apply_auth_nbody<br>
        Mar 13 15:36:09 pd-laptop-linux ./kamailio[1493]: ERROR:
        presence [notify.c:1583]: sending Notify not successful<br>
        Mar 13 15:36:09 pd-laptop-linux ./kamailio[1493]: ERROR:
        presence [notify.c:1288]: Could not send notify for presence<br>
      </blockquote>
      I reversed out the change and the errors stopped happening, they
      started up again as soon as I put it back.<br>
      <br>
      Thanks,<br>
      <br>
      Peter<br>
      <br>
      On Tue, 2012-03-13 at 10:40 +0100, Anca Vamanu wrote:
      <blockquote type="CITE">
        <pre>Module: sip-router
Branch: master
Commit: 42f2d990d022cb67b051ac563ee8cde916a0d14a
URL:    <a moz-do-not-send="true" href="http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=42f2d990d022cb67b051ac563ee8cde916a0d14a">http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=42f2d990d022cb67b051ac563ee8cde916a0d14a</a>

Author: Dragos Dinu &lt;<a moz-do-not-send="true" href="mailto:dragos.dinu@1and1.ro">dragos.dinu@1and1.ro</a>&gt;
Committer: Anca Vamanu &lt;<a moz-do-not-send="true" href="mailto:anca.vamanu@1and1.ro">anca.vamanu@1and1.ro</a>&gt;
Date:   Tue Mar 13 11:33:06 2012 +0200

modules_k/presence Used affected_rows SQL statement

In case affected_rows function is available in the DB driver, this
function is used instead of an extra query in presentity table that only
verified if the record existed.

Patch author Dragos Dinu &lt;<a moz-do-not-send="true" href="mailto:dragos.dinu@1and1.ro">dragos.dinu@1and1.ro</a>&gt;

---

 modules_k/presence/presentity.c |  436 ++++++++++++++++++++++----------------
 1 files changed, 252 insertions(+), 184 deletions(-)

Diff:   <a moz-do-not-send="true" href="http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=42f2d990d022cb67b051ac563ee8cde916a0d14a">http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=42f2d990d022cb67b051ac563ee8cde916a0d14a</a>

_______________________________________________
sr-dev mailing list
<a moz-do-not-send="true" href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a>
<a moz-do-not-send="true" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a>
</pre>
      </blockquote>
      <br>
      <table cellpadding="0" cellspacing="0" width="100%">
        <tbody>
          <tr>
            <td>
              <pre>-- 
Peter Dunkley
Technical Director
Crocodile RCS Ltd
</pre>
            </td>
          </tr>
        </tbody>
      </table>
    </blockquote>
    <br>
  </body>
</html>