<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/4.2.2">
</HEAD>
<BODY>
Sorry, typo.&nbsp; That should have been diagnostic levels.<BR>
<BR>
Peter<BR>
On Thu, 2011-12-08 at 23:08 +0100, Peter Dunkley wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Module: sip-router
Branch: master
Commit: 2780fa74515612a3698a73b81d76c8ddd8a39fe4
URL:    <A HREF="http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=2780fa74515612a3698a73b81d76c8ddd8a39fe4">http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=2780fa74515612a3698a73b81d76c8ddd8a39fe4</A>

Author: pd &lt;<A HREF="mailto:peter.dunkley@crocodile-rcs.com">peter.dunkley@crocodile-rcs.com</A>&gt;
Committer: pd &lt;<A HREF="mailto:peter.dunkley@crocodile-rcs.com">peter.dunkley@crocodile-rcs.com</A>&gt;
Date:   Thu Dec  8 21:55:35 2011 +0000

modules_k/pua: Fixed some dialog output levels

---

 modules_k/pua/pua_db.c |   15 +++++++++------
 modules_k/pua/pua_db.h |    2 +-
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/modules_k/pua/pua_db.c b/modules_k/pua/pua_db.c
index b753217..e81cf3f 100644
--- a/modules_k/pua/pua_db.c
+++ b/modules_k/pua/pua_db.c
@@ -739,14 +739,14 @@ int is_dialog_puadb(ua_pres_t *pres)
         if (nr_rows == 0)
         {
                 /* no match */ 
-                LM_ERR(&quot;No rows found.\n&quot;);
+                LM_DBG(&quot;No rows found.\n&quot;);
                 return(-1);
         }
 
         if (nr_rows != 1)
         {
-                LM_ERR(&quot;Too many rows found (%d)\n&quot;, nr_rows);
-                return(-1);
+                LM_WARN(&quot;Too many rows found (%d)\n&quot;, nr_rows);
+                /* no need to return here - drop thro */
         }
 
         return(0);
@@ -1430,7 +1430,7 @@ void update_puadb(ua_pres_t* pres, time_t desired_expires,
 
 /******************************************************************************/
 
-void insert_puadb(ua_pres_t* pres)
+int insert_puadb(ua_pres_t* pres)
 
 {
         db_key_t db_cols[20];
@@ -1440,7 +1440,7 @@ void insert_puadb(ua_pres_t* pres)
         if (pres==NULL)
         {
                 LM_ERR(&quot;called with NULL param\n&quot;);
-                return;
+                return(-1);
         }
 
         if (pres-&gt;pres_uri)
@@ -1599,13 +1599,16 @@ void insert_puadb(ua_pres_t* pres)
         if(pua_db == NULL)
         {
                 LM_ERR(&quot;null database connection\n&quot;);
-                return;
+                return(-1);
         }
 
         if(pua_dbf.insert(pua_db, db_cols, db_vals, n_cols) &lt; 0)  
         {
                 LM_ERR(&quot;DB insert failed\n&quot;);
+                return(-1);
         }
+
+        return(0);
 }
 
 /******************************************************************************/
diff --git a/modules_k/pua/pua_db.h b/modules_k/pua/pua_db.h
index fb2793d..7466511 100644
--- a/modules_k/pua/pua_db.h
+++ b/modules_k/pua/pua_db.h
@@ -58,7 +58,7 @@ int update_version_puadb(ua_pres_t *pres, int version );
 int update_contact_puadb(ua_pres_t *pres, str *contact);
 void update_puadb(ua_pres_t* pres, time_t desired_expires, 
                        int expires, str* etag, str *contact);
-void insert_puadb(ua_pres_t* pres);
+int insert_puadb(ua_pres_t* pres);
 

 #endif


_______________________________________________
sr-dev mailing list
<A HREF="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</A>
<A 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 CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<PRE>
-- 
Peter Dunkley
Technical Director
Crocodile RCS Ltd
</PRE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>