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

Author: Victor Seva <vs...@sipwise.com>
Committer: Victor Seva <linuxman...@torreviejawireless.org>
Date: 2021-07-23T17:11:45+02:00

pv_headers: fix removal of all values when using PV_IDX_ALL

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

(cherry picked from commit 9ad96c08e0deb759297b2d402295691d8dd657d5)

---

Modified: src/modules/pv_headers/pvh_xavp.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/e18c24b88403e61461feace3b13fa59f948f1082.diff
Patch: 
https://github.com/kamailio/kamailio/commit/e18c24b88403e61461feace3b13fa59f948f1082.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);
                        }


_______________________________________________
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to