[sr-dev] git:master:ad552d4e: pua: test call-id value before inserting in db

Daniel-Constantin Mierla miconda at gmail.com
Tue Nov 3 16:18:45 CET 2015


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2015-11-03T16:18:36+01:00

pua: test call-id value before inserting in db

- reported by GH#345

---

Modified: modules/pua/pua.c

---

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

---

diff --git a/modules/pua/pua.c b/modules/pua/pua.c
index 06b3077..44eb709 100644
--- a/modules/pua/pua.c
+++ b/modules/pua/pua.c
@@ -1099,7 +1099,14 @@ static void db_update(unsigned int ticks,void *param)
 						q_vals[puri_col].val.str_val = *(p->pres_uri);
 						q_vals[pid_col].val.str_val = p->id;
 						q_vals[flag_col].val.int_val = p->flag;
-						q_vals[callid_col].val.str_val = p->call_id;
+						if(p->call_id.s) {
+							LM_DBG("p->callid = %.*s\n", p->call_id.len, p->call_id.s);
+							q_vals[callid_col].val.str_val = p->call_id;
+						} else {
+							LM_DBG("p->callid is empty\n");
+							q_vals[callid_col].val.str_val.s = "";
+							q_vals[callid_col].val.str_val.len = 0;
+						}
 						q_vals[fromtag_col].val.str_val = p->from_tag;
 						q_vals[cseq_col].val.int_val= p->cseq;
 						q_vals[expires_col].val.int_val = p->expires;




More information about the sr-dev mailing list