From 9fea7d6bf1f6d9e47a0cd46865418b3d8b228f0f Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Mon, 11 May 2020 11:26:57 +0200 Subject: [PATCH] TT#81263 refresh patches and remove already applied * set proper version in debian/changelog Change-Id: I7fa2148980f3f280fc1d6828cac7cddde77bb2d5 --- debian/changelog | 20 +- .../patches/debian/no_lib64_on_64_bits.patch | 4 +- debian/patches/series | 12 +- .../switch_from_python2_to_python3.patch | 2 +- debian/patches/sipwise/usrloc_dbro.patch | 2 +- .../cfgt-don-t-process-non-sip-messages.patch | 8 +- ...msg-tcp-connection-id-in-the-dst-inf.patch | 27 -- ...ng-multiple-IPs-for-a-cached-DNS-ent.patch | 21 -- ...s-performance-improvements-and-fixes.patch | 14 +- ...ding-0-for-port-value-in-pv_set_ruri.patch | 39 --- .../pv-fixes-for-KEMI-pvx.xavp_getd.patch | 14 +- ...ne-add-flags-field-for-every-command.patch | 6 +- .../rtpengine-add-play_dtmf-command.patch | 4 +- ...gine-fix-zero-length-log-placeholder.patch | 22 -- ...ine-replaced-rtpproxy-with-rtpengine.patch | 282 ------------------ .../upstream/rtpengine-t38-options.patch | 2 +- ...te-fix-via-branch-next-ID-generation.patch | 4 +- ...sg-tcp-connection-id-in-the-dst-info.patch | 42 --- ...ocket-for-in-dialog-REGISTER-GH-2262.patch | 53 ---- ...extdb-remove-DeprecationWarning-on-t.patch | 241 --------------- ...extdb.py-close-previous-opened-file-.patch | 39 --- .../upstream/utils-kamctl-fix-dbtestdb.patch | 89 ------ ...ls-kamctl-fix-handling-of-Exceptions.patch | 88 ------ 23 files changed, 39 insertions(+), 996 deletions(-) delete mode 100644 debian/patches/upstream/core-do-not-set-msg-tcp-connection-id-in-the-dst-inf.patch delete mode 100644 debian/patches/upstream/core-fix-returning-multiple-IPs-for-a-cached-DNS-ent.patch delete mode 100644 debian/patches/upstream/pv-do-not-set-ending-0-for-port-value-in-pv_set_ruri.patch delete mode 100644 debian/patches/upstream/rtpengine-fix-zero-length-log-placeholder.patch delete mode 100644 debian/patches/upstream/rtpengine-replaced-rtpproxy-with-rtpengine.patch delete mode 100644 debian/patches/upstream/tm-do-not-set-msg-tcp-connection-id-in-the-dst-info.patch delete mode 100644 debian/patches/upstream/uac-also-set-socket-for-in-dialog-REGISTER-GH-2262.patch delete mode 100644 debian/patches/upstream/utils-kamctl-dbtextdb-remove-DeprecationWarning-on-t.patch delete mode 100644 debian/patches/upstream/utils-kamctl-dbtextdb.py-close-previous-opened-file-.patch delete mode 100644 debian/patches/upstream/utils-kamctl-fix-dbtestdb.patch delete mode 100644 debian/patches/upstream/utils-kamctl-fix-handling-of-Exceptions.patch diff --git a/debian/changelog b/debian/changelog index 1ab5ae0ce..4e57a2193 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,17 +1,25 @@ -ngcp-kamailio (5.3.3-1+0~mr8.4.0.0) unstable; urgency=medium +ngcp-kamailio (5.3.4-1+0~mr8.4.0.0) unstable; urgency=medium [ Victor Seva ] - * [ca23604] TT#75200 pv_headers: rework + * TT#75200 pv_headers: rework * TT#76405 pua_dialoginfo * TT#78500 update patches merged upstream - * New upstream version 5.3.3 - * TT#78500 update patches + * TT#78651 KEMI changes needed to remove app_lua_sr + * TT#80825 upstream fixes for kamctl dbtextdb + * TT#78500 update patches from upstream + * TT#79800 ndb_redis: fix redis_cmd return value on error + * New upstream version 5.3.4 + * TT#81263 refresh patches and remove already applied [ Richard Fuchs ] * TT#78302 support rtpengine T.38 options - * [7ebf36b] TT#74951 fix incorrect branch index used in via-branch=next + * TT#74951 fix incorrect branch index used in via-branch=next + * TT#79601 add rtpengine flags for all commands - -- Victor Seva Thu, 26 Mar 2020 10:44:27 +0100 + [ Michael Prokop ] + * TT#80825 utils/kamctl/dbtextdb/dbtextdb.py: fix exception usage with python3 + + -- Victor Seva Mon, 11 May 2020 11:29:01 +0200 ngcp-kamailio (5.2.5-1+0~mr8.3.0.0) unstable; urgency=medium diff --git a/debian/patches/debian/no_lib64_on_64_bits.patch b/debian/patches/debian/no_lib64_on_64_bits.patch index a9e084f85..da33b8202 100644 --- a/debian/patches/debian/no_lib64_on_64_bits.patch +++ b/debian/patches/debian/no_lib64_on_64_bits.patch @@ -7,10 +7,10 @@ Subject: no_lib64_on_64_bits 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/Makefile.defs b/src/Makefile.defs -index a4ecc20..47cf68e 100644 +index ea55456..92f2287 100644 --- a/src/Makefile.defs +++ b/src/Makefile.defs -@@ -443,15 +443,7 @@ endif +@@ -452,15 +452,7 @@ endif $(info target architecture <$(ARCH)>, host architecture <$(HOST_ARCH)>) diff --git a/debian/patches/series b/debian/patches/series index 3ec06289d..c4e7a6564 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -63,17 +63,7 @@ upstream/pv-add-KEMI-functions-pvx.xavp_get_keys-and-pvx.xavp.patch upstream/pv-fixes-for-KEMI-pvx.xavp_getd.patch upstream/cfgt-don-t-process-non-sip-messages.patch ## backport from kamailio trunk (5.3) -upstream/pv-do-not-set-ending-0-for-port-value-in-pv_set_ruri.patch -upstream/uac-also-set-socket-for-in-dialog-REGISTER-GH-2262.patch -upstream/rtpengine-replaced-rtpproxy-with-rtpengine.patch -upstream/rtpengine-fix-zero-length-log-placeholder.patch -upstream/core-fix-returning-multiple-IPs-for-a-cached-DNS-ent.patch -upstream/core-do-not-set-msg-tcp-connection-id-in-the-dst-inf.patch -upstream/tm-do-not-set-msg-tcp-connection-id-in-the-dst-info.patch -upstream/utils-kamctl-fix-handling-of-Exceptions.patch -upstream/utils-kamctl-fix-dbtestdb.patch -upstream/utils-kamctl-dbtextdb-remove-DeprecationWarning-on-t.patch -upstream/utils-kamctl-dbtextdb.py-close-previous-opened-file-.patch +# ### relevant for upstream # ### active development diff --git a/debian/patches/sipwise/switch_from_python2_to_python3.patch b/debian/patches/sipwise/switch_from_python2_to_python3.patch index 9b97cc8f0..15a4bddf3 100644 --- a/debian/patches/sipwise/switch_from_python2_to_python3.patch +++ b/debian/patches/sipwise/switch_from_python2_to_python3.patch @@ -18,7 +18,7 @@ index 1041be8..3820113 100644 # Copyright 2008 Google Inc. All Rights Reserved. diff --git a/utils/kamctl/dbtextdb/dbtextdb_test.py b/utils/kamctl/dbtextdb/dbtextdb_test.py -index ecbab06..29b3abf 100644 +index 54ce274..fbcad97 100644 --- a/utils/kamctl/dbtextdb/dbtextdb_test.py +++ b/utils/kamctl/dbtextdb/dbtextdb_test.py @@ -1,4 +1,4 @@ diff --git a/debian/patches/sipwise/usrloc_dbro.patch b/debian/patches/sipwise/usrloc_dbro.patch index 7579262ee..6c3fa1cec 100644 --- a/debian/patches/sipwise/usrloc_dbro.patch +++ b/debian/patches/sipwise/usrloc_dbro.patch @@ -126,7 +126,7 @@ index a834fe0..898f286 100644 /* free callbacks list */ diff --git a/src/modules/usrloc/usrloc_mod.h b/src/modules/usrloc/usrloc_mod.h -index 12735f1..d1ab60e 100644 +index f04b61c..cfe4c96 100644 --- a/src/modules/usrloc/usrloc_mod.h +++ b/src/modules/usrloc/usrloc_mod.h @@ -89,6 +89,8 @@ extern int handle_lost_tcp; diff --git a/debian/patches/upstream/cfgt-don-t-process-non-sip-messages.patch b/debian/patches/upstream/cfgt-don-t-process-non-sip-messages.patch index a4841beb2..096443070 100644 --- a/debian/patches/upstream/cfgt-don-t-process-non-sip-messages.patch +++ b/debian/patches/upstream/cfgt-don-t-process-non-sip-messages.patch @@ -1,15 +1,14 @@ -From 57dbfba97f03370db3ad36e1d52f85f725f12972 Mon Sep 17 00:00:00 2001 From: Sipwise Development Team Date: Fri, 29 Nov 2019 11:23:36 +0100 Subject: [PATCH] cfgt: don't process non-sip messages * Skip OPTION messages internally generated --- - src/modules/cfgt/cfgt_int.c | 103 +++++++++++++++++++++++++++++++++--- + src/modules/cfgt/cfgt_int.c | 103 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 95 insertions(+), 8 deletions(-) diff --git a/src/modules/cfgt/cfgt_int.c b/src/modules/cfgt/cfgt_int.c -index 5f73a05bc8..382d696f53 100644 +index 5f73a05..382d696 100644 --- a/src/modules/cfgt/cfgt_int.c +++ b/src/modules/cfgt/cfgt_int.c @@ -30,6 +30,11 @@ @@ -224,6 +223,3 @@ index 5f73a05bc8..382d696f53 100644 LM_ERR("node empty\n"); return -1; } --- -2.20.1 - diff --git a/debian/patches/upstream/core-do-not-set-msg-tcp-connection-id-in-the-dst-inf.patch b/debian/patches/upstream/core-do-not-set-msg-tcp-connection-id-in-the-dst-inf.patch deleted file mode 100644 index d2e60224f..000000000 --- a/debian/patches/upstream/core-do-not-set-msg-tcp-connection-id-in-the-dst-inf.patch +++ /dev/null @@ -1,27 +0,0 @@ -From: Daniel-Constantin Mierla -Date: Mon, 30 Mar 2020 10:10:33 +0200 -Subject: [PATCH] core: do not set msg tcp connection id in the dst info - -(cherry picked from commit f9eaa1298f7263be53b709ab7b68336d09e9de0b) ---- - src/core/action.c | 2 -- - 1 file changed, 2 deletions(-) - -diff --git a/src/core/action.c b/src/core/action.c -index 8211cf0..1520f87 100644 ---- a/src/core/action.c -+++ b/src/core/action.c -@@ -385,13 +385,11 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg) - #ifdef USE_TCP - else if (a->type==FORWARD_TCP_T) { - dst.proto= PROTO_TCP; -- dst.id = msg->otcpid; - } - #endif - #ifdef USE_TLS - else if (a->type==FORWARD_TLS_T) { - dst.proto= PROTO_TLS; -- dst.id = msg->otcpid; - } - #endif - #ifdef USE_SCTP diff --git a/debian/patches/upstream/core-fix-returning-multiple-IPs-for-a-cached-DNS-ent.patch b/debian/patches/upstream/core-fix-returning-multiple-IPs-for-a-cached-DNS-ent.patch deleted file mode 100644 index ab486f004..000000000 --- a/debian/patches/upstream/core-fix-returning-multiple-IPs-for-a-cached-DNS-ent.patch +++ /dev/null @@ -1,21 +0,0 @@ -From: Nathan Bruning -Date: Tue, 24 Mar 2020 11:24:28 +0100 -Subject: [PATCH] core: fix returning multiple IPs for a cached DNS entry - -(cherry picked from commit 29a35ec3cec8b9c3ee4b45c8d84308701bda097c) ---- - src/core/dns_cache.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/core/dns_cache.c b/src/core/dns_cache.c -index 8f3f4ae..81fc6a9 100644 ---- a/src/core/dns_cache.c -+++ b/src/core/dns_cache.c -@@ -2304,6 +2304,7 @@ inline static struct hostent* dns_entry2he(struct dns_hash_entry* e) - return 0; - } - memcpy(p_addr[i], ip, len); -+ rr_no++; - } - if (i==0){ - LM_DBG("no good records found (%d) for %.*s (%d)\n", diff --git a/debian/patches/upstream/db_redis-performance-improvements-and-fixes.patch b/debian/patches/upstream/db_redis-performance-improvements-and-fixes.patch index 97038c579..43a48278f 100644 --- a/debian/patches/upstream/db_redis-performance-improvements-and-fixes.patch +++ b/debian/patches/upstream/db_redis-performance-improvements-and-fixes.patch @@ -1448,7 +1448,7 @@ index f41be1a..ae40db6 100644 \ No newline at end of file +#endif /* _REDIS_BASE_H_ */ diff --git a/src/modules/db_redis/redis_table.c b/src/modules/db_redis/redis_table.c -index fe63490..4bed4e1 100644 +index 721d31d..e59bd5b 100644 --- a/src/modules/db_redis/redis_table.c +++ b/src/modules/db_redis/redis_table.c @@ -487,13 +487,14 @@ static struct str_hash_entry* db_redis_create_column(str *col, str *type) { @@ -1460,13 +1460,13 @@ index fe63490..4bed4e1 100644 char *start; char *end; - str table_name; + str table_name = str_init(""); str type_name; str column_name; + str version_code; - struct str_hash_entry *table_entry; - redis_table_t *table; + struct str_hash_entry *table_entry = NULL; + redis_table_t *table = NULL; @@ -533,6 +534,16 @@ int db_redis_parse_keys(km_redis_con_t *con) { } table_name.s = start; @@ -1484,15 +1484,15 @@ index fe63490..4bed4e1 100644 state = DBREDIS_KEYS_TYPE_ST; start = ++p; LM_DBG("found table name '%.*s'\n", table_name.len, table_name.s); -@@ -544,6 +555,7 @@ int db_redis_parse_keys(km_redis_con_t *con) { +@@ -545,6 +556,7 @@ int db_redis_parse_keys(km_redis_con_t *con) { goto err; } table = table_entry->u.p; + table->version_code = version_code; break; case DBREDIS_KEYS_TYPE_ST: - while(p != end && *p != ':') -@@ -593,6 +605,10 @@ int db_redis_parse_keys(km_redis_con_t *con) { + if(!table) { +@@ -598,6 +610,10 @@ int db_redis_parse_keys(km_redis_con_t *con) { column_name.s = start; column_name.len = p - start; start = ++p; diff --git a/debian/patches/upstream/pv-do-not-set-ending-0-for-port-value-in-pv_set_ruri.patch b/debian/patches/upstream/pv-do-not-set-ending-0-for-port-value-in-pv_set_ruri.patch deleted file mode 100644 index e2f7b34ea..000000000 --- a/debian/patches/upstream/pv-do-not-set-ending-0-for-port-value-in-pv_set_ruri.patch +++ /dev/null @@ -1,39 +0,0 @@ -From: Daniel-Constantin Mierla -Date: Thu, 19 Mar 2020 10:59:43 +0100 -Subject: [PATCH] pv: do not set ending '\0' for port value in - pv_set_ruri_port() - -- it can be a reference to a static string, ending up in a crash -- GH #2258 - -(cherry picked from commit 1f76bca74839f35d11f42edf758eb046cedb752c) ---- - src/modules/pv/pv_core.c | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/src/modules/pv/pv_core.c b/src/modules/pv/pv_core.c -index 18db915..9087fe0 100644 ---- a/src/modules/pv/pv_core.c -+++ b/src/modules/pv/pv_core.c -@@ -2558,7 +2558,9 @@ int pv_set_ruri_port(struct sip_msg* msg, pv_param_t *param, - act.val[0].type = STRING_ST; - act.val[0].u.string = val->rs.s; - backup = val->rs.s[val->rs.len]; -- val->rs.s[val->rs.len] = '\0'; -+ if(backup != '\0') { -+ val->rs.s[val->rs.len] = '\0'; -+ } - act.type = SET_PORT_T; - init_run_actions_ctx(&h); - if (do_action(&h, &act, msg)<0) -@@ -2567,7 +2569,9 @@ int pv_set_ruri_port(struct sip_msg* msg, pv_param_t *param, - val->rs.s[val->rs.len] = backup; - goto error; - } -- val->rs.s[val->rs.len] = backup; -+ if(backup != '\0') { -+ val->rs.s[val->rs.len] = backup; -+ } - - return 0; - error: diff --git a/debian/patches/upstream/pv-fixes-for-KEMI-pvx.xavp_getd.patch b/debian/patches/upstream/pv-fixes-for-KEMI-pvx.xavp_getd.patch index ee287a3d9..1395caec7 100644 --- a/debian/patches/upstream/pv-fixes-for-KEMI-pvx.xavp_getd.patch +++ b/debian/patches/upstream/pv-fixes-for-KEMI-pvx.xavp_getd.patch @@ -1,4 +1,3 @@ -From 916c775f8ccb079af11f370aa498b5932f3734d5 Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Tue, 21 Apr 2020 13:03:16 +0200 Subject: [PATCH] pv: fixes for KEMI pvx.xavp_getd @@ -8,10 +7,10 @@ Subject: [PATCH] pv: fixes for KEMI pvx.xavp_getd 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/modules/pv/pv.c b/src/modules/pv/pv.c -index 2574148c04..511a0e3b29 100644 +index 54bf38d..2bbc77b 100644 --- a/src/modules/pv/pv.c +++ b/src/modules/pv/pv.c -@@ -1402,7 +1402,7 @@ sr_kemi_dict_item_t* ki_xavp_dict(sr_xavp_t *xavp); +@@ -1229,7 +1229,7 @@ sr_kemi_dict_item_t* ki_xavp_dict(sr_xavp_t *xavp); /** * SR_KEMIP_ARRAY with values of xavp=>name */ @@ -20,7 +19,7 @@ index 2574148c04..511a0e3b29 100644 { sr_kemi_dict_item_t *ini = NULL; sr_kemi_dict_item_t *val; -@@ -1416,7 +1416,7 @@ sr_kemi_dict_item_t* ki_xavp_dict_name(sr_xavp_t *xavp, str name) +@@ -1243,7 +1243,7 @@ sr_kemi_dict_item_t* ki_xavp_dict_name(sr_xavp_t *xavp, str name) } memset(ini, 0, sizeof(sr_kemi_xval_t)); ini->vtype = SR_KEMIP_ARRAY; @@ -29,7 +28,7 @@ index 2574148c04..511a0e3b29 100644 { avp = avp->next; } -@@ -1467,8 +1467,8 @@ sr_kemi_dict_item_t* ki_xavp_dict_name(sr_xavp_t *xavp, str name) +@@ -1294,8 +1294,8 @@ sr_kemi_dict_item_t* ki_xavp_dict_name(sr_xavp_t *xavp, str name) last->next = val; } else { ini->v.dict = val; @@ -39,7 +38,7 @@ index 2574148c04..511a0e3b29 100644 avp = xavp_get_next(avp); } return ini; -@@ -1509,13 +1509,13 @@ sr_kemi_dict_item_t* ki_xavp_dict(sr_xavp_t *xavp) +@@ -1335,13 +1335,13 @@ sr_kemi_dict_item_t* ki_xavp_dict(sr_xavp_t *xavp) { val->vtype = SR_KEMIP_DICT; val->name.s = keys->s.s; val->name.len = keys->s.len; @@ -55,6 +54,3 @@ index 2574148c04..511a0e3b29 100644 k = keys; keys = keys->next; pkg_free(k); --- -2.20.1 - diff --git a/debian/patches/upstream/rtpengine-add-flags-field-for-every-command.patch b/debian/patches/upstream/rtpengine-add-flags-field-for-every-command.patch index f4bce081a..d65292ae5 100644 --- a/debian/patches/upstream/rtpengine-add-flags-field-for-every-command.patch +++ b/debian/patches/upstream/rtpengine-add-flags-field-for-every-command.patch @@ -1,4 +1,3 @@ -From 498d7649339edfc07f40fe3e37e66376b2817d6c Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 14 Apr 2020 13:15:21 -0400 Subject: [PATCH] rtpengine: add `flags` field for every command @@ -8,7 +7,7 @@ Subject: [PATCH] rtpengine: add `flags` field for every command 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c -index 7be7968660..d56e88e003 100644 +index 7be7968..d56e88e 100644 --- a/src/modules/rtpengine/rtpengine.c +++ b/src/modules/rtpengine/rtpengine.c @@ -2401,8 +2401,9 @@ static bencode_item_t *rtpp_function_call(bencode_buffer_t *bencbuf, struct sip_ @@ -34,6 +33,3 @@ index 7be7968660..d56e88e003 100644 /*** parse flags & build dictionary ***/ --- -2.20.1 - diff --git a/debian/patches/upstream/rtpengine-add-play_dtmf-command.patch b/debian/patches/upstream/rtpengine-add-play_dtmf-command.patch index 39d4f8e1e..41e010e36 100644 --- a/debian/patches/upstream/rtpengine-add-play_dtmf-command.patch +++ b/debian/patches/upstream/rtpengine-add-play_dtmf-command.patch @@ -8,7 +8,7 @@ Subject: [PATCH] rtpengine: add play_dtmf() command 2 files changed, 12 insertions(+) diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c -index 20df725..2d6b7c1 100644 +index 8f3c28a..2e09c15 100644 --- a/src/modules/rtpengine/rtpengine.c +++ b/src/modules/rtpengine/rtpengine.c @@ -138,6 +138,7 @@ static const char *command_strings[] = { @@ -51,7 +51,7 @@ index 20df725..2d6b7c1 100644 start_forwarding_f(struct sip_msg* msg, char *str1, char *str2) { diff --git a/src/modules/rtpengine/rtpengine.h b/src/modules/rtpengine/rtpengine.h -index 4edf52f..354eceb 100644 +index 8a29210..03999bf 100644 --- a/src/modules/rtpengine/rtpengine.h +++ b/src/modules/rtpengine/rtpengine.h @@ -46,6 +46,7 @@ enum rtpe_operation { diff --git a/debian/patches/upstream/rtpengine-fix-zero-length-log-placeholder.patch b/debian/patches/upstream/rtpengine-fix-zero-length-log-placeholder.patch deleted file mode 100644 index e0460ae48..000000000 --- a/debian/patches/upstream/rtpengine-fix-zero-length-log-placeholder.patch +++ /dev/null @@ -1,22 +0,0 @@ -From: Zero King -Date: Tue, 24 Mar 2020 11:12:39 +0100 -Subject: [PATCH] rtpengine: fix zero-length log placeholder - -(cherry picked from commit 740afac15b3d8d618b5101a761a37f5808d4b4f0) ---- - src/modules/rtpengine/rtpengine_funcs.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/modules/rtpengine/rtpengine_funcs.c b/src/modules/rtpengine/rtpengine_funcs.c -index b99153a..598af63 100644 ---- a/src/modules/rtpengine/rtpengine_funcs.c -+++ b/src/modules/rtpengine/rtpengine_funcs.c -@@ -231,7 +231,7 @@ int extract_body(struct sip_msg *msg, str *body ) - /* p2 is text limit for application parsing */ - rest = eat_line(p1 + mpdel.len + 2, p2 - p1 - mpdel.len - 2); - if ( rest > p2 ) { -- LM_ERR("Unparsable <%.*s>\n", (int)(p1-p1), p1); -+ LM_ERR("Unparsable <%.*s>\n", (int)(p2-p1), p1); - return -1; - } - while( rest -Date: Mon, 23 Mar 2020 18:42:23 +0100 -Subject: [PATCH] rtpengine: replaced rtpproxy with rtpengine - -- avoid confusion in printed log messges - -(cherry picked from commit dda07c69420e1a38948dae4b71f8005b2375253b) ---- - src/modules/rtpengine/config.c | 11 ++++++--- - src/modules/rtpengine/rtpengine.c | 48 ++++++++++++++++++------------------ - src/modules/rtpengine/rtpengine.h | 5 ++-- - src/modules/rtpengine/rtpengine_db.c | 4 +-- - 4 files changed, 36 insertions(+), 32 deletions(-) - -diff --git a/src/modules/rtpengine/config.c b/src/modules/rtpengine/config.c -index 946df8a..82cbffa 100644 ---- a/src/modules/rtpengine/config.c -+++ b/src/modules/rtpengine/config.c -@@ -42,13 +42,16 @@ void *rtpengine_cfg = &default_rtpengine_cfg; - - cfg_def_t rtpengine_cfg_def[] = { - {"rtpengine_disable_tout", CFG_VAR_INT | CFG_ATOMIC, 0, 0, 0, 0, -- "The time after which rtpengine will try to communicate to an RTP proxy after it has been marked disabled automatically. "}, -+ "The time after which rtpengine module will try to communicate" -+ " with an RTPEngine instance after it has been marked disabled automatically. "}, - {"aggressive_redetection", CFG_VAR_INT | CFG_ATOMIC, 0, 1, 0, 0, -- "Determines if the sip proxy should force a query of all nodes when all RTP proxies seem unavailable."}, -+ "Determines if the sip proxy should force a query of all nodes" -+ " when all RTPEngine instances seem unavailable."}, - {"rtpengine_tout_ms", CFG_VAR_INT | CFG_ATOMIC, 0, 0, 0, 0, -- "The total number of nodes inside a set to be queried before giving up establishing a session"}, -+ "The total number of nodes inside a set to be queried before giving up" -+ " establishing a session"}, - {"queried_nodes_limit", CFG_VAR_INT | CFG_ATOMIC, 0, MAX_RTPP_TRIED_NODES, 0, 0, -- "Timeout value expressed in milliseconds in waiting for reply from RTP proxy"}, -+ "Timeout value expressed in milliseconds to wait for reply from RTPEngine"}, - {"rtpengine_retr", CFG_VAR_INT | CFG_ATOMIC, 0, 0, 0, 0, - "How many times the module should retry to send and receive after timeout was generated"}, - {0, 0, 0, 0, 0, 0} -diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c -index 135e34b..7be7968 100644 ---- a/src/modules/rtpengine/rtpengine.c -+++ b/src/modules/rtpengine/rtpengine.c -@@ -257,7 +257,7 @@ static char ** rtpp_strings=0; - static int rtpp_sets=0; /*used in rtpengine_set_store()*/ - static int rtpp_set_count = 0; - static unsigned int current_msg_id = (unsigned int)-1; --/* RTP proxy balancing list */ -+/* RTPEngine balancing list */ - static struct rtpp_set_head * rtpp_set_list =0; - static struct rtpp_set * active_rtpp_set =0; - static struct rtpp_set * selected_rtpp_set_1 =0; -@@ -862,7 +862,7 @@ struct rtpp_set *get_rtpp_set(unsigned int set_id) - if(!rtpp_list) - { - lock_release(rtpp_set_list->rset_head_lock); -- LM_ERR("no shm memory left to create new rtpproxy set %u\n", my_current_id); -+ LM_ERR("no shm memory left to create new rtpengine set %u\n", my_current_id); - return NULL; - } - memset(rtpp_list, 0, sizeof(struct rtpp_set)); -@@ -870,14 +870,14 @@ struct rtpp_set *get_rtpp_set(unsigned int set_id) - rtpp_list->rset_lock = lock_alloc(); - if (!rtpp_list->rset_lock) { - lock_release(rtpp_set_list->rset_head_lock); -- LM_ERR("no shm memory left to create rtpproxy set lock\n"); -+ LM_ERR("no shm memory left to create rtpengine set lock\n"); - shm_free(rtpp_list); - rtpp_list = NULL; - return NULL; - } - if (lock_init(rtpp_list->rset_lock) == 0) { - lock_release(rtpp_set_list->rset_head_lock); -- LM_ERR("could not init rtpproxy set lock\n"); -+ LM_ERR("could not init rtpengine set lock\n"); - lock_dealloc((void*)rtpp_list->rset_lock); - rtpp_list->rset_lock = NULL; - shm_free(rtpp_list); -@@ -915,17 +915,17 @@ struct rtpp_set *get_rtpp_set(unsigned int set_id) - } - - --int add_rtpengine_socks(struct rtpp_set * rtpp_list, char * rtpproxy, -+int add_rtpengine_socks(struct rtpp_set *rtpp_list, char *rtpengine, - unsigned int weight, int disabled, unsigned int ticks, int isDB) - { -- /* Make rtp proxies list. */ -+ /* Make rtpengine instances list. */ - char *p, *p1, *p2, *plim; - struct rtpp_node *pnode; - struct rtpp_node *rtpp_node; - unsigned int local_weight, port; - str s1; - -- p = rtpproxy; -+ p = rtpengine; - plim = p + strlen(p); - - for(;;) { -@@ -1100,7 +1100,7 @@ static int rtpengine_add_rtpengine_set(char * rtp_proxies, unsigned int weight, - rtp_proxies = strstr(p, "=="); - if(rtp_proxies){ - if(*(rtp_proxies +2)=='\0'){ -- LM_ERR("script error -invalid rtp proxy list!\n"); -+ LM_ERR("script error -invalid rtpengine list!\n"); - return -1; - } - -@@ -1252,7 +1252,7 @@ static void rtpengine_rpc_reload(rpc_t* rpc, void* ctx) - } - _rtpe_list_version->vertime = tnow; - -- if (init_rtpproxy_db() < 0) { -+ if (init_rtpengine_db() < 0) { - // fail reloading from database - rpc->fault(ctx, 500, "Failed reloading db"); - return; -@@ -1600,14 +1600,14 @@ mod_init(void) - } - - if (lock_init(rtpp_set_list->rset_head_lock) == 0) { -- LM_ERR("could not init rtpproxy list of proxysets lock\n"); -+ LM_ERR("could not init lock sets for rtpengine list\n"); - return -1; - } - } - - if (rtpp_db_url.s == NULL) - { -- /* storing the list of rtp proxy sets in shared memory*/ -+ /* storing the list of rtpengine sets in shared memory*/ - for(i=0;iidx], res->ai_addr, res->ai_addrlen) == -1) { -- LM_ERR("can't connect to a RTP proxy\n"); -+ LM_ERR("can't connect to a RTPEngine instance\n"); - close(rtpp_socks[pnode->idx]); - rtpp_socks[pnode->idx] = -1; - freeaddrinfo(res); -@@ -1968,7 +1968,7 @@ child_init(int rank) - } - memset(queried_nodes_ptr, 0, MAX_RTPP_TRIED_NODES * sizeof(struct rtpp_node*)); - -- /* Iterate known RTP proxies - create sockets */ -+ /* Iterate known RTPEngine instances - create sockets */ - if(rank==PROC_SIPINIT) { - /* probe rtpengines only in first worker */ - if (build_rtpp_socks(0, 1)) -@@ -2782,7 +2782,7 @@ rtpp_test(struct rtpp_node *node, int isdisabled, int force) - goto error; - } - -- LM_INFO("rtp proxy <%s> found, support for it %senabled\n", -+ LM_INFO("rtpengine instance <%s> found, support for it %senabled\n", - node->rn_url.s, force == 0 ? "re-" : ""); - - bencode_buffer_free(&bencbuf); -@@ -2831,7 +2831,7 @@ send_rtpp_command(struct rtpp_node *node, bencode_item_t *dict, int *outlen) - } - if (connect(fd, (struct sockaddr *) &addr, sizeof(addr)) < 0) { - close(fd); -- LM_ERR("can't connect to RTP proxy <%s>\n", node->rn_url.s); -+ LM_ERR("can't connect to RTPEngine <%s>\n", node->rn_url.s); - goto badproxy; - } - -@@ -2840,7 +2840,7 @@ send_rtpp_command(struct rtpp_node *node, bencode_item_t *dict, int *outlen) - } while (len == -1 && errno == EINTR); - if (len <= 0) { - close(fd); -- LM_ERR("can't send command to RTP proxy <%s>\n", node->rn_url.s); -+ LM_ERR("can't send command to RTPEngine <%s>\n", node->rn_url.s); - goto badproxy; - } - do { -@@ -2848,7 +2848,7 @@ send_rtpp_command(struct rtpp_node *node, bencode_item_t *dict, int *outlen) - } while (len == -1 && errno == EINTR); - close(fd); - if (len <= 0) { -- LM_ERR("can't read reply from RTP proxy <%s>\n", node->rn_url.s); -+ LM_ERR("can't read reply from RTPEngine <%s>\n", node->rn_url.s); - goto badproxy; - } - } else { -@@ -2871,7 +2871,7 @@ send_rtpp_command(struct rtpp_node *node, bencode_item_t *dict, int *outlen) - } while (len == -1 && (errno == EINTR || errno == ENOBUFS)); - if (len <= 0) { - bencode_get_str(bencode_dictionary_get(dict, "command"), &cmd); -- LM_ERR("can't send command \"%.*s\" to RTP proxy <%s>\n", -+ LM_ERR("can't send command \"%.*s\" to RTPEngine <%s>\n", - cmd.len, cmd.s, node->rn_url.s); - goto badproxy; - } -@@ -2883,7 +2883,7 @@ send_rtpp_command(struct rtpp_node *node, bencode_item_t *dict, int *outlen) - } while (len == -1 && errno == EINTR); - if (len <= 0) { - bencode_get_str(bencode_dictionary_get(dict, "command"), &cmd); -- LM_ERR("can't read reply for command \"%.*s\" from RTP proxy <%s>\n", -+ LM_ERR("can't read reply for command \"%.*s\" from RTPEngine <%s>\n", - cmd.len, cmd.s, node->rn_url.s); - goto badproxy; - } -@@ -2902,7 +2902,7 @@ send_rtpp_command(struct rtpp_node *node, bencode_item_t *dict, int *outlen) - } - if (i == rtpengine_retr) { - bencode_get_str(bencode_dictionary_get(dict, "command"), &cmd); -- LM_ERR("timeout waiting reply for command \"%.*s\" from RTP proxy <%s>\n", -+ LM_ERR("timeout waiting reply for command \"%.*s\" from RTPEngine <%s>\n", - cmd.len, cmd.s, node->rn_url.s); - goto badproxy; - } -@@ -3220,7 +3220,7 @@ set_rtpengine_set_from_avp(struct sip_msg *msg, int direction) - - active_rtpp_set = select_rtpp_set(setid_val.n); - if(active_rtpp_set == NULL) { -- LM_ERR("could not locate rtpproxy set %u\n", setid_val.n); -+ LM_ERR("could not locate engine set %u\n", setid_val.n); - return -1; - } - -diff --git a/src/modules/rtpengine/rtpengine.h b/src/modules/rtpengine/rtpengine.h -index 354eceb..03999bf 100644 ---- a/src/modules/rtpengine/rtpengine.h -+++ b/src/modules/rtpengine/rtpengine.h -@@ -86,14 +86,15 @@ struct rtpp_set_head { - - struct rtpp_node *get_rtpp_node(struct rtpp_set *rtpp_list, str *url); - struct rtpp_set *get_rtpp_set(unsigned int set_id); --int add_rtpengine_socks(struct rtpp_set * rtpp_list, char * rtpproxy, unsigned int weight, int disabled, unsigned int ticks, int isDB); -+int add_rtpengine_socks(struct rtpp_set *rtpp_list, char *rtpengine, -+ unsigned int weight, int disabled, unsigned int ticks, int isDB); - - int rtpengine_delete_node(struct rtpp_node *rtpp_node); - int rtpengine_delete_node_set(struct rtpp_set *rtpp_list); - int rtpengine_delete_node_all(); - - --int init_rtpproxy_db(void); -+int init_rtpengine_db(void); - - extern str rtpp_db_url; - extern str rtpp_table_name; -diff --git a/src/modules/rtpengine/rtpengine_db.c b/src/modules/rtpengine/rtpengine_db.c -index 8532fd2..f83be25 100644 ---- a/src/modules/rtpengine/rtpengine_db.c -+++ b/src/modules/rtpengine/rtpengine_db.c -@@ -97,7 +97,7 @@ static int rtpp_load_db(void) - rows = RES_ROWS(res); - if (n_rows == 0) - { -- LM_WARN("No rtpproxy instances in database\n"); -+ LM_WARN("No rtpengine instances in database\n"); - rtpp_dbf.free_result(rtpp_db_handle, res); - return 0; - } -@@ -137,7 +137,7 @@ static int rtpp_load_db(void) - return 0; - } - --int init_rtpproxy_db(void) -+int init_rtpengine_db(void) - { - int ret; - if (rtpp_db_url.s == NULL) diff --git a/debian/patches/upstream/rtpengine-t38-options.patch b/debian/patches/upstream/rtpengine-t38-options.patch index 8f5824d57..4b29522e2 100644 --- a/debian/patches/upstream/rtpengine-t38-options.patch +++ b/debian/patches/upstream/rtpengine-t38-options.patch @@ -7,7 +7,7 @@ Subject: [PATCH] rtpengine: add support for new T.38 options 1 file changed, 8 insertions(+) diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c -index c040c36..135e34b 100644 +index 6d821ae..7be7968 100644 --- a/src/modules/rtpengine/rtpengine.c +++ b/src/modules/rtpengine/rtpengine.c @@ -118,6 +118,7 @@ enum { diff --git a/debian/patches/upstream/rtpengine-update-fix-via-branch-next-ID-generation.patch b/debian/patches/upstream/rtpengine-update-fix-via-branch-next-ID-generation.patch index 4bd3b732f..43c2ae693 100644 --- a/debian/patches/upstream/rtpengine-update-fix-via-branch-next-ID-generation.patch +++ b/debian/patches/upstream/rtpengine-update-fix-via-branch-next-ID-generation.patch @@ -12,7 +12,7 @@ processing in scripts 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/src/modules/rtpengine/doc/rtpengine_admin.xml b/src/modules/rtpengine/doc/rtpengine_admin.xml -index d4cd2e4..1beaeeb 100644 +index cafd6b6..9e31a7d 100644 --- a/src/modules/rtpengine/doc/rtpengine_admin.xml +++ b/src/modules/rtpengine/doc/rtpengine_admin.xml @@ -2113,6 +2113,10 @@ rtpengine_offer(); @@ -27,7 +27,7 @@ index d4cd2e4..1beaeeb 100644 on the &rtp; proxy. When sending a subsequent delete command to the &rtp; proxy, you can then stop just the session for a specific branch when diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c -index 2d6b7c1..c040c36 100644 +index 2e09c15..6d821ae 100644 --- a/src/modules/rtpengine/rtpengine.c +++ b/src/modules/rtpengine/rtpengine.c @@ -2268,6 +2268,10 @@ static int parse_flags(struct ng_flags_parse *ng_flags, struct sip_msg *msg, enu diff --git a/debian/patches/upstream/tm-do-not-set-msg-tcp-connection-id-in-the-dst-info.patch b/debian/patches/upstream/tm-do-not-set-msg-tcp-connection-id-in-the-dst-info.patch deleted file mode 100644 index 5b4689e30..000000000 --- a/debian/patches/upstream/tm-do-not-set-msg-tcp-connection-id-in-the-dst-info.patch +++ /dev/null @@ -1,42 +0,0 @@ -From: Daniel-Constantin Mierla -Date: Mon, 30 Mar 2020 10:11:54 +0200 -Subject: [PATCH] tm: do not set msg tcp connection id in the dst info - -(cherry picked from commit 974c50aea6b581b5f8545f3d710e98b53d44bd67) ---- - src/modules/tm/t_funcs.c | 1 - - src/modules/tm/t_fwd.c | 2 -- - 2 files changed, 3 deletions(-) - -diff --git a/src/modules/tm/t_funcs.c b/src/modules/tm/t_funcs.c -index 0e484d9..ee06bed 100644 ---- a/src/modules/tm/t_funcs.c -+++ b/src/modules/tm/t_funcs.c -@@ -285,7 +285,6 @@ int t_relay_to( struct sip_msg *p_msg , struct proxy_l *proxy, int proto, - if ( p_msg->REQ_METHOD==METHOD_ACK) { - LM_DBG("forwarding ACK statelessly\n"); - init_dest_info(&dst); -- dst.id = p_msg->otcpid; - if (proxy==0) { - dst.proto=proto; - if (get_uri_send_info(GET_NEXT_HOP(p_msg), &host, &port, -diff --git a/src/modules/tm/t_fwd.c b/src/modules/tm/t_fwd.c -index 81a0f20..83f22eb 100644 ---- a/src/modules/tm/t_fwd.c -+++ b/src/modules/tm/t_fwd.c -@@ -1673,7 +1673,6 @@ int t_forward_nonack( struct cell *t, struct sip_msg* p_msg, - if (t->flags & T_CANCELED) goto canceled; - if (branch_ret>=0) { - added_branches |= 1<uac[branch_ret].request.dst.id = p_msg->otcpid; - } else { - lowest_ret=MIN_int(lowest_ret, branch_ret); - } -@@ -1700,7 +1699,6 @@ int t_forward_nonack( struct cell *t, struct sip_msg* p_msg, - * branch result */ - if (branch_ret>=0) { - added_branches |= 1<uac[branch_ret].request.dst.id = obranch.otcpid; - } else { - lowest_ret=MIN_int(lowest_ret, branch_ret); - } diff --git a/debian/patches/upstream/uac-also-set-socket-for-in-dialog-REGISTER-GH-2262.patch b/debian/patches/upstream/uac-also-set-socket-for-in-dialog-REGISTER-GH-2262.patch deleted file mode 100644 index 88ddb8841..000000000 --- a/debian/patches/upstream/uac-also-set-socket-for-in-dialog-REGISTER-GH-2262.patch +++ /dev/null @@ -1,53 +0,0 @@ -From: Henning Westerholt -Date: Tue, 24 Mar 2020 22:42:59 +0100 -Subject: [PATCH] uac: also set socket for in dialog REGISTER (GH #2262) - -(cherry picked from commit a752411df65b93f82aaad43a767cff102f5a6100) ---- - src/modules/uac/uac_reg.c | 26 +++++++++++++------------- - 1 file changed, 13 insertions(+), 13 deletions(-) - -diff --git a/src/modules/uac/uac_reg.c b/src/modules/uac/uac_reg.c -index fb45a4f..2ce3725 100644 ---- a/src/modules/uac/uac_reg.c -+++ b/src/modules/uac/uac_reg.c -@@ -1131,6 +1131,19 @@ int uac_reg_update(reg_uac_t *reg, time_t tn) - /* Callback parameter */ - uac_r.cbp = (void*)uuid; - -+ if(reg->socket.s != NULL && reg->socket.len > 0) { -+ /* custom socket */ -+ LM_DBG("using custom socket %.*s to send request\n", -+ reg->socket.len, reg->socket.s); -+ uac_r.ssock = ®->socket; -+ } else { -+ /* default socket */ -+ if(uac_default_socket.s != NULL && uac_default_socket.len > 0) { -+ LM_DBG("using configured default_socket to send request\n"); -+ uac_r.ssock = &uac_default_socket; -+ } -+ } -+ - if (reg_keep_callid && reg->flags & UAC_REG_ONLINE - && reg->cseq > 0 && reg->cseq < 2147483638 - && reg->callid.len > 0) -@@ -1150,19 +1163,6 @@ int uac_reg_update(reg_uac_t *reg, time_t tn) - - ret = uac_tmb.t_request_within(&uac_r); - } else { -- /* custom socket */ -- if(reg->socket.s != NULL && reg->socket.len > 0) { -- LM_DBG("using custom socket %.*s to send request\n", -- reg->socket.len, reg->socket.s); -- uac_r.ssock = ®->socket; -- } -- /* default socket */ -- else { -- if(uac_default_socket.s != NULL && uac_default_socket.len > 0) { -- LM_DBG("using configured default_socket to send request\n"); -- uac_r.ssock = &uac_default_socket; -- } -- } - ret = uac_tmb.t_request(&uac_r, /* UAC Req */ - &s_ruri, /* Request-URI */ - &s_turi, /* To */ diff --git a/debian/patches/upstream/utils-kamctl-dbtextdb-remove-DeprecationWarning-on-t.patch b/debian/patches/upstream/utils-kamctl-dbtextdb-remove-DeprecationWarning-on-t.patch deleted file mode 100644 index 2c31db2b4..000000000 --- a/debian/patches/upstream/utils-kamctl-dbtextdb-remove-DeprecationWarning-on-t.patch +++ /dev/null @@ -1,241 +0,0 @@ -From 5a90c8bc600fe9a93a5ce4f828ce50f3bf532b99 Mon Sep 17 00:00:00 2001 -From: Victor Seva -Date: Mon, 4 May 2020 15:05:23 +0200 -Subject: [PATCH] utils/kamctl: dbtextdb remove DeprecationWarning on test - -related #1747 - -(cherry picked from commit 765efa80c7d27e9447bc1ad8a354ee24723580ef) ---- - utils/kamctl/dbtextdb/dbtextdb_test.py | 120 ++++++++++++------------- - 1 file changed, 60 insertions(+), 60 deletions(-) - -diff --git a/utils/kamctl/dbtextdb/dbtextdb_test.py b/utils/kamctl/dbtextdb/dbtextdb_test.py -index ecbab06742..54ce274c72 100644 ---- a/utils/kamctl/dbtextdb/dbtextdb_test.py -+++ b/utils/kamctl/dbtextdb/dbtextdb_test.py -@@ -8,8 +8,8 @@ __author__ = 'herman@google.com (Herman Sheremetyev)' - - import time - import unittest --from dbtextdb import * -- -+from dbtextdb import DBText -+from dbtextdb import ParseError, ExecuteError - - class DBTextTest(unittest.TestCase): - -@@ -25,28 +25,28 @@ class DBTextTest(unittest.TestCase): - # normal query - query_normal = 'select * from subscriber;' - db_conn.ParseQuery(query_normal) -- self.assert_(db_conn.command == 'SELECT') -- self.assert_(db_conn.table == 'subscriber') -- self.assert_(db_conn.columns == ['*']) -+ self.assertEqual(db_conn.command, 'SELECT') -+ self.assertEqual(db_conn.table, 'subscriber') -+ self.assertEqual(db_conn.columns, ['*']) - db_conn.CleanUp() - # normal query with condition - query_normal_cond = 'select * from subscriber where column="value";' - db_conn.ParseQuery(query_normal_cond) -- self.assert_(db_conn.command == 'SELECT') -- self.assert_(db_conn.table == 'subscriber') -- self.assert_(db_conn.columns == ['*']) -- self.assert_(db_conn.strings == ['value']) -- self.assert_(not db_conn.count) -- self.assert_(db_conn.conditions == {'column': 'value'}) -+ self.assertEqual(db_conn.command, 'SELECT') -+ self.assertEqual(db_conn.table, 'subscriber') -+ self.assertEqual(db_conn.columns, ['*']) -+ self.assertEqual(db_conn.strings, ['value']) -+ self.assertTrue(not db_conn.count) -+ self.assertEqual(db_conn.conditions, {'column': 'value'}) - db_conn.CleanUp() - # normal query with multiple conditions - query_normal_cond = ('select * from subscriber where column="value1" and ' - 'col2=" another value " and col3= foo and a="";') - db_conn.ParseQuery(query_normal_cond) -- self.assert_(db_conn.command == 'SELECT') -- self.assert_(db_conn.table == 'subscriber') -- self.assert_(db_conn.columns == ['*']) -- self.assert_(db_conn.strings == ['value1', ' another value ', '']) -+ self.assertEqual(db_conn.command, 'SELECT') -+ self.assertEqual(db_conn.table, 'subscriber') -+ self.assertEqual(db_conn.columns, ['*']) -+ self.assertEqual(db_conn.strings, ['value1', ' another value ', '']) - self.assertEqual(db_conn.conditions, {'column': 'value1', - 'col2': ' another value ', - 'col3': 'foo', 'a': ''}) -@@ -54,49 +54,49 @@ class DBTextTest(unittest.TestCase): - # normal query with count - query_normal_count = 'select count(*) from subscriber;' - db_conn.ParseQuery(query_normal_count) -- self.assert_(db_conn.command == 'SELECT') -- self.assert_(db_conn.table == 'subscriber') -- self.assert_(db_conn.columns == ['*']) -- self.assert_(db_conn.count == True) -+ self.assertEqual(db_conn.command, 'SELECT') -+ self.assertEqual(db_conn.table, 'subscriber') -+ self.assertEqual(db_conn.columns, ['*']) -+ self.assertEqual(db_conn.count, True) - db_conn.CleanUp() - # normal query with now() - query_normal_count = 'select count(*) from subscriber where time=now();' - db_conn.ParseQuery(query_normal_count) -- self.assert_(db_conn.command == 'SELECT') -- self.assert_(db_conn.table == 'subscriber') -- self.assert_(db_conn.columns == ['*']) -- self.assert_(db_conn.count == True) -+ self.assertEqual(db_conn.command, 'SELECT') -+ self.assertEqual(db_conn.table, 'subscriber') -+ self.assertEqual(db_conn.columns, ['*']) -+ self.assertEqual(db_conn.count, True) - self.assertEqual(db_conn.conditions, {'time': self.time_now}) - db_conn.CleanUp() - # normal delete query - query_normal_delete = 'delete from subscriber where foo = 2;' - db_conn.ParseQuery(query_normal_delete) -- self.assert_(db_conn.command == 'DELETE') -- self.assert_(db_conn.table == 'subscriber') -+ self.assertEqual(db_conn.command, 'DELETE') -+ self.assertEqual(db_conn.table, 'subscriber') - self.assertEqual(db_conn.conditions, {'foo': '2'}) - db_conn.CleanUp() - # normal insert values query with no into - query_normal_insert_values = ('insert subscriber (col1, col2, col3) ' - 'values (1, "foo", "");') - db_conn.ParseQuery(query_normal_insert_values) -- self.assert_(db_conn.command == 'INSERT') -- self.assert_(db_conn.table == 'subscriber') -+ self.assertEqual(db_conn.command, 'INSERT') -+ self.assertEqual(db_conn.table, 'subscriber') - self.assertEqual(db_conn.targets, {'col1': '1', 'col2': 'foo', 'col3': ''}) - db_conn.CleanUp() - # normal insert values query with into - query_normal_insert_into_values = ('insert into subscriber (col1, col2) ' - 'values (1, "foo");') - db_conn.ParseQuery(query_normal_insert_into_values) -- self.assert_(db_conn.command == 'INSERT') -- self.assert_(db_conn.table == 'subscriber') -+ self.assertEqual(db_conn.command, 'INSERT') -+ self.assertEqual(db_conn.table, 'subscriber') - self.assertEqual(db_conn.targets, {'col1': '1', 'col2': 'foo'}) - db_conn.CleanUp() - # normal insert values query with now() - query_normal_insert_into_values = ('insert into subscriber (a, b, c) ' - 'values (NOW(), "foo", now());') - db_conn.ParseQuery(query_normal_insert_into_values) -- self.assert_(db_conn.command == 'INSERT') -- self.assert_(db_conn.table == 'subscriber') -+ self.assertEqual(db_conn.command, 'INSERT') -+ self.assertEqual(db_conn.table, 'subscriber') - self.assertEqual(db_conn.targets, {'a': self.time_now, 'b': 'foo', - 'c': self.time_now}) - db_conn.CleanUp() -@@ -157,23 +157,23 @@ class DBTextTest(unittest.TestCase): - # normal insert set query with no into - query_normal_insert_set = ('insert subscriber set col= 1, col2 ="\'f\'b";') - db_conn.ParseQuery(query_normal_insert_set) -- self.assert_(db_conn.command == 'INSERT') -- self.assert_(db_conn.table == 'subscriber') -+ self.assertEqual(db_conn.command, 'INSERT') -+ self.assertEqual(db_conn.table, 'subscriber') - self.assertEqual(db_conn.targets, {'col': '1', 'col2': '\'f\'b'}) - db_conn.CleanUp() - # normal update - query_normal_update = ('update subscriber set col1= 1, col2 ="foo";') - db_conn.ParseQuery(query_normal_update) -- self.assert_(db_conn.command == 'UPDATE') -- self.assert_(db_conn.table == 'subscriber') -+ self.assertEqual(db_conn.command, 'UPDATE') -+ self.assertEqual(db_conn.table, 'subscriber') - self.assertEqual(db_conn.targets, {'col1': '1', 'col2': 'foo'}) - db_conn.CleanUp() - # normal update with condition - query_normal_update_cond = ('update subscriber set col1= 1, col2 ="foo" ' - 'where foo = "bar" and id=1 and a="";') - db_conn.ParseQuery(query_normal_update_cond) -- self.assert_(db_conn.command == 'UPDATE') -- self.assert_(db_conn.table == 'subscriber') -+ self.assertEqual(db_conn.command, 'UPDATE') -+ self.assertEqual(db_conn.table, 'subscriber') - self.assertEqual(db_conn.targets, {'col1': '1', 'col2': 'foo'}) - self.assertEqual(db_conn.conditions, {'foo': 'bar', 'id': '1', 'a': ''}) - db_conn.CleanUp() -@@ -220,49 +220,49 @@ class DBTextTest(unittest.TestCase): - # normal query with multiple columns - query_normal_count = 'select col1, "col 2",col3 , "col4" from subscriber;' - db_conn.ParseQuery(query_normal_count) -- self.assert_(db_conn.command == 'SELECT') -- self.assert_(db_conn.table == 'subscriber') -- self.assert_(db_conn.strings == ['col 2', 'col4']) -- self.assert_(db_conn.columns == ['col1', "'col 2'", 'col3', "'col4'"]) -+ self.assertEqual(db_conn.command, 'SELECT') -+ self.assertEqual(db_conn.table, 'subscriber') -+ self.assertEqual(db_conn.strings, ['col 2', 'col4']) -+ self.assertEqual(db_conn.columns, ['col1', "'col 2'", 'col3', "'col4'"]) - db_conn.CleanUp() - # normal query with ORDER BY - query_normal_order_by = ('select col1, col2 from test' - ' ORDER by col1;') - db_conn.ParseQuery(query_normal_order_by) -- self.assert_(db_conn.command == 'SELECT') -- self.assert_(db_conn.table == 'test') -- self.assert_(db_conn.columns == ['col1', 'col2']) -- self.assert_(db_conn.order_by == 'col1') -+ self.assertEqual(db_conn.command, 'SELECT') -+ self.assertEqual(db_conn.table, 'test') -+ self.assertEqual(db_conn.columns, ['col1', 'col2']) -+ self.assertEqual(db_conn.order_by, 'col1') - db_conn.CleanUp() - # normal query with ORDER BY with conditions - query_normal_order_by_cond = ('select col1, col2 from test where col="asdf"' - ' and col2 = "foo" ORDER by col;') - db_conn.ParseQuery(query_normal_order_by_cond) -- self.assert_(db_conn.command == 'SELECT') -- self.assert_(db_conn.table == 'test') -- self.assert_(db_conn.columns == ['col1', 'col2']) -- self.assert_(db_conn.conditions == {'col': 'asdf', 'col2': 'foo'}) -- self.assert_(db_conn.order_by == 'col') -+ self.assertEqual(db_conn.command, 'SELECT') -+ self.assertEqual(db_conn.table, 'test') -+ self.assertEqual(db_conn.columns, ['col1', 'col2']) -+ self.assertEqual(db_conn.conditions, {'col': 'asdf', 'col2': 'foo'}) -+ self.assertEqual(db_conn.order_by, 'col') - db_conn.CleanUp() - # normal query with CONCAT - query_normal_concat = ('select concat(uname,"@", domain) as email_addr ' - 'from subscriber where id=3;') - db_conn.ParseQuery(query_normal_concat) -- self.assert_(db_conn.command == 'SELECT') -- self.assert_(db_conn.table == 'subscriber') -- self.assert_(db_conn.columns == ['email_addr']) -- self.assert_(db_conn.conditions == {'id': '3'}) -- self.assert_(db_conn.aliases == {'email_addr': ['uname', "'@'", 'domain']}) -+ self.assertEqual(db_conn.command, 'SELECT') -+ self.assertEqual(db_conn.table, 'subscriber') -+ self.assertEqual(db_conn.columns, ['email_addr']) -+ self.assertEqual(db_conn.conditions, {'id': '3'}) -+ self.assertEqual(db_conn.aliases, {'email_addr': ['uname', "'@'", 'domain']}) - db_conn.CleanUp() - # normal query with multiple CONCAT - query_normal_mult_concat = ('select concat(uname,"@", domain) as email,' - ' foo as "bar" from table where id=3;') - db_conn.ParseQuery(query_normal_mult_concat) -- self.assert_(db_conn.command == 'SELECT') -- self.assert_(db_conn.table == 'table') -- self.assert_(db_conn.columns == ['email', "'bar'"]) -- self.assert_(db_conn.conditions == {'id': '3'}) -- self.assert_(db_conn.aliases == {"'bar'": ['foo'], -+ self.assertEqual(db_conn.command, 'SELECT') -+ self.assertEqual(db_conn.table, 'table') -+ self.assertEqual(db_conn.columns, ['email', "'bar'"]) -+ self.assertEqual(db_conn.conditions, {'id': '3'}) -+ self.assertTrue(db_conn.aliases == {"'bar'": ['foo'], - 'email': ['uname', "'@'", 'domain']}) - db_conn.CleanUp() - # bad query with CONCAT missing AS --- -2.26.2 - diff --git a/debian/patches/upstream/utils-kamctl-dbtextdb.py-close-previous-opened-file-.patch b/debian/patches/upstream/utils-kamctl-dbtextdb.py-close-previous-opened-file-.patch deleted file mode 100644 index 701f8c056..000000000 --- a/debian/patches/upstream/utils-kamctl-dbtextdb.py-close-previous-opened-file-.patch +++ /dev/null @@ -1,39 +0,0 @@ -From e26e587f31eb23c431a2cfb149ec7a86b4f648bc Mon Sep 17 00:00:00 2001 -From: Victor Seva -Date: Mon, 4 May 2020 15:22:36 +0200 -Subject: [PATCH] utils/kamctl: dbtextdb.py close previous opened file properly - -related #1747 - -(cherry picked from commit 5f52f9905bbdf63d636080f7d0340af4f71ed12a) ---- - utils/kamctl/dbtextdb/dbtextdb.py | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/utils/kamctl/dbtextdb/dbtextdb.py b/utils/kamctl/dbtextdb/dbtextdb.py -index 7e1de04687..581496c309 100755 ---- a/utils/kamctl/dbtextdb/dbtextdb.py -+++ b/utils/kamctl/dbtextdb/dbtextdb.py -@@ -60,6 +60,10 @@ class DBText(object): - if not os.path.isdir(location): - raise ParseError(location + ' is not a directory') - -+ def __del__(self): -+ if getattr(self, 'fd', False): -+ self.fd.close() -+ - def _ParseOrderBy(self): - """Parse out the column name to be used for ordering the dataset. - -@@ -438,6 +442,8 @@ class DBText(object): - self.command = '' # which command are we executing - self.strings = [] # list of string literals parsed from the query - self.parens = [] # list of parentheses parsed from the query -+ if getattr(self, 'fd', False): -+ self.fd.close() - - def ParseQuery(self, query): - """External wrapper for the query parsing routines. --- -2.26.2 - diff --git a/debian/patches/upstream/utils-kamctl-fix-dbtestdb.patch b/debian/patches/upstream/utils-kamctl-fix-dbtestdb.patch deleted file mode 100644 index b41a213df..000000000 --- a/debian/patches/upstream/utils-kamctl-fix-dbtestdb.patch +++ /dev/null @@ -1,89 +0,0 @@ -From c4dd3218e6b723c688762a5c4253fa70f3f588bc Mon Sep 17 00:00:00 2001 -From: Victor Seva -Date: Mon, 4 May 2020 14:01:33 +0200 -Subject: [PATCH] utils/kamctl: fix dbtestdb - -some indentantion errors introduced at https://github.com/kamailio/kamailio/commit/bc8bdcaa726f375f6deea8228a1ab0cf97c67035 - -related #1747 - -(cherry picked from commit b722a48144ac9e029bdbc2968dedbe56966a3f7c) ---- - utils/kamctl/dbtextdb/dbtextdb.py | 38 +++++++++++++++---------------- - 1 file changed, 19 insertions(+), 19 deletions(-) - -diff --git a/utils/kamctl/dbtextdb/dbtextdb.py b/utils/kamctl/dbtextdb/dbtextdb.py -index 3d5ee7ecc5..7e1de04687 100755 ---- a/utils/kamctl/dbtextdb/dbtextdb.py -+++ b/utils/kamctl/dbtextdb/dbtextdb.py -@@ -146,11 +146,11 @@ class DBText(object): - # check if there is a function modifier on the columns - if self.tokens[0] == 'COUNT': - self.count = True -- if col_end == 1: -- raise ParseError('COUNT must be followed by column name[s]') -- if not self.tokens[1].startswith(self._paren_placeholder): -- raise ParseError('COUNT must be followed by ()') -- cols_str = self._ReplaceParens(self.tokens[1]) -+ if col_end == 1: -+ raise ParseError('COUNT must be followed by column name[s]') -+ if not self.tokens[1].startswith(self._paren_placeholder): -+ raise ParseError('COUNT must be followed by ()') -+ cols_str = self._ReplaceParens(self.tokens[1]) - - cols = cols_str.split(',') - for col in cols: -@@ -300,7 +300,7 @@ class DBText(object): - if self.tokens.pop(0) != 'SET': - raise ParseError('UPDATE command must be followed by SET') - -- self.targets = self._ParsePairs(' '.join(self.tokens), ',') -+ self.targets = self._ParsePairs(' '.join(self.tokens), ',') - - # INSERT - if self.command == 'INSERT': -@@ -570,19 +570,19 @@ class DBText(object): - string = '%s%s' % (string, c) - continue # wait for matching delim - -- started -= 1 -- if not started: -- values.append(string) -- new_args = '%s %s' % (new_args, '%s%d' % (placeholder, -- my_id)) -- my_id += 1 -- string = '' -+ started -= 1 -+ if not started: -+ values.append(string) -+ new_args = '%s %s' % (new_args, '%s%d' % (placeholder, -+ my_id)) -+ my_id += 1 -+ string = '' - -- else: -- if not started: -- new_args = '%s%s' % (new_args, c) - else: -- string = '%s%s' % (string, c) -+ if not started: -+ new_args = '%s%s' % (new_args, c) -+ else: -+ string = '%s%s' % (string, c) - - if started: - if mode == 'parens': -@@ -714,8 +714,8 @@ class DBText(object): - elif self.header[col]['auto']: - new_row[col] = self._GetNextAuto(col) - -- else: -- raise ExecuteError(col + ' cannot be empty or null') -+ else: -+ raise ExecuteError(col + ' cannot be empty or null') - - self.data.append(new_row) - return [1] --- -2.26.2 - diff --git a/debian/patches/upstream/utils-kamctl-fix-handling-of-Exceptions.patch b/debian/patches/upstream/utils-kamctl-fix-handling-of-Exceptions.patch deleted file mode 100644 index d075469fd..000000000 --- a/debian/patches/upstream/utils-kamctl-fix-handling-of-Exceptions.patch +++ /dev/null @@ -1,88 +0,0 @@ -From 5f6f4331811e654e75b49263f8fb823bea9874a3 Mon Sep 17 00:00:00 2001 -From: Victor Seva -Date: Mon, 4 May 2020 11:33:12 +0200 -Subject: [PATCH] utils/kamctl: fix handling of Exceptions - -> Traceback (most recent call last): -> File "/usr/lib/x86_64-linux-gnu/kamailio/kamctl/dbtextdb/dbtextdb.py", line 1239, in -> main(sys.argv) -> File "/usr/lib/x86_64-linux-gnu/kamailio/kamctl/dbtextdb/dbtextdb.py", line 1233, in main -> except (Error, e): -> NameError: name 'e' is not defined - -(cherry picked from commit 1aca79c43cb8dbd920c1eb81c0c30cf89f0985b9) ---- - utils/kamctl/dbtextdb/dbtextdb.py | 22 ++++++++++------------ - 1 file changed, 10 insertions(+), 12 deletions(-) - -diff --git a/utils/kamctl/dbtextdb/dbtextdb.py b/utils/kamctl/dbtextdb/dbtextdb.py -index 3a35554013..3d5ee7ecc5 100755 ---- a/utils/kamctl/dbtextdb/dbtextdb.py -+++ b/utils/kamctl/dbtextdb/dbtextdb.py -@@ -356,7 +356,7 @@ class DBText(object): - # test that the value is string, if not return it as is - try: - value.find('a') -- except: -+ except Exception: - return value - - escaped = value -@@ -377,7 +377,7 @@ class DBText(object): - # test that the value is string, if not return it as is - try: - value.find('a') -- except: -+ except Exception: - return value - - escaped = value -@@ -988,21 +988,19 @@ class DBText(object): - if not val and not self.header[col]['null']: - raise ExecuteError(col + ' cannot be empty or null') - -- if (self.header[col]['type'].lower() == 'int' or -- self.header[col]['type'].lower() == 'double'): -+ hdr_t = self.header[col]['type'].lower() -+ if hdr_t == 'int' or hdr_t == 'double': - try: - if val: - val = eval(val) -- except (NameError, e): -+ except NameError as e: - raise ExecuteError('Failed to parse %s in %s ' - '(unable to convert to type %s): %s' % -- (col, self.table, self.header[col]['type'], -- e)) -- except (SyntaxError, e): -+ (col, self.table, hdr_t, e)) -+ except SyntaxError as e: - raise ExecuteError('Failed to parse %s in %s ' - '(unable to convert to type %s): %s' % -- (col, self.table, self.header[col]['type'], -- e)) -+ (col, self.table, hdr_t, e)) - - return val - -@@ -1083,7 +1081,7 @@ class DBText(object): - # save a copy of the data before modifying - self.orig_data = self.data[:] - -- except (IOError, e): -+ except IOError as e: - raise ExecuteError('Unable to open table %s: %s' % (self.table, e)) - - Debug('Header is: %s' % self.header) -@@ -1230,7 +1228,7 @@ def main(argv): - print('Updated %s, rows affected: %d' % (conn.table, row)) - else: - print(row) -- except (Error, e): -+ except Error as e: - print(e) - sys.exit(1) - --- -2.26.2 -