TT#180100 update debian changelog

* refresh patches
* remove already applied patches

Change-Id: I16f7163dc5da46dadfefb3a343727e51020bff3b
mr9.5.6
Victor Seva 4 years ago
parent 3d095b202c
commit ed771f717c

8
debian/changelog vendored

@ -1,3 +1,11 @@
ngcp-kamailio (5.5.4-1+0~mr9.5.6.0) unstable; urgency=medium
* New upstream version 5.5.3
* New upstream version 5.5.4
* TT#180100 update debian changelog
-- Victor Seva <vseva@debian.org> Tue, 07 Jun 2022 14:04:15 +0200
ngcp-kamailio (5.5.1-1+0~mr9.5.6.0) unstable; urgency=medium
[ Victor Seva ]

@ -7,7 +7,7 @@ Subject: fix_export
1 file changed, 2 insertions(+)
diff --git a/src/Makefile b/src/Makefile
index 23a5235..14cc0d7 100644
index 40def34..3c8dcda 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -139,6 +139,8 @@ endif

@ -7,7 +7,7 @@ Subject: no_INSTALL_file
1 file changed, 2 deletions(-)
diff --git a/src/Makefile b/src/Makefile
index 11be15f..23a5235 100644
index a6380c2..40def34 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -861,8 +861,6 @@ install-modules-all: install-every-module install-every-module-doc

@ -7,7 +7,7 @@ Subject: no_lib64_on_64_bits
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/src/Makefile.defs b/src/Makefile.defs
index 18afd9c..f47160e 100644
index 5fdc880..4833e85 100644
--- a/src/Makefile.defs
+++ b/src/Makefile.defs
@@ -454,15 +454,7 @@ endif

@ -32,19 +32,13 @@ sipwise/sca-debug.patch
sipwise/sca-fix-notify-after-bye.patch
sipwise/sca-add-pai_avp-parameter.patch
## upstream 5.5
upstream/db_redis-don-t-leave-unconsumed-redis-replies-in-cas.patch
upstream/pv-headers-remove_specific_header_value.patch
# https://github.com/kamailio/kamailio/pull/979
# collides with our changes to pua_dialoginfo
sipwise/Revert-pua_dialoginfo-disable-publish-notifications-.patch
upstream/core-ip-addr-use-POSIX-INET6_ADDRSTRLEN-and-INET_ADD.patch
## upstream master
upstream/pv_headers-fix-removal-of-all-values-on-when-using-P.patch
upstream/pv_headers-pvh_set_header-remove-values-to-set-null-.patch
upstream/pv_headers-don-t-try-to-replace-header.patch
upstream/permissions-don-t-remove-old-data-at-the-end-of-the-.patch
upstream/permissions-trusted_cleanup_interval.patch
upstream/nathelper-fix_nated_sdp-added-ignoring-RFC3605-param.patch
### relevant for upstream
sipwise/pua_dialoginfo-refresh_pubruri_avps_flag.patch
sipwise/pua_dialoginfo-local_identity_dlg_var.patch
@ -54,19 +48,19 @@ sipwise/pua_dialoginfo_uuid.patch
sipwise/dialplan-don-t-stop-loading-rules-on-error.patch
sipwise/cfgt-skip-tm-vars-T_.patch
sipwise/cfgt-skip.patch
sipwise/cfgt-improve-detection-of-dynamic-format.patch
sipwise/cfgt-fix-memory-leaks.patch
sipwise/cfgt-skip_unknown.patch
sipwise/topos-don-t-insert-contact-header-for-4xx-replies.patch
sipwise/db_redis_skip_empty_keys.patch
sipwise/db_redis_graceful_scan.patch
sipwise/db_redis_sscan.patch
sipwise/db_redis_sscan_fix_empty_key.patch
sipwise/db_redis-clean-previous-connection-before-trying-to-.patch
sipwise/kamctl-TMPDIR-config.patch
sipwise/pv_headers-fix-build-warning.patch
### active development
sipwise/lcr-stopper_mode-parameter.patch
sipwise/db_redis-clean-previous-connection-before-trying-to-.patch
sipwise/pv_headers-fix-build-warning.patch
sipwise/cfgt-improve-detection-of-dynamic-format.patch
sipwise/cfgt-fix-memory-leaks.patch
sipwise/cfgt-skip_unknown.patch
#
### Don't just put stuff in any order
### use gbp pq import/export tooling to help maintain patches

