Browse Source

modules_k/pua: Fixed some dialog output levels

pd 13 years ago
parent
commit
2780fa7451
2 changed files with 10 additions and 7 deletions
  1. 9 6
      modules_k/pua/pua_db.c
  2. 1 1
      modules_k/pua/pua_db.h

+ 9 - 6
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("No rows found.\n");
+		LM_DBG("No rows found.\n");
 		return(-1);
 	}
 
 	if (nr_rows != 1)
 	{
-		LM_ERR("Too many rows found (%d)\n", nr_rows);
-		return(-1);
+		LM_WARN("Too many rows found (%d)\n", 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("called with NULL param\n");
-		return;
+		return(-1);
 	}
 
 	if (pres->pres_uri)
@@ -1599,13 +1599,16 @@ void insert_puadb(ua_pres_t* pres)
 	if(pua_db == NULL)
 	{
 		LM_ERR("null database connection\n");
-		return;
+		return(-1);
 	}
 
 	if(pua_dbf.insert(pua_db, db_cols, db_vals, n_cols) < 0)  
 	{
 		LM_ERR("DB insert failed\n");
+		return(-1);
 	}
+
+	return(0);
 }
 
 /******************************************************************************/

+ 1 - 1
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