[sr-dev] git:5.5:471dea49: acc: set again the type of db vals

Daniel-Constantin Mierla miconda at gmail.com
Mon Nov 22 09:14:10 CET 2021


Module: kamailio
Branch: 5.5
Commit: 471dea4941f044e4a1489bf6f1dbb7297341a3fb
URL: https://github.com/kamailio/kamailio/commit/471dea4941f044e4a1489bf6f1dbb7297341a3fb

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2021-11-22T09:12:23+01:00

acc: set again the type of db vals

- work properly when nullable modparam is set and var can be null on
some transactions

(cherry picked from commit 908ca872bec956d5f755a1b51df781bf66ad3866)

---

Modified: src/modules/acc/acc.c

---

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

---

diff --git a/src/modules/acc/acc.c b/src/modules/acc/acc.c
index b95275853d..196aba5c7e 100644
--- a/src/modules/acc/acc.c
+++ b/src/modules/acc/acc.c
@@ -464,6 +464,9 @@ int acc_db_request( struct sip_msg *rq)
 			LM_DBG("attr[%d] is NULL\n", i);
 			VAL_NULL(db_vals + i) = 1;
 		} else {
+			LM_DBG("attr[%d] is STR len=%d\n", i, val_arr[i].len);
+			VAL_NULL(db_vals+i) = 0;
+			VAL_TYPE(db_vals+i)=DB1_STR;
 			VAL_STR(db_vals+i) = val_arr[i];
 		}
 	}
@@ -499,6 +502,8 @@ int acc_db_request( struct sip_msg *rq)
 			if (acc_extra_nullable == 1 && type_arr[i] == TYPE_NULL) {
 					VAL_NULL(db_vals + i) = 1;
 				} else {
+					VAL_NULL(db_vals+i) = 0;
+					VAL_TYPE(db_vals+i)=DB1_STR;
 					VAL_STR(db_vals+i)=val_arr[i];
 				}
 			}




More information about the sr-dev mailing list