<!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>
    You were right. I am sorry, I have not tested with DB_ONLY mode,
    only with this mode the problem showed up.<br>
    I have committed the fix now.<br>
    <br>
    Regards,<br>
    Anca<br>
    <br>
    <br>
    On 03/16/2012 01:15 PM, Peter Dunkley wrote:
    <blockquote cite="mid:1331896536.3074.9.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,<br>
      <br>
      Another, more likely, possibility is that somewhere after the
      first use_table and query on presentity but before the delete
      there is a function called that queries active_watchers (to find
      out what dialogs to send NOTIFYs on).<br>
      <br>
      Peter<br>
      <br>
      On Fri, 2012-03-16 at 10:46 +0000, Peter Dunkley wrote:<br>
      <blockquote type="CITE"> Hi Anca,<br>
        <br>
        I am now seeing a different problem with unPUBLISH.  When I
        unPUBLISH I get the errors:<br>
        <blockquote> Mar 16 10:20:44 pd-laptop-linux kamailio[20117]:
          ERROR: db_postgres [km_dbase.c:493]: invalid query, execution
          aborted<br>
          Mar 16 10:20:44 pd-laptop-linux kamailio[20117]: ERROR:
          db_postgres [km_dbase.c:494]: driver error: PGRES_FATAL_ERROR,
          ERROR:  column "domain" does not exist#012LINE 1: delete from
          active_watchers where domain='multifon.ru' AND
          u...#012                                          ^#012<br>
          Mar 16 10:20:44 pd-laptop-linux kamailio[20117]: WARNING:
          db_postgres [km_dbase.c:565]: unexpected result returned<br>
        </blockquote>
        <br>
        As a test I put a use_table call at the top of the
        presentity.c:update_presentity() function but that made no
        difference.  I then explicitly added use_table() calls before
        each DB operation in presentity.c:update_presentity() and the
        problem went away.  I don't have time to look into it further
        but I suspect this means there is some issue related how
        Kamailio pools the DB connections meaning that (because this is
        a long function with lots of queries) some other query (in this
        case on active_watchers) happens on the connection in between
        the queries in this function.<br>
        <br>
        If that is what is happening than it makes the calls to
        affected_rows() used in this function a bit suspect as well. 
        affected_rows() returns the rows affected by the last DB
        operation, and it looks like it is entirely possible that this
        last operation may not always be one that is in the same
        function.<br>
        <br>
        Regards,<br>
        <br>
        Peter<br>
        <br>
        On Thu, 2012-03-15 at 18:52 +0200, Anca Vamanu wrote:
        <blockquote type="CITE">
          <pre>Hi Peter,

I have fixed the issue with the unPublish.

I have did another commit in the code : changed the sql query at delete 
in active_watchers to use the callid,to_tag,from_tag unique key.

I also realised that for DB_ONLY mode an index on presentity_uri column 
is need, so I updated the database schema.

Let us know the results of the performance tests.

Regards,
Anca


</pre>
        </blockquote>
        <br>
        <table cellpadding="0" cellspacing="0" width="100%">
          <tbody>
            <tr>
              <td>
                <pre>_______________________________________________
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>
              </td>
            </tr>
          </tbody>
        </table>
      </blockquote>
      <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>