Module: kamailio
Branch: master
Commit: d8f0e71a0497e0bb98be60452914df51c84b56d8
URL:
https://github.com/kamailio/kamailio/commit/d8f0e71a0497e0bb98be60452914df5…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2021-12-22T11:19:19+01:00
pv_headers: restore pvh_real_hdr_del_by_name()
it was wrongly removed at 09981c41cb6685fa18f61b9e7d66339917c4f097
---
Modified: src/modules/pv_headers/pvh_hdr.c
---
Diff:
https://github.com/kamailio/kamailio/commit/d8f0e71a0497e0bb98be60452914df5…
Patch:
https://github.com/kamailio/kamailio/commit/d8f0e71a0497e0bb98be60452914df5…
---
diff --git a/src/modules/pv_headers/pvh_hdr.c b/src/modules/pv_headers/pvh_hdr.c
index 31c09b4b5d..fbb471ccd5 100644
--- a/src/modules/pv_headers/pvh_hdr.c
+++ b/src/modules/pv_headers/pvh_hdr.c
@@ -131,6 +131,21 @@ int pvh_real_hdr_append(struct sip_msg *msg, str *hname, str
*hvalue)
return 1;
}
+int pvh_real_hdr_del_by_name(struct sip_msg *msg, str *hname)
+{
+ hdr_field_t *hf = NULL;
+
+ for(hf = msg->headers; hf; hf = hf->next) {
+ if(hf->name.len == hname->len
+ && strncasecmp(hf->name.s, hname->s, hname->len) == 0) {
+ LM_DBG("remove header[%.*s]: %.*s\n", hf->name.len, hf->name.s,
+ hf->body.len, hf->body.s);
+ del_lump(msg, hf->name.s - msg->buf, hf->len, 0);
+ }
+ }
+ return 1;
+}
+
int pvh_real_hdr_remove_display(struct sip_msg *msg, str *hname)
{
hdr_field_t *hf = NULL;