Module: kamailio Branch: master Commit: 908ca872bec956d5f755a1b51df781bf66ad3866 URL: https://github.com/kamailio/kamailio/commit/908ca872bec956d5f755a1b51df781bf...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2021-11-14T10:31:38+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
---
Modified: src/modules/acc/acc.c
---
Diff: https://github.com/kamailio/kamailio/commit/908ca872bec956d5f755a1b51df781bf... Patch: https://github.com/kamailio/kamailio/commit/908ca872bec956d5f755a1b51df781bf...
---
diff --git a/src/modules/acc/acc.c b/src/modules/acc/acc.c index b75e155743..dce7ee0a8b 100644 --- a/src/modules/acc/acc.c +++ b/src/modules/acc/acc.c @@ -466,7 +466,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\n", i); + 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]; } } @@ -502,6 +504,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]; } }