[sr-dev] git:master:3843ae18: usrloc: log database table if use_table() fails

Daniel-Constantin Mierla miconda at gmail.com
Mon Feb 24 10:33:22 CET 2020


Module: kamailio
Branch: master
Commit: 3843ae18599bfc1806ccb62df44bbc8ad41d60dd
URL: https://github.com/kamailio/kamailio/commit/3843ae18599bfc1806ccb62df44bbc8ad41d60dd

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2020-02-24T10:32:17+01:00

usrloc: log database table if use_table() fails

---

Modified: src/modules/usrloc/ucontact.c

---

Diff:  https://github.com/kamailio/kamailio/commit/3843ae18599bfc1806ccb62df44bbc8ad41d60dd.diff
Patch: https://github.com/kamailio/kamailio/commit/3843ae18599bfc1806ccb62df44bbc8ad41d60dd.patch

---

diff --git a/src/modules/usrloc/ucontact.c b/src/modules/usrloc/ucontact.c
index c95cbb0dd7..8c65063784 100644
--- a/src/modules/usrloc/ucontact.c
+++ b/src/modules/usrloc/ucontact.c
@@ -666,7 +666,13 @@ int db_insert_ucontact(ucontact_t* _c)
 	}
 
 	if (ul_dbf.use_table(ul_dbh, _c->domain) < 0) {
-		LM_ERR("sql use_table failed\n");
+		if(_c->domain) {
+			LM_ERR("sql use_table failed for: %.*s\n",
+					(_c->domain->s)?_c->domain->len:0,
+					(_c->domain->s)?_c->domain->s:"");
+		} else {
+			LM_ERR("sql use_table failed - null\n");
+		}
 		return -1;
 	}
 




More information about the sr-dev mailing list