Module: kamailio
Branch: master
Commit: d3e0674c97ad9df80dd995269674e09728558db2
URL:
https://github.com/kamailio/kamailio/commit/d3e0674c97ad9df80dd995269674e09…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2016-01-25T23:16:38+01:00
pua: if from_tag is not set, use empty string for db val
- sqlite connector doesn't like null pointer for not null costraint
- reported by GH #345
---
Modified: modules/pua/pua.c
---
Diff:
https://github.com/kamailio/kamailio/commit/d3e0674c97ad9df80dd995269674e09…
Patch:
https://github.com/kamailio/kamailio/commit/d3e0674c97ad9df80dd995269674e09…
---
diff --git a/modules/pua/pua.c b/modules/pua/pua.c
index 44eb709..181ef93 100644
--- a/modules/pua/pua.c
+++ b/modules/pua/pua.c
@@ -1107,7 +1107,13 @@ static void db_update(unsigned int ticks,void *param)
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;
+ if( p->from_tag.s) {
+ q_vals[fromtag_col].val.str_val = p->from_tag;
+ } else {
+ LM_DBG("p->from_tag is empty\n");
+ q_vals[fromtag_col].val.str_val.s = "";
+ q_vals[fromtag_col].val.str_val.len = 0;
+ }
q_vals[cseq_col].val.int_val= p->cseq;
q_vals[expires_col].val.int_val = p->expires;
q_vals[desired_expires_col].val.int_val = p->desired_expires;