Module: kamailio
Branch: master
Commit: d29930e2af84431abf112f1182f92defe6efee01
URL:
https://github.com/kamailio/kamailio/commit/d29930e2af84431abf112f1182f92de…
Author: Jon Bergli Heier <jon.bergli.heier(a)zisson.no>
Committer: Jon Bergli Heier <jon.bergli.heier(a)zisson.no>
Date: 2015-05-07T16:02:44+02:00
pv: Fixed assigning $null to $vn(name) pvs
Pass NULL as value to set_var_value when assigning a NULL or
PV_VAL_NULL value to a pv with the VAR_TYPE_NULL flag set.
---
Modified: modules/pv/pv_core.c
---
Diff:
https://github.com/kamailio/kamailio/commit/d29930e2af84431abf112f1182f92de…
Patch:
https://github.com/kamailio/kamailio/commit/d29930e2af84431abf112f1182f92de…
---
diff --git a/modules/pv/pv_core.c b/modules/pv/pv_core.c
index a4eab9a..9cbad39 100644
--- a/modules/pv/pv_core.c
+++ b/modules/pv/pv_core.c
@@ -1968,8 +1968,13 @@ int pv_set_scriptvar(struct sip_msg* msg, pv_param_t *param,
}
if((val==NULL) || (val->flags&PV_VAL_NULL))
{
- avp_val.n = 0;
- set_var_value((script_var_t*)param->pvn.u.dname, &avp_val, 0);
+ if(((script_var_t*)param->pvn.u.dname)->v.flags&VAR_TYPE_NULL)
+ {
+ set_var_value((script_var_t*)param->pvn.u.dname, NULL, 0);
+ } else {
+ avp_val.n = 0;
+ set_var_value((script_var_t*)param->pvn.u.dname, &avp_val, 0);
+ }
return 0;
}
flags = 0;