@ -7,7 +7,7 @@ Subject: db_redis_graceful_scan
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/src/modules/db_redis/redis_dbase.c b/src/modules/db_redis/redis_dbase.c
index 1b0c72e..d088b89 100644
index 68d8412..c82f82b 100644
--- a/src/modules/db_redis/redis_dbase.c
+++ b/src/modules/db_redis/redis_dbase.c
@@ -754,7 +754,7 @@ static int db_redis_scan_query_keys_pattern(km_redis_con_t *con, const str *matc

@ -7,7 +7,7 @@ Subject: db_redis_skip_empty_keys
1 file changed, 3 insertions(+)
diff --git a/src/modules/db_redis/redis_dbase.c b/src/modules/db_redis/redis_dbase.c
index c9a25ad..1b0c72e 100644
index ac1bd2b..68d8412 100644
--- a/src/modules/db_redis/redis_dbase.c
+++ b/src/modules/db_redis/redis_dbase.c
@@ -641,6 +641,9 @@ static int db_redis_build_query_keys(km_redis_con_t *con, const str *table_name,

@ -7,7 +7,7 @@ Subject: db_redis_sscan
1 file changed, 65 insertions(+), 21 deletions(-)
diff --git a/src/modules/db_redis/redis_dbase.c b/src/modules/db_redis/redis_dbase.c
index d088b89..11188c4 100644
index c82f82b..dd11ad5 100644
--- a/src/modules/db_redis/redis_dbase.c
+++ b/src/modules/db_redis/redis_dbase.c
@@ -591,7 +591,7 @@ err:
@ -174,7 +174,7 @@ index d088b89..11188c4 100644
LM_ERR("failed to scan query keys\n");
goto error;
}
@@ -2298,6 +2327,7 @@ int db_redis_query(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _op,
@@ -2300,6 +2329,7 @@ int db_redis_query(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _op,
int do_table_scan = 0;
uint64_t ts_scan_start = 0;
str ts_scan_key = {0,};
@ -182,7 +182,7 @@ index d088b89..11188c4 100644
redis_key_t *keys = NULL;
int keys_count = 0;
@@ -2369,7 +2399,7 @@ int db_redis_query(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _op,
@@ -2371,7 +2401,7 @@ int db_redis_query(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _op,
if (_n > 0) {
if (db_redis_build_query_keys(con, CON_TABLE(_h), _k, _v, query_ops, _n,
&keys, &keys_count, &manual_keys, &manual_keys_count, &do_table_scan, &ts_scan_start,
@ -191,7 +191,7 @@ index d088b89..11188c4 100644
LM_ERR("failed to build query keys\n");
goto error;
}
@@ -2387,7 +2417,7 @@ int db_redis_query(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _op,
@@ -2389,7 +2419,7 @@ int db_redis_query(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _op,
}
if (db_redis_perform_query(_h, con, _k, _v, query_ops, _c, _n, _nc, _r,
@ -200,7 +200,7 @@ index d088b89..11188c4 100644
goto error;
}
@@ -2403,6 +2433,8 @@ int db_redis_query(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _op,
@@ -2405,6 +2435,8 @@ int db_redis_query(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _op,
}
if (ts_scan_key.s)
pkg_free(ts_scan_key.s);
@ -209,7 +209,7 @@ index d088b89..11188c4 100644
db_redis_consume_replies(con);
return 0;
@@ -2418,6 +2450,8 @@ error:
@@ -2420,6 +2452,8 @@ error:
}
if (ts_scan_key.s)
pkg_free(ts_scan_key.s);
@ -218,7 +218,7 @@ index d088b89..11188c4 100644
db_redis_consume_replies(con);
@@ -2603,6 +2637,7 @@ int db_redis_delete(const db1_con_t* _h, const db_key_t* _k,
@@ -2605,6 +2639,7 @@ int db_redis_delete(const db1_con_t* _h, const db_key_t* _k,
int do_table_scan = 0;
uint64_t ts_scan_start = 0;
str ts_scan_key = {0,};
@ -226,7 +226,7 @@ index d088b89..11188c4 100644
db_op_t *query_ops = NULL;
int i;
@@ -2648,7 +2683,7 @@ int db_redis_delete(const db1_con_t* _h, const db_key_t* _k,
@@ -2650,7 +2685,7 @@ int db_redis_delete(const db1_con_t* _h, const db_key_t* _k,
if (_n > 0) {
if (db_redis_build_query_keys(con, CON_TABLE(_h), _k, _v, query_ops, _n,
&keys, &keys_count, &manual_keys, &manual_keys_count, &do_table_scan, &ts_scan_start,
@ -235,7 +235,7 @@ index d088b89..11188c4 100644
LM_ERR("failed to build query keys\n");
goto error;
}
@@ -2666,7 +2701,7 @@ int db_redis_delete(const db1_con_t* _h, const db_key_t* _k,
@@ -2668,7 +2703,7 @@ int db_redis_delete(const db1_con_t* _h, const db_key_t* _k,
}
if (db_redis_perform_delete(_h, con, _k, _v, query_ops, _n,
@ -244,7 +244,7 @@ index d088b89..11188c4 100644
goto error;
}
@@ -2680,6 +2715,8 @@ int db_redis_delete(const db1_con_t* _h, const db_key_t* _k,
@@ -2682,6 +2717,8 @@ int db_redis_delete(const db1_con_t* _h, const db_key_t* _k,
pkg_free(manual_keys);
if (ts_scan_key.s)
pkg_free(ts_scan_key.s);
@ -253,7 +253,7 @@ index d088b89..11188c4 100644
db_redis_consume_replies(con);
return 0;
@@ -2694,6 +2731,8 @@ error:
@@ -2696,6 +2733,8 @@ error:
pkg_free(manual_keys);
if (ts_scan_key.s)
pkg_free(ts_scan_key.s);
@ -262,7 +262,7 @@ index d088b89..11188c4 100644
db_redis_consume_replies(con);
return -1;
}
@@ -2718,6 +2757,7 @@ int db_redis_update(const db1_con_t* _h, const db_key_t* _k,
@@ -2720,6 +2759,7 @@ int db_redis_update(const db1_con_t* _h, const db_key_t* _k,
int do_table_scan = 0;
uint64_t ts_scan_start = 0;
str ts_scan_key = {0,};
@ -270,7 +270,7 @@ index d088b89..11188c4 100644
redis_key_t *keys = NULL;
int keys_count = 0;
@@ -2768,7 +2808,7 @@ int db_redis_update(const db1_con_t* _h, const db_key_t* _k,
@@ -2770,7 +2810,7 @@ int db_redis_update(const db1_con_t* _h, const db_key_t* _k,
if (_n > 0) {
if (db_redis_build_query_keys(con, CON_TABLE(_h), _k, _v, query_ops, _n,
&keys, &keys_count, &manual_keys, &manual_keys_count, &do_table_scan, &ts_scan_start,
@ -279,7 +279,7 @@ index d088b89..11188c4 100644
LM_ERR("failed to build query keys\n");
goto error;
}
@@ -2785,7 +2825,7 @@ int db_redis_update(const db1_con_t* _h, const db_key_t* _k,
@@ -2787,7 +2827,7 @@ int db_redis_update(const db1_con_t* _h, const db_key_t* _k,
}
if (db_redis_perform_update(_h, con, _k, _v, query_ops, _uk, _uv, _n, _nu,
@ -288,7 +288,7 @@ index d088b89..11188c4 100644
goto error;
}
@@ -2801,6 +2841,8 @@ int db_redis_update(const db1_con_t* _h, const db_key_t* _k,
@@ -2803,6 +2843,8 @@ int db_redis_update(const db1_con_t* _h, const db_key_t* _k,
}
if (ts_scan_key.s)
pkg_free(ts_scan_key.s);
@ -297,7 +297,7 @@ index d088b89..11188c4 100644
db_redis_consume_replies(con);
return 0;
@@ -2815,6 +2857,8 @@ error:
@@ -2817,6 +2859,8 @@ error:
}
if (ts_scan_key.s)
pkg_free(ts_scan_key.s);

@ -7,7 +7,7 @@ Subject: db_redis_sscan_fix_empty_key
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/modules/db_redis/redis_dbase.c b/src/modules/db_redis/redis_dbase.c
index 11188c4..5258d57 100644
index dd11ad5..ffe6ad7 100644
--- a/src/modules/db_redis/redis_dbase.c
+++ b/src/modules/db_redis/redis_dbase.c
@@ -784,7 +784,7 @@ static int db_redis_scan_query_keys_pattern(km_redis_con_t *con, const str *matc

@ -8,7 +8,7 @@ Subject: do-not-install-default-config
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/Makefile b/src/Makefile
index 14cc0d7..0e37b95 100644
index 3c8dcda..7a8a402 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -652,7 +652,7 @@ sunpkg:

@ -10,7 +10,7 @@ but will sort them first before stopping
2 files changed, 40 insertions(+), 3 deletions(-)
diff --git a/src/modules/lcr/lcr_mod.c b/src/modules/lcr/lcr_mod.c
index 579ec06..0565044 100644
index d24f952..0bf6827 100644
--- a/src/modules/lcr/lcr_mod.c
+++ b/src/modules/lcr/lcr_mod.c
@@ -205,6 +205,10 @@ static unsigned int priority_ordering_param = 0;

@ -8,7 +8,7 @@ Subject: usrloc_dbro
2 files changed, 67 insertions(+)
diff --git a/src/modules/usrloc/usrloc_mod.c b/src/modules/usrloc/usrloc_mod.c
index 733c16a..de06cfb 100644
index db8bfbe..729fb6a7 100644
--- a/src/modules/usrloc/usrloc_mod.c
+++ b/src/modules/usrloc/usrloc_mod.c
@@ -167,6 +167,7 @@ str ulattrs_avalue_col = str_init(ULATTRS_AVALUE_COL); /*!< Name of column conta

@ -1,47 +0,0 @@
From 680d98caccc0216f43c2b5de83935dbc4853ab9d Mon Sep 17 00:00:00 2001
From: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Fri, 13 Aug 2021 08:57:10 +0200
Subject: [PATCH] core: ip addr - use POSIX INET6_ADDRSTRLEN and
INET_ADDRSTRLEN to define sizes
- set the values of IP4_MAX_STR_SIZE and IP6_MAX_STR_SIZE based on them,
if defined, or to 15 and 45
- cope with IPv6 with IPv4 tunneling representation (RFC 4291 section 2.2)
- cover the requirements of using inet_ntop()
- GH #2823
(cherry picked from commit 22a72f3a7725d56f00e22bdc52d44bd53da7c091)
---
src/core/ip_addr.h | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/core/ip_addr.h b/src/core/ip_addr.h
index 546c822423..132f653255 100644
--- a/src/core/ip_addr.h
+++ b/src/core/ip_addr.h
@@ -510,8 +510,20 @@ int hostent2su(union sockaddr_union* su,
/* maximum size of a str returned by ip_addr2str */
-#define IP6_MAX_STR_SIZE 39 /*1234:5678:9012:3456:7890:1234:5678:9012*/
-#define IP4_MAX_STR_SIZE 15 /*123.456.789.012*/
+/* POSIX INET6_ADDRSTRLEN (RFC 4291 section 2.2) - IPv6 with IPv4 tunneling
+ * (39): 1234:5678:9012:3456:7890:1234:5678:9012
+ * (45): ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255 */
+#ifdef INET6_ADDRSTRLEN
+#define IP6_MAX_STR_SIZE (INET6_ADDRSTRLEN-1)
+#else
+#define IP6_MAX_STR_SIZE 45
+#endif
+/*123.456.789.123*/
+#ifdef INET_ADDRSTRLEN
+#define IP4_MAX_STR_SIZE (INET_ADDRSTRLEN-1)
+#else
+#define IP4_MAX_STR_SIZE 15
+#endif
/* converts a raw ipv6 addr (16 bytes) to ascii */
int ip6tosbuf(unsigned char* ip6, char* buff, int len);
--
2.25.1

@ -1,34 +0,0 @@
From: Andrii Pogrebennyk <andrii@ng-voice.com>
Date: Sun, 28 Nov 2021 08:34:36 +0100
Subject: db_redis: don't leave unconsumed redis replies in case of error on
update
Execute db_redis_consume_replies on failed update same as in db_redis_insert:
if db_redis_perform_update encounters an error it was leaving unconsumed data
thus causing unexpected reply later on when reading from the same connection.
(cherry picked from commit bbd7b2ed5827252680e9d8949c193699da0a76b2)
---
src/modules/db_redis/redis_dbase.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/modules/db_redis/redis_dbase.c b/src/modules/db_redis/redis_dbase.c
index 5258d57..ffe6ad7 100644
--- a/src/modules/db_redis/redis_dbase.c
+++ b/src/modules/db_redis/redis_dbase.c
@@ -2292,6 +2292,7 @@ static int db_redis_perform_update(const db1_con_t* _h, km_redis_con_t *con, con
db_redis_key_free(&all_type_keys);
db_redis_key_free(&new_type_keys);
+ db_redis_consume_replies(con);
return 0;
error:
@@ -2303,6 +2304,7 @@ error:
db_redis_key_free(&type_keys);
db_redis_key_free(&set_keys);
db_redis_key_free(&new_type_keys);
+ db_redis_consume_replies(con);
return -1;
}

@ -1,112 +0,0 @@
From: Dmitry Wagin <dmitry.wagin@ya.ru>
Date: Tue, 15 Jun 2021 15:58:12 +0300
Subject: nathelper: fix_nated_sdp added ignoring RFC3605-param if omitted
- doesn't throw an error while "a=rtcp" param is omitted (RFC1889 behavior) or address is omitted
- replace_sdp_ip() returns 0 on omitted IP-address
- added param can_omit to replace_sdp_ip()
---
src/modules/nathelper/nathelper.c | 37 ++++++++++++++++++-------------------
1 file changed, 18 insertions(+), 19 deletions(-)
diff --git a/src/modules/nathelper/nathelper.c b/src/modules/nathelper/nathelper.c
index 1392a0a..9e45a61 100644
--- a/src/modules/nathelper/nathelper.c
+++ b/src/modules/nathelper/nathelper.c
@@ -1609,13 +1609,12 @@ static int is_rfc1918_f(struct sip_msg *msg, char *str1, char *str2)
#define AOLDMEDPRT_LEN (sizeof(AOLDMEDPRT) - 1)
-/* replace ip addresses in SDP and return umber of replacements */
+/* replace ip addresses in SDP and return number of replacements */
static inline int replace_sdp_ip(
- struct sip_msg *msg, str *org_body, char *line, str *ip, int linelen)
+ struct sip_msg *msg, str *org_body, char *line, str *ip, int linelen, int can_omit)
{
str body1, oldip, newip;
str body = *org_body;
- unsigned hasreplaced = 0;
int pf, pf1 = 0;
str body2;
char *bodylimit = body.s + body.len;
@@ -1631,10 +1630,17 @@ static inline int replace_sdp_ip(
}
body1 = body;
for(;;) {
- if(nh_extract_mediaip(&body1, &oldip, &pf, line, linelen) == -1)
+ ret = nh_extract_mediaip(&body1, &oldip, &pf, line, linelen);
+ if(ret == 0)
break;
- if(pf != AF_INET) {
- LM_ERR("not an IPv4 address in '%s' SDP\n", line);
+ if(ret == -1) {
+ if(can_omit) {
+ body2.s = body1.s + linelen;
+ body2.len = bodylimit - body2.s;
+ body1 = body2;
+ continue;
+ }
+ LM_ERR("no `IP[4|6]' in `%s' field\n", line);
return -1;
}
if(!pf1)
@@ -1652,13 +1658,8 @@ static inline int replace_sdp_ip(
return -1;
}
count += ret;
- hasreplaced = 1;
body1 = body2;
}
- if(!hasreplaced && linelen>=6 && memcmp("a=rtcp", line, 6)!=0) {
- LM_ERR("can't extract '%s' IP from the SDP\n", line);
- return -1;
- }
return count;
}
@@ -1737,15 +1738,14 @@ static int ki_fix_nated_sdp_ip(sip_msg_t *msg, int level, str *ip)
if(level & (FIX_MEDIP | FIX_ORGIP)) {
/* Iterate all a=rtcp and replace ips in them. rfc3605 */
- ret = replace_sdp_ip(msg, &body, "a=rtcp", (ip && ip->len>0) ? ip : 0, 6);
+ ret = replace_sdp_ip(msg, &body, "a=rtcp", (ip && ip->len>0) ? ip : 0, 6, 1);
if(ret == -1)
- LM_DBG("a=rtcp parameter does not exist. nothing to do.\n");
- else
- count += ret;
+ return -1;
+ count += ret;
if(level & FIX_MEDIP) {
/* Iterate all c= and replace ips in them. */
- ret = replace_sdp_ip(msg, &body, "c=", (ip && ip->len>0) ? ip : 0, 2);
+ ret = replace_sdp_ip(msg, &body, "c=", (ip && ip->len>0) ? ip : 0, 2, 0);
if(ret == -1)
return -1;
count += ret;
@@ -1753,7 +1753,7 @@ static int ki_fix_nated_sdp_ip(sip_msg_t *msg, int level, str *ip)
if(level & FIX_ORGIP) {
/* Iterate all o= and replace ips in them. */
- ret = replace_sdp_ip(msg, &body, "o=", (ip && ip->len>0) ? ip : 0, 2);
+ ret = replace_sdp_ip(msg, &body, "o=", (ip && ip->len>0) ? ip : 0, 2, 0);
if(ret == -1)
return -1;
count += ret;
@@ -1800,7 +1800,7 @@ static int nh_extract_mediaip(str *body, str *mediaip, int *pf, char *line,
cp = cp1 + linelen;
}
if(cp1 == NULL)
- return -1;
+ return 0;
mediaip->s = cp1 + linelen;
mediaip->len =
@@ -1835,7 +1835,6 @@ static int nh_extract_mediaip(str *body, str *mediaip, int *pf, char *line,
cp = eat_space_end(cp + len, mediaip->s + mediaip->len);
}
if(nextisip != 2 || mediaip->len == 0) {
- LM_ERR("no `IP[4|6]' in `%s' field\n", line);
return -1;
}
return 1;

@ -1,4 +1,3 @@
From 7a3f71e7ce6b63fe1c32853c30d785bc9c1f2236 Mon Sep 17 00:00:00 2001
From: Fabricio Santolin da Silva
<fabricio.santolin-da-silva@al-enterprise.com>
Date: Wed, 30 Mar 2022 16:42:41 +0200
@ -9,15 +8,15 @@ Subject: [PATCH] pv_headers: Add support to remove a specific value from a
- pvh_header_param_exists() check if the value is present to a given header
- pvh_remove_header_param() remove the value from the given header or the entire header if no other value is present
---
src/modules/pv_headers/doc/functions.xml | 35 +++++++-
src/modules/pv_headers/doc/functions.xml | 35 ++++++++++-
src/modules/pv_headers/doc/pv_headers.xml | 6 ++
src/modules/pv_headers/pv_headers.c | 61 ++++++++++++++
src/modules/pv_headers/pvh_func.c | 97 +++++++++++++++++++++++
src/modules/pv_headers/pv_headers.c | 61 +++++++++++++++++++
src/modules/pv_headers/pvh_func.c | 97 +++++++++++++++++++++++++++++++
src/modules/pv_headers/pvh_func.h | 2 +
5 files changed, 200 insertions(+), 1 deletion(-)
diff --git a/src/modules/pv_headers/doc/functions.xml b/src/modules/pv_headers/doc/functions.xml
index ef7f133779..e0d38d47ea 100644
index ef7f133..e0d38d4 100644
--- a/src/modules/pv_headers/doc/functions.xml
+++ b/src/modules/pv_headers/doc/functions.xml
@@ -11,7 +11,7 @@
@ -68,7 +67,7 @@ index ef7f133779..e0d38d47ea 100644
+ </section>
+</section>
diff --git a/src/modules/pv_headers/doc/pv_headers.xml b/src/modules/pv_headers/doc/pv_headers.xml
index a5211b9288..47d40e1ae9 100644
index a5211b9..47d40e1 100644
--- a/src/modules/pv_headers/doc/pv_headers.xml
+++ b/src/modules/pv_headers/doc/pv_headers.xml
@@ -26,6 +26,12 @@
@ -85,7 +84,7 @@ index a5211b9288..47d40e1ae9 100644
<copyright>
<year>2018</year>
diff --git a/src/modules/pv_headers/pv_headers.c b/src/modules/pv_headers/pv_headers.c
index 6dfac3d18b..be43bb29f4 100644
index 6dfac3d..be43bb2 100644
--- a/src/modules/pv_headers/pv_headers.c
+++ b/src/modules/pv_headers/pv_headers.c
@@ -205,6 +205,53 @@ static int w_pvh_remove_header(
@ -171,7 +170,7 @@ index 6dfac3d18b..be43bb29f4 100644
};
/* clang-format on */
diff --git a/src/modules/pv_headers/pvh_func.c b/src/modules/pv_headers/pvh_func.c
index 01a7d3d211..4ca72d217d 100644
index 01a7d3d..4ca72d2 100644
--- a/src/modules/pv_headers/pvh_func.c
+++ b/src/modules/pv_headers/pvh_func.c
@@ -357,3 +357,100 @@ int pvh_remove_header(struct sip_msg *msg, str *hname, int indx)
@ -276,7 +275,7 @@ index 01a7d3d211..4ca72d217d 100644
+ return ret;
+}
diff --git a/src/modules/pv_headers/pvh_func.h b/src/modules/pv_headers/pvh_func.h
index 6aaf5aa9f5..a4e0bfad3e 100644
index 6aaf5aa..a4e0bfa 100644
--- a/src/modules/pv_headers/pvh_func.h
+++ b/src/modules/pv_headers/pvh_func.h
@@ -38,5 +38,7 @@ int pvh_check_header(struct sip_msg *msg, str *hname);

@ -1,110 +0,0 @@
From: Victor Seva <vseva@sipwise.com>
Date: Thu, 28 Oct 2021 15:54:39 +0200
Subject: pv_headers: don't try to replace header
Multiple headers where not removed if new value was just one header
---
src/modules/pv_headers/pvh_func.c | 6 ----
src/modules/pv_headers/pvh_hdr.c | 59 ---------------------------------------
src/modules/pv_headers/pvh_hdr.h | 1 -
3 files changed, 66 deletions(-)
diff --git a/src/modules/pv_headers/pvh_func.c b/src/modules/pv_headers/pvh_func.c
index 7afc39d..01a7d3d 100644
--- a/src/modules/pv_headers/pvh_func.c
+++ b/src/modules/pv_headers/pvh_func.c
@@ -276,12 +276,6 @@ int pvh_apply_headers(struct sip_msg *msg)
}
if(!str_hash_case_get(&rm_hdrs, sub->name.s, sub->name.len)) {
- if(!pvh_avp_is_null(sub) && xavi_count(&sub->name, &sub) == 1) {
- LM_DBG("replace header[%s]: %s\n", sub->name.s, sub->val.v.s.s);
- pvh_real_hdr_replace(msg, &sub->name, &sub->val.v.s);
- pvh_str_hash_add_key(&rm_hdrs, &sub->name);
- continue;
- }
LM_DBG("remove header[%s]: %s\n", sub->name.s, sub->val.v.s.s);
pvh_real_hdr_del_by_name(msg, &sub->name);
pvh_str_hash_add_key(&rm_hdrs, &sub->name);
diff --git a/src/modules/pv_headers/pvh_hdr.c b/src/modules/pv_headers/pvh_hdr.c
index d83a646..fbb471c 100644
--- a/src/modules/pv_headers/pvh_hdr.c
+++ b/src/modules/pv_headers/pvh_hdr.c
@@ -131,65 +131,6 @@ int pvh_real_hdr_append(struct sip_msg *msg, str *hname, str *hvalue)
return 1;
}
-int pvh_real_hdr_replace(struct sip_msg *msg, str *hname, str *hvalue)
-{
- struct lump *anchor = NULL;
- hdr_field_t *hf = NULL;
- str new_h = STR_NULL;
- int new = 1;
-
- if(hname->s == NULL || hvalue->s == NULL) {
- LM_ERR("header name/value cannot be empty");
- return -1;
- }
-
- for(hf = msg->headers; hf; hf = hf->next) {
- if(hf->name.len == hname->len
- && strncasecmp(hf->name.s, hname->s, hname->len) == 0) {
- if(hf->body.len == hvalue->len
- && strncasecmp(hf->body.s, hvalue->s, hvalue->len) == 0) {
- return 1;
- }
- new = 0;
- break;
- }
- if(!hf->next)
- break;
- }
-
- if(hf == NULL) {
- LM_ERR("unable to find header lump\n");
- return -1;
- }
-
- if(new == 0) {
- if((anchor = del_lump(msg, hf->name.s - msg->buf, hf->len, 0)) == 0) {
- LM_ERR("unable to delete header lump\n");
- return -1;
- }
- } else {
- anchor = anchor_lump(msg, hf->name.s + hf->len - msg->buf, 0, 0);
- }
-
- if(anchor == 0) {
- LM_ERR("unable to find header lump\n");
- return -1;
- }
-
- if(pvh_create_hdr_str(hname, hvalue, &new_h) <= 0)
- return -1;
-
- if(insert_new_lump_after(anchor, new_h.s, new_h.len, 0) == 0) {
- LM_ERR("cannot insert header lump\n");
- pkg_free(new_h.s);
- return -1;
- }
-
- LM_DBG("%s header: %.*s\n", new ? "append" : "replace", new_h.len, new_h.s);
-
- return 1;
-}
-
int pvh_real_hdr_del_by_name(struct sip_msg *msg, str *hname)
{
hdr_field_t *hf = NULL;
diff --git a/src/modules/pv_headers/pvh_hdr.h b/src/modules/pv_headers/pvh_hdr.h
index 4f86953..a5ad415 100644
--- a/src/modules/pv_headers/pvh_hdr.h
+++ b/src/modules/pv_headers/pvh_hdr.h
@@ -38,7 +38,6 @@ void pvh_hdrs_set_applied(struct sip_msg *msg);
void pvh_hdrs_reset_flags(struct sip_msg *msg);
int pvh_real_hdr_append(struct sip_msg *msg, str *hname, str *hvalue);
-int pvh_real_hdr_replace(struct sip_msg *msg, str *hname, str *hvalue);
int pvh_real_hdr_del_by_name(struct sip_msg *msg, str *hname);
int pvh_real_hdr_remove_display(struct sip_msg *msg, str *hname);
int pvh_real_replace_reply_reason(struct sip_msg *msg, str *value);

@ -1,35 +0,0 @@
From: Victor Seva <vseva@sipwise.com>
Date: Fri, 23 Jul 2021 15:56:11 +0200
Subject: pv_headers: fix removal of all values on when using PV_IDX_ALL
$(x_hdr(whatever)[*]) = "hello" was just removing the first value
Change-Id: Icc170673aef64e335ef82d940b6b85c940dbde55
Change-Id: I3614396eccbbf616b1c53f8511c2a7b42e8ef2df
---
src/modules/pv_headers/pvh_xavp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/modules/pv_headers/pvh_xavp.c b/src/modules/pv_headers/pvh_xavp.c
index 7cba757..96fdc29 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);
}

@ -1,42 +0,0 @@
From af926514ac3e70dff51408baf326b29bce4eecfc Mon Sep 17 00:00:00 2001
From: Victor Seva <linuxmaniac@torreviejawireless.org>
Date: Tue, 27 Jul 2021 10:52:21 +0200
Subject: [PATCH] pv_headers: pvh_set_header, remove values to set null when
necessary
* fix pvh_set_xavi for SR_XTYPE_NULL
---
src/modules/pv_headers/pvh_xavp.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/modules/pv_headers/pvh_xavp.c b/src/modules/pv_headers/pvh_xavp.c
index 96fdc292b0..b8e4f92e61 100644
--- a/src/modules/pv_headers/pvh_xavp.c
+++ b/src/modules/pv_headers/pvh_xavp.c
@@ -375,7 +375,7 @@ int pvh_set_xavi(struct sip_msg *msg, str *xname, str *name, void *data,
LM_DBG("br_xname: %.*s name: %.*s append:%d\n", br_xname.len, br_xname.s,
name->len, name->s, append);
memset(&xval, 0, sizeof(sr_xval_t));
- if(data == NULL || SR_XTYPE_NULL) {
+ if(data == NULL || type == SR_XTYPE_NULL) {
xval.type = SR_XTYPE_NULL;
} else if(type == SR_XTYPE_STR) {
xval.type = SR_XTYPE_STR;
@@ -618,9 +618,11 @@ int pvh_set_header(
if(val == NULL || (val->flags & PV_VAL_NULL)) {
if(idxf == PV_IDX_ALL) {
- 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(hname_cnt > 1) {
+ 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)
< 0)
goto err;
--
2.20.1
Loading…
Cancel
Save