[sr-dev] git:master:9ad96c08: pv_headers: fix removal of all values when using PV_IDX_ALL

Victor Seva linuxmaniac at torreviejawireless.org
Fri Jul 23 17:11:31 CEST 2021


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

Author: Victor Seva <vseva at sipwise.com>
Committer: Victor Seva <linuxmaniac at torreviejawireless.org>
Date: 2021-07-23T17:11:03+02:00

pv_headers: fix removal of all values when using PV_IDX_ALL

$(x_hdr(whatever)[*]) = "hello" was just removing the first value

---

Modified: src/modules/pv_headers/pvh_xavp.c

---

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

---

diff --git a/src/modules/pv_headers/pvh_xavp.c b/src/modules/pv_headers/pvh_xavp.c
index 7cba757456..96fdc292b0 100644
--- a/src/modules/pv_headers/pvh_xavp.c
+++ b/src/modules/pv_headers/pvh_xavp.c
@@ -618,7 +618,7 @@ int pvh_set_header(
 
 	if(val == NULL || (val->flags & PV_VAL_NULL)) {
 		if(idxf == PV_IDX_ALL) {
-			cnt = xavi_rm_by_name(hname, 1, &xavi);
+			cnt = xavi_rm_by_name(hname, 1, &avi);
 			LM_DBG("removed %d values of %.*s=>%.*s, set $null\n", cnt,
 					xavi->name.len, xavi->name.s, hname->len, hname->s);
 			if(pvh_set_xavi(msg, &xavi_name, hname, NULL, SR_XTYPE_NULL, 0, 0)
@@ -649,7 +649,7 @@ int pvh_set_header(
 				goto err;
 		} else if(idxf == PV_IDX_ALL) {
 			if(hname_cnt > 1) {
-				cnt = xavi_rm_by_name(hname, 1, &xavi);
+				cnt = xavi_rm_by_name(hname, 1, &avi);
 				LM_DBG("removed %d values of %.*s=>%.*s\n", cnt, xavi->name.len,
 						xavi->name.s, hname->len, hname->s);
 			}




More information about the sr-dev mailing list