diff --git a/debian/patches/debian/fix_export.patch b/debian/patches/debian/fix_export.patch index caf414b74..4da231853 100644 --- a/debian/patches/debian/fix_export.patch +++ b/debian/patches/debian/fix_export.patch @@ -7,7 +7,7 @@ Subject: fix_export 1 file changed, 2 insertions(+) diff --git a/src/Makefile b/src/Makefile -index 7c78f6c..eb1a8c6 100644 +index a006d88..41c3624 100644 --- a/src/Makefile +++ b/src/Makefile @@ -139,6 +139,8 @@ endif diff --git a/debian/patches/debian/no_INSTALL_file.patch b/debian/patches/debian/no_INSTALL_file.patch index 007547ef8..3edee8f3d 100644 --- a/debian/patches/debian/no_INSTALL_file.patch +++ b/debian/patches/debian/no_INSTALL_file.patch @@ -7,7 +7,7 @@ Subject: no_INSTALL_file 1 file changed, 2 deletions(-) diff --git a/src/Makefile b/src/Makefile -index 6c2b35b..7c78f6c 100644 +index 28106b0..a006d88 100644 --- a/src/Makefile +++ b/src/Makefile @@ -858,8 +858,6 @@ install-modules-all: install-every-module install-every-module-doc diff --git a/debian/patches/debian/no_lib64_on_64_bits.patch b/debian/patches/debian/no_lib64_on_64_bits.patch index a16c3e853..bd4d37795 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 d393653..f43d100 100644 +index 0f960b4..e76f3f7 100644 --- a/src/Makefile.defs +++ b/src/Makefile.defs -@@ -458,15 +458,7 @@ endif +@@ -454,15 +454,7 @@ endif $(info target architecture <$(ARCH)>, host architecture <$(HOST_ARCH)>) diff --git a/debian/patches/series b/debian/patches/series index 59abeb6e4..4cc92f5e1 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -34,29 +34,16 @@ sipwise/sca-add-pai_avp-parameter.patch ## upstream 5.7 # ## upstream master -sipwise/pv_headers-rework-pvh_remove_header_param-take-two.patch -upstream/pv_headers-compare-result-of-pvh_set_xavi-with-NULL-.patch -sipwise/pua_dialoginfo-fix-dlg_var-store-and-retrieval.patch -upstream/http_client-Add-parameter-timeout_mode-timeout-in-se.patch -upstream/core-timer_proc-don-t-execute-timers-on-destroy_modu.patch +upstream/rtpengine_rework_rtpp_flags.patch ### relevant for upstream sipwise/dialplan-don-t-stop-loading-rules-on-error.patch -sipwise/cfgt-skip_unknown.patch -sipwise/cfgt-skip_duplicate_dump.patch -sipwise/cfgt-route-log.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/kamctl-TMPDIR-config.patch sipwise/lcr-stopper_mode-parameter.patch sipwise/lcr-stats.patch sipwise/lcr_read_id.patch sipwise/dialog-support-profile_get_size-for-all-profiles.patch -sipwise/rtpengine-set-mime-content-length.patch sipwise/presence_vqr.patch sipwise/dialog-dlg_get_ttag.patch -sipwise/rtpengine_rework_rtpp_flags.patch ### active development # ### Don't just put stuff in any order diff --git a/debian/patches/sipwise/add_lcr_rate_module.patch b/debian/patches/sipwise/add_lcr_rate_module.patch index e577143db..ce3b0ce44 100644 --- a/debian/patches/sipwise/add_lcr_rate_module.patch +++ b/debian/patches/sipwise/add_lcr_rate_module.patch @@ -13,10 +13,10 @@ Subject: add_lcr_rate_module create mode 100644 src/modules/lcr_rate/lcr_rate_mod.c diff --git a/src/Makefile.groups b/src/Makefile.groups -index 4dcac9e..c419f7d 100644 +index 763a870..955fbec 100644 --- a/src/Makefile.groups +++ b/src/Makefile.groups -@@ -112,6 +112,9 @@ mod_list_sctp=sctp +@@ -109,6 +109,9 @@ mod_list_sctp=sctp # - modules depending on openssl library mod_list_autheph=auth_ephemeral @@ -26,10 +26,10 @@ index 4dcac9e..c419f7d 100644 # - modules related to SIMPLE presence extensions mod_list_presence=presence presence_conference presence_dialoginfo \ presence_mwi presence_profile presence_reginfo \ -@@ -284,8 +287,8 @@ mod_list_all=$(sort $(mod_list_basic) $(mod_list_extra) \ - $(mod_list_stirshaken) \ - $(mod_list_tlsa) \ +@@ -289,8 +292,8 @@ mod_list_all=$(sort $(mod_list_basic) $(mod_list_extra) \ $(mod_list_tls_wolfssl) \ + $(mod_list_microhttpd) \ + $(mod_list_gcrypt) \ - $(mod_list_rtp_media_server) - + $(mod_list_rtp_media_server) \ @@ -37,7 +37,7 @@ index 4dcac9e..c419f7d 100644 ### --- Groups defined for source code compilation ### -@@ -342,6 +345,8 @@ module_group_cassandra=$(module_group_cassandra_driver) $(module_group_db) +@@ -347,6 +350,8 @@ module_group_cassandra=$(module_group_cassandra_driver) $(module_group_db) module_group_ignore= $(sort $(filter-out $(module_group_default), $(mod_list_all))) @@ -47,7 +47,7 @@ index 4dcac9e..c419f7d 100644 ### --- Groups defined for pacKaging ### diff --git a/src/core/mod_fix.c b/src/core/mod_fix.c -index ecd870c..78245c9 100644 +index 10be560..80b6eea 100644 --- a/src/core/mod_fix.c +++ b/src/core/mod_fix.c @@ -598,6 +598,7 @@ int fixup_free_igp_spve(void **param, int param_no) @@ -68,7 +68,7 @@ index ecd870c..78245c9 100644 } diff --git a/src/core/mod_fix.h b/src/core/mod_fix.h -index a76d64f..e4fe17e 100644 +index 3143f06..37b6b97 100644 --- a/src/core/mod_fix.h +++ b/src/core/mod_fix.h @@ -138,6 +138,8 @@ int fixup_spve_uint(void **param, int param_no); diff --git a/debian/patches/sipwise/add_pcem_module.patch b/debian/patches/sipwise/add_pcem_module.patch index f34301c34..b2811c76c 100644 --- a/debian/patches/sipwise/add_pcem_module.patch +++ b/debian/patches/sipwise/add_pcem_module.patch @@ -17,7 +17,7 @@ Subject: add_pcem_module create mode 100644 src/modules/pcem/pcem_mod.h diff --git a/src/Makefile.groups b/src/Makefile.groups -index ee4ec90..4dcac9e 100644 +index fec21d4..763a870 100644 --- a/src/Makefile.groups +++ b/src/Makefile.groups @@ -30,8 +30,8 @@ mod_list_db=acc alias_db auth_db avpops cfg_db db_text db_flatstore \ diff --git a/debian/patches/sipwise/add_presence_dfks_module.patch b/debian/patches/sipwise/add_presence_dfks_module.patch index cc5e271f1..ecb4e7201 100644 --- a/debian/patches/sipwise/add_presence_dfks_module.patch +++ b/debian/patches/sipwise/add_presence_dfks_module.patch @@ -22,10 +22,10 @@ Subject: add_presence_dfks_module create mode 100644 src/modules/presence_dfks/presence_dfks.h diff --git a/src/Makefile.groups b/src/Makefile.groups -index b85c1c5..f61bcec 100644 +index 912f126..698847f 100644 --- a/src/Makefile.groups +++ b/src/Makefile.groups -@@ -121,7 +121,7 @@ mod_list_presence=presence presence_conference presence_dialoginfo \ +@@ -118,7 +118,7 @@ mod_list_presence=presence presence_conference presence_dialoginfo \ presence_xml \ pua pua_bla pua_dialoginfo pua_reginfo \ pua_rpc pua_usrloc pua_xmpp \ @@ -592,7 +592,7 @@ index 0000000..d58301b + +#endif diff --git a/src/modules/pua/add_events.c b/src/modules/pua/add_events.c -index e2fc78b..8e07a84 100644 +index bf4a437..a6dddd8 100644 --- a/src/modules/pua/add_events.c +++ b/src/modules/pua/add_events.c @@ -107,6 +107,13 @@ int pua_add_events(void) diff --git a/debian/patches/sipwise/add_tcap_module.patch b/debian/patches/sipwise/add_tcap_module.patch index 55a017fe2..55c44e2a4 100644 --- a/debian/patches/sipwise/add_tcap_module.patch +++ b/debian/patches/sipwise/add_tcap_module.patch @@ -11,20 +11,20 @@ Subject: add_tcap_module create mode 100644 src/modules/tcap/tcap_mod.c diff --git a/src/Makefile.groups b/src/Makefile.groups -index c419f7d..b85c1c5 100644 +index 955fbec..912f126 100644 --- a/src/Makefile.groups +++ b/src/Makefile.groups -@@ -217,6 +217,9 @@ mod_list_erlang=erlang +@@ -214,6 +214,9 @@ mod_list_erlang=erlang # - modules depending on systemd library mod_list_systemd=log_systemd systemdops +# - modules depending on libtcap library +mod_list_tcap=tcap + - # - modules depending on libnsq (+libev libevbuffsock liblcurl libjson-c) library + # - modules depending on libnsq (+libev libevbuffsock libcurl libjson-c) library mod_list_nsq=nsq -@@ -348,6 +351,9 @@ module_group_ignore= $(sort $(filter-out $(module_group_default), $(mod_list_all +@@ -353,6 +356,9 @@ module_group_ignore= $(sort $(filter-out $(module_group_default), $(mod_list_all # pkg lcrrate module module_group_klcrrate=$(mod_list_lcrrate) diff --git a/debian/patches/sipwise/cfgt-route-log.patch b/debian/patches/sipwise/cfgt-route-log.patch deleted file mode 100644 index 5591fdf13..000000000 --- a/debian/patches/sipwise/cfgt-route-log.patch +++ /dev/null @@ -1,207 +0,0 @@ -From: Victor Seva -Date: Wed, 29 Mar 2023 12:12:54 +0200 -Subject: cfgt: route log - ---- - src/modules/cfgt/cfgt_int.c | 39 ++++++++++++++++++++++++++++++++++++- - src/modules/cfgt/cfgt_int.h | 3 ++- - src/modules/cfgt/cfgt_mod.c | 4 +++- - src/modules/cfgt/doc/cfgt_admin.xml | 19 ++++++++++++++++++ - 4 files changed, 62 insertions(+), 3 deletions(-) - -diff --git a/src/modules/cfgt/cfgt_int.c b/src/modules/cfgt/cfgt_int.c -index 15f0606..56e3376 100644 ---- a/src/modules/cfgt/cfgt_int.c -+++ b/src/modules/cfgt/cfgt_int.c -@@ -1,6 +1,6 @@ - /** - * -- * Copyright (C) 2015 Victor Seva (sipwise.com) -+ * Copyright (C) 2015-2023 Victor Seva (sipwise.com) - * - * This file is part of Kamailio, a free SIP server. - * -@@ -22,6 +22,7 @@ - #define _GNU_SOURCE - #include - #include -+#include - #include - #include - #include -@@ -45,6 +46,7 @@ str cfgt_hdr_prefix = {"NGCP%", 5}; - str cfgt_basedir = {"/tmp", 4}; - int cfgt_mask = CFGT_DP_ALL; - int cfgt_skip_unknown = 0; -+int cfgt_route_log = 0; - int not_sip = 0; - - int _cfgt_get_filename(int msgid, str uuid, str *dest, int *dir); -@@ -463,6 +465,7 @@ int _cfgt_set_dump(struct sip_msg *msg, cfgt_node_p node, str *flow) - { - int len; - char v; -+ unsigned long int tdiff; - srjson_t *f, *vars; - - if(node == NULL || flow == NULL) -@@ -494,6 +497,17 @@ int _cfgt_set_dump(struct sip_msg *msg, cfgt_node_p node, str *flow) - return -1; - } - -+ if(node->route->duration.tv_usec > 0) { -+ tdiff = (node->route->duration.tv_sec) * 1000000 -+ + (node->route->duration.tv_usec); -+ f = srjson_CreateNumber(&node->jdoc, tdiff); -+ if(f == NULL) { -+ LM_ERR("cannot create json object\n"); -+ return -1; -+ } -+ srjson_AddItemToObject(&node->jdoc, vars, "execution_usec", f); -+ } -+ - f = srjson_CreateObject(&node->jdoc); - if(f == NULL) { - LM_ERR("cannot create json object\n"); -@@ -506,6 +520,21 @@ int _cfgt_set_dump(struct sip_msg *msg, cfgt_node_p node, str *flow) - return 0; - } - -+static void _cfgt_log_route(cfgt_str_list_p route) -+{ -+ unsigned long int tdiff; -+ if(!route) { -+ LM_BUG("empty route\n"); -+ return; -+ } -+ -+ if(route->duration.tv_usec > 0) { -+ tdiff = (route->duration.tv_sec) * 1000000 + (route->duration.tv_usec); -+ LM_WARN("[%.*s] exectime=%lu usec\n", route->s.len, route->s.s, -+ tdiff); -+ } -+} -+ - void _cfgt_set_type(cfgt_str_list_p route, struct action *a) - { - switch(a->type) { -@@ -521,6 +550,8 @@ void _cfgt_set_type(cfgt_str_list_p route, struct action *a) - route->type = CFGT_DROP_E; - LM_DBG("set[%.*s]->CFGT_DROP_E\n", route->s.len, route->s.s); - } -+ gettimeofday(&route->end, NULL); -+ timersub(&route->end, &route->start, &route->duration); - break; - case ROUTE_T: - route->type = CFGT_ROUTE; -@@ -535,6 +566,8 @@ void _cfgt_set_type(cfgt_str_list_p route, struct action *a) - LM_DBG("[%.*s] already set to CFGT_DROP_E[%d]\n", route->s.len, - route->s.s, a->type); - } -+ gettimeofday(&route->end, NULL); -+ timersub(&route->end, &route->start, &route->duration); - break; - } - } -@@ -554,6 +587,7 @@ int _cfgt_add_routename(cfgt_node_p node, struct action *a, str *routename) - memset(node->route, 0, sizeof(cfgt_str_list_t)); - node->flow_head = node->route; - node->route->type = CFGT_ROUTE; -+ gettimeofday(&node->route->start, NULL); - ret = 1; - } else { - LM_DBG("actual routename:[%.*s][%d]\n", node->route->s.len, -@@ -601,6 +635,7 @@ int _cfgt_add_routename(cfgt_node_p node, struct action *a, str *routename) - route->prev = node->route; - node->route->next = route; - node->route = route; -+ gettimeofday(&node->route->start, NULL); - _cfgt_set_type(node->route, a); - } - node->route->s.s = routename->s; -@@ -618,6 +653,8 @@ void _cfgt_del_routename(cfgt_node_p node) - } - LM_DBG("del route[%.*s]\n", node->route->s.len, node->route->s.s); - node->route = node->route->prev; -+ if(cfgt_route_log) -+ _cfgt_log_route(node->route->next); - pkg_free(node->route->next); - node->route->next = NULL; - } -diff --git a/src/modules/cfgt/cfgt_int.h b/src/modules/cfgt/cfgt_int.h -index 197e4bb..1564daa 100644 ---- a/src/modules/cfgt/cfgt_int.h -+++ b/src/modules/cfgt/cfgt_int.h -@@ -1,6 +1,6 @@ - /** - * -- * Copyright (C) 2015 Victor Seva (sipwise.com) -+ * Copyright (C) 2015-2023 Victor Seva (sipwise.com) - * - * This file is part of Kamailio, a free SIP server. - * -@@ -48,6 +48,7 @@ typedef struct _cfgt_str_list - { - str s; - enum _cfgt_action_type type; -+ struct timeval start, end, duration; - struct _cfgt_str_list *next, *prev; - } cfgt_str_list_t, *cfgt_str_list_p; - -diff --git a/src/modules/cfgt/cfgt_mod.c b/src/modules/cfgt/cfgt_mod.c -index 7dec36a..4809426 100644 ---- a/src/modules/cfgt/cfgt_mod.c -+++ b/src/modules/cfgt/cfgt_mod.c -@@ -1,5 +1,5 @@ - /* -- * Copyright (C) 2015 Victor Seva (sipwise.com) -+ * Copyright (C) 2015-2023 Victor Seva (sipwise.com) - * - * This file is part of Kamailio, a free SIP server. - * -@@ -43,6 +43,7 @@ extern int cfgt_mask; - extern str cfgt_basedir; - extern str cfgt_hdr_prefix; - extern int cfgt_skip_unknown; -+extern int cfgt_route_log; - /* clang-format off */ - /*! \brief - * Exported functions -@@ -60,6 +61,7 @@ static param_export_t params[] = { - {"mask", INT_PARAM, &cfgt_mask}, - {"callid_prefix", PARAM_STR, &cfgt_hdr_prefix}, - {"skip_unknown", INT_PARAM, &cfgt_skip_unknown}, -+ {"route_log", INT_PARAM, &cfgt_route_log}, - {0, 0, 0} - }; - -diff --git a/src/modules/cfgt/doc/cfgt_admin.xml b/src/modules/cfgt/doc/cfgt_admin.xml -index b3af2de..4975a5c 100644 ---- a/src/modules/cfgt/doc/cfgt_admin.xml -+++ b/src/modules/cfgt/doc/cfgt_admin.xml -@@ -163,6 +163,25 @@ modparam("cfgt", "callid_prefix", "TEST-ID%") - ... - modparam("cfgt", "skip_unknown", "1") - ... -+ -+ -+ -+
-+ <varname>route_log</varname> (int) -+ -+ If enabled, value different from 0, cfgt will log (WARN) the execution time of routes. -+ -+ -+ -+ Default value is 0, false. -+ -+ -+ -+ Set <varname>route_log</varname> parameter -+ -+... -+modparam("cfgt", "route_log", "1") -+... - - -
diff --git a/debian/patches/sipwise/cfgt-skip_duplicate_dump.patch b/debian/patches/sipwise/cfgt-skip_duplicate_dump.patch deleted file mode 100644 index 425968bde..000000000 --- a/debian/patches/sipwise/cfgt-skip_duplicate_dump.patch +++ /dev/null @@ -1,91 +0,0 @@ -From: Victor Seva -Date: Fri, 17 Mar 2023 16:08:00 +0100 -Subject: cfgt: don't dump same node - ---- - src/modules/cfgt/cfgt_int.c | 41 ++++++++++++++++++++++++++++++++++++++++- - 1 file changed, 40 insertions(+), 1 deletion(-) - -diff --git a/src/modules/cfgt/cfgt_int.c b/src/modules/cfgt/cfgt_int.c -index ed2204b..15f0606 100644 ---- a/src/modules/cfgt/cfgt_int.c -+++ b/src/modules/cfgt/cfgt_int.c -@@ -32,6 +32,7 @@ - #include "../../core/rpc.h" - #include "../../core/rpc_lookup.h" - #include "../../core/parser/msg_parser.h" -+#include "../../core/script_cb.h" - - #include "cfgt_int.h" - #include "cfgt_json.h" -@@ -460,11 +461,25 @@ void _cfgt_print_node(cfgt_node_p node, int json) - - int _cfgt_set_dump(struct sip_msg *msg, cfgt_node_p node, str *flow) - { -+ int len; -+ char v; - srjson_t *f, *vars; - - if(node == NULL || flow == NULL) - return -1; - -+ /* don't generate two same nodes */ -+ if((len = srjson_GetArraySize(&node->jdoc, node->flow)) >= 1) { -+ f = srjson_GetArrayItem(&node->jdoc, node->flow, len - 1); -+ STR_VTOZ(flow->s[flow->len], v); -+ f = srjson_GetObjectItem(&node->jdoc, f, flow->s); -+ STR_ZTOV(flow->s[flow->len], v); -+ if(f != NULL) { -+ LM_DBG("node[%.*s] flow already there\n", flow->len, flow->s); -+ return 0; -+ } -+ } -+ - vars = srjson_CreateObject(&node->jdoc); - if(vars == NULL) { - LM_ERR("cannot create json object\n"); -@@ -763,11 +778,35 @@ int cfgt_msgin(sr_event_param_t *evp) - return -1; - } - -+static inline void print_cb_flags(unsigned int flags) -+{ -+ LM_DBG("flags:"); -+ if(flags & REQUEST_CB) -+ LM_DBG("REQUEST_CB"); -+ if(flags & FAILURE_CB) -+ LM_DBG("FAILURE_CB"); -+ if(flags & ONREPLY_CB) -+ LM_DBG("ONREPLY_CB"); -+ if(flags & BRANCH_CB) -+ LM_DBG("BRANCH_CB"); -+ if(flags & ONSEND_CB) -+ LM_DBG("ONSEND_CB"); -+ if(flags & ERROR_CB) -+ LM_DBG("ERROR_CB"); -+ if(flags & LOCAL_CB) -+ LM_DBG("LOCAL_CB"); -+ if(flags & EVENT_CB) -+ LM_DBG("EVENT_CB"); -+ if(flags & BRANCH_FAILURE_CB) -+ LM_DBG("BRANCH_FAILURE_CB"); -+} -+ - int cfgt_pre(struct sip_msg *msg, unsigned int flags, void *bar) - { - str unknown = {"unknown", 7}; - int get_hdr_result = 0, res; - -+ print_cb_flags(flags); - if(_cfgt_node) { - if(_cfgt_node->msgid == 0) { - LM_DBG("new node\n"); -@@ -812,7 +851,7 @@ int cfgt_pre(struct sip_msg *msg, unsigned int flags, void *bar) - int cfgt_post(struct sip_msg *msg, unsigned int flags, void *bar) - { - str flowname = STR_NULL; -- -+ print_cb_flags(flags); - if(_cfgt_node) { - if(cfgt_skip_unknown && strncmp(_cfgt_node->uuid.s, "unknown", 7) == 0) { - return 1; diff --git a/debian/patches/sipwise/cfgt-skip_unknown.patch b/debian/patches/sipwise/cfgt-skip_unknown.patch deleted file mode 100644 index bc7a12a88..000000000 --- a/debian/patches/sipwise/cfgt-skip_unknown.patch +++ /dev/null @@ -1,114 +0,0 @@ -From: Victor Seva -Date: Wed, 27 Apr 2022 15:49:30 +0200 -Subject: cfgt: skip_unknown - ---- - src/modules/cfgt/cfgt_int.c | 14 ++++++++++++++ - src/modules/cfgt/cfgt_mod.c | 2 ++ - src/modules/cfgt/doc/cfgt_admin.xml | 20 ++++++++++++++++++++ - 3 files changed, 36 insertions(+) - -diff --git a/src/modules/cfgt/cfgt_int.c b/src/modules/cfgt/cfgt_int.c -index 2509b3e..ed2204b 100644 ---- a/src/modules/cfgt/cfgt_int.c -+++ b/src/modules/cfgt/cfgt_int.c -@@ -43,6 +43,7 @@ cfgt_hash_p _cfgt_uuid = NULL; - str cfgt_hdr_prefix = {"NGCP%", 5}; - str cfgt_basedir = {"/tmp", 4}; - int cfgt_mask = CFGT_DP_ALL; -+int cfgt_skip_unknown = 0; - int not_sip = 0; - - int _cfgt_get_filename(int msgid, str uuid, str *dest, int *dir); -@@ -385,6 +386,10 @@ void cfgt_save_node(cfgt_node_p node) - str dest = STR_NULL; - int dir = 0; - struct stat sb; -+ if(cfgt_skip_unknown && strncmp(_cfgt_node->uuid.s, "unknown", 7) == 0) { -+ LM_DBG("skip unknown\n"); -+ return; -+ } - if(_cfgt_get_filename(node->msgid, node->uuid, &dest, &dir) < 0) { - LM_ERR("can't build filename\n"); - return; -@@ -658,6 +663,9 @@ int cfgt_process_route(struct sip_msg *msg, struct action *a) - LM_ERR("node empty\n"); - return -1; - } -+ if(cfgt_skip_unknown && strncmp(_cfgt_node->uuid.s, "unknown", 7) == 0) { -+ return 0; -+ } - if(a->rname == NULL) { - LM_DBG("no routename. type:%d\n", a->type); - return 0; -@@ -806,6 +814,9 @@ int cfgt_post(struct sip_msg *msg, unsigned int flags, void *bar) - str flowname = STR_NULL; - - if(_cfgt_node) { -+ if(cfgt_skip_unknown && strncmp(_cfgt_node->uuid.s, "unknown", 7) == 0) { -+ return 1; -+ } - LM_DBG("dump last flow\n"); - if(_cfgt_node->route == NULL - && strncmp(_cfgt_node->uuid.s, "unknown", 7) == 0) -@@ -844,6 +855,9 @@ int cfgt_msgout(sr_event_param_t *evp) - } - - if(_cfgt_node) { -+ if(cfgt_skip_unknown && strncmp(_cfgt_node->uuid.s, "unknown", 7) == 0) { -+ return 0; -+ } - jobj = srjson_CreateStr(&_cfgt_node->jdoc, buf->s, buf->len); - if(jobj == NULL) { - LM_ERR("cannot create json object\n"); -diff --git a/src/modules/cfgt/cfgt_mod.c b/src/modules/cfgt/cfgt_mod.c -index 728d228..7dec36a 100644 ---- a/src/modules/cfgt/cfgt_mod.c -+++ b/src/modules/cfgt/cfgt_mod.c -@@ -42,6 +42,7 @@ unsigned int init_flag = 0; - extern int cfgt_mask; - extern str cfgt_basedir; - extern str cfgt_hdr_prefix; -+extern int cfgt_skip_unknown; - /* clang-format off */ - /*! \brief - * Exported functions -@@ -58,6 +59,7 @@ static param_export_t params[] = { - {"basedir", PARAM_STR, &cfgt_basedir}, - {"mask", INT_PARAM, &cfgt_mask}, - {"callid_prefix", PARAM_STR, &cfgt_hdr_prefix}, -+ {"skip_unknown", INT_PARAM, &cfgt_skip_unknown}, - {0, 0, 0} - }; - -diff --git a/src/modules/cfgt/doc/cfgt_admin.xml b/src/modules/cfgt/doc/cfgt_admin.xml -index 920b1bf..b3af2de 100644 ---- a/src/modules/cfgt/doc/cfgt_admin.xml -+++ b/src/modules/cfgt/doc/cfgt_admin.xml -@@ -143,6 +143,26 @@ modparam("cfgt", "mask", 12) - # using '%' as delimiter - modparam("cfgt", "callid_prefix", "TEST-ID%") - ... -+ -+ -+ -+
-+ <varname>skip_unknown</varname> (int) -+ -+ If enabled, value different from 0, cfgt will not generate the report -+ of any message that doesn't match the callid_prefix. -+ -+ -+ -+ Default value is 0, false. -+ -+ -+ -+ Set <varname>skip_unknown</varname> parameter -+ -+... -+modparam("cfgt", "skip_unknown", "1") -+... - - -
diff --git a/debian/patches/sipwise/db_redis_graceful_scan.patch b/debian/patches/sipwise/db_redis_graceful_scan.patch deleted file mode 100644 index 742f79eb9..000000000 --- a/debian/patches/sipwise/db_redis_graceful_scan.patch +++ /dev/null @@ -1,63 +0,0 @@ -From: Sipwise Development Team -Date: Wed, 12 May 2021 11:53:43 +0200 -Subject: db_redis_graceful_scan - ---- - src/modules/db_redis/redis_dbase.c | 20 ++++++++++++++++---- - 1 file changed, 16 insertions(+), 4 deletions(-) - -diff --git a/src/modules/db_redis/redis_dbase.c b/src/modules/db_redis/redis_dbase.c -index 0cf2791..1d8721d 100644 ---- a/src/modules/db_redis/redis_dbase.c -+++ b/src/modules/db_redis/redis_dbase.c -@@ -824,7 +824,7 @@ static int db_redis_scan_query_keys_pattern(km_redis_con_t *con, - int l; - - --#undef USE_SCAN -+#define USE_SCAN - - #ifdef USE_SCAN - -@@ -832,6 +832,8 @@ static int db_redis_scan_query_keys_pattern(km_redis_con_t *con, - unsigned long cursor = 0; - unsigned int match_count = match_count_start_val; - char match_count_str[16]; -+ struct timeval start_tv, end_tv; -+ long tv_diff; - - do { - snprintf(cursor_str, sizeof(cursor_str), "%lu", cursor); -@@ -870,7 +872,13 @@ static int db_redis_scan_query_keys_pattern(km_redis_con_t *con, - goto err; - } - -+ gettimeofday(&start_tv, NULL); - reply = db_redis_command_argv(con, query_v); -+ gettimeofday(&end_tv, NULL); -+ tv_diff = ((long long)end_tv.tv_sec * 1000LL + end_tv.tv_usec / 1000L) -+ - ((long long)start_tv.tv_sec * 1000LL -+ + start_tv.tv_usec / 1000L); -+ - db_redis_key_free(&query_v); - db_redis_check_reply(con, reply, err); - if(reply->type != REDIS_REPLY_ARRAY) { -@@ -966,11 +974,15 @@ static int db_redis_scan_query_keys_pattern(km_redis_con_t *con, - } - - #ifdef USE_SCAN -- // exponential increase and falloff, hovering around 1000 results -- if(keys_list->elements > 1300 && match_count > 500) -+ // exponential increase and falloff, not to exceed ~100 ms query run time -+ if(tv_diff > 50 && match_count > 10) - match_count /= 2; -- else if(keys_list->elements < 700 && match_count < 500000) -+ else if(tv_diff < 25 && match_count < 1000000) - match_count *= 2; -+ if(cursor > 0) { -+ // give other queries some time to run -+ usleep(100000); -+ } - #endif - - db_redis_free_reply(&reply); diff --git a/debian/patches/sipwise/db_redis_skip_empty_keys.patch b/debian/patches/sipwise/db_redis_skip_empty_keys.patch deleted file mode 100644 index 3c50d8343..000000000 --- a/debian/patches/sipwise/db_redis_skip_empty_keys.patch +++ /dev/null @@ -1,22 +0,0 @@ -From: Sipwise Development Team -Date: Wed, 12 May 2021 11:53:43 +0200 -Subject: db_redis_skip_empty_keys - ---- - src/modules/db_redis/redis_dbase.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/src/modules/db_redis/redis_dbase.c b/src/modules/db_redis/redis_dbase.c -index ce65628..0cf2791 100644 ---- a/src/modules/db_redis/redis_dbase.c -+++ b/src/modules/db_redis/redis_dbase.c -@@ -700,6 +700,9 @@ static int db_redis_build_query_keys(km_redis_con_t *con, const str *table_name, - LM_DBG("no direct entry key found, checking type keys\n"); - for(type = table->types; type; type = type->next) { - key = type->keys; -+ /* skip value-less master keys */ -+ if(!key) -+ continue; - LM_DBG("checking type '%.*s'\n", type->type.len, type->type.s); - if(db_redis_find_query_key(key, table_name, table, &type->type, _k, - _v, _op, _n, &keyname, &key_found, ts_scan_start) diff --git a/debian/patches/sipwise/db_redis_sscan.patch b/debian/patches/sipwise/db_redis_sscan.patch deleted file mode 100644 index 0404bb5b6..000000000 --- a/debian/patches/sipwise/db_redis_sscan.patch +++ /dev/null @@ -1,338 +0,0 @@ -From: Sipwise Development Team -Date: Wed, 12 May 2021 11:53:43 +0200 -Subject: db_redis_sscan - ---- - src/modules/db_redis/redis_dbase.c | 116 +++++++++++++++++++++++++++---------- - 1 file changed, 84 insertions(+), 32 deletions(-) - -diff --git a/src/modules/db_redis/redis_dbase.c b/src/modules/db_redis/redis_dbase.c -index 1d8721d..b98e0f3 100644 ---- a/src/modules/db_redis/redis_dbase.c -+++ b/src/modules/db_redis/redis_dbase.c -@@ -646,7 +646,7 @@ static int db_redis_build_query_keys(km_redis_con_t *con, const str *table_name, - const db_key_t *_k, const db_val_t *_v, const db_op_t *_op, - const int _n, redis_key_t **query_keys, int *query_keys_count, - int **manual_keys, int *manual_keys_count, int *do_table_scan, -- uint64_t *ts_scan_start, str *ts_scan_key) -+ uint64_t *ts_scan_start, str *ts_scan_key, str *ts_scan_table) - { - - struct str_hash_entry *table_e; -@@ -775,6 +775,22 @@ static int db_redis_build_query_keys(km_redis_con_t *con, const str *table_name, - keyname.len, keyname.s, - (unsigned long long)*ts_scan_start); - *ts_scan_key = keyname; -+ if(ts_scan_table) { -+ if(ts_scan_table->s) -+ pkg_free(ts_scan_table->s); -+ // :::index:: -+ ts_scan_table->len = table->version_code.len -+ + table_name->len + 9 + type->type.len; -+ ts_scan_table->s = pkg_malloc(ts_scan_table->len + 1); -+ if(!ts_scan_table->s) { -+ LM_ERR("Failed to allocate memory for ts_scan_table\n"); -+ goto err; -+ } -+ sprintf(ts_scan_table->s, "%.*s%.*s::index::%.*s", -+ table->version_code.len, table->version_code.s, -+ table_name->len, table_name->s, type->type.len, -+ type->type.s); -+ } - keyname.s = NULL; - } else if(keyname.s) { - pkg_free(keyname.s); -@@ -811,9 +827,9 @@ err: - } - - static int db_redis_scan_query_keys_pattern(km_redis_con_t *con, -- const str *match_pattern, const int _n, redis_key_t **query_keys, -- int *query_keys_count, int **manual_keys, int *manual_keys_count, -- unsigned int match_count_start_val) -+ const str *match_pattern, const str *index_key, const int _n, -+ redis_key_t **query_keys, int *query_keys_count, int **manual_keys, -+ int *manual_keys_count, unsigned int match_count_start_val) - { - - size_t i = 0; -@@ -838,9 +854,21 @@ static int db_redis_scan_query_keys_pattern(km_redis_con_t *con, - do { - snprintf(cursor_str, sizeof(cursor_str), "%lu", cursor); - -- if(db_redis_key_add_string(&query_v, "SCAN", 4) != 0) { -- LM_ERR("Failed to add scan command to scan query\n"); -- goto err; -+ if(!index_key) { -+ if(db_redis_key_add_string(&query_v, "SCAN", 4) != 0) { -+ LM_ERR("Failed to add scan command to scan query\n"); -+ goto err; -+ } -+ } else { -+ if(db_redis_key_add_string(&query_v, "SSCAN", 5) != 0) { -+ LM_ERR("Failed to add scan command to scan query\n"); -+ goto err; -+ } -+ if(db_redis_key_add_string(&query_v, index_key->s, index_key->len) -+ != 0) { -+ LM_ERR("Failed to add scan command to scan query\n"); -+ goto err; -+ } - } - if(db_redis_key_add_string(&query_v, cursor_str, strlen(cursor_str)) - != 0) { -@@ -1033,7 +1061,7 @@ return -1; - static int db_redis_scan_query_keys(km_redis_con_t *con, const str *table_name, - const int _n, redis_key_t **query_keys, int *query_keys_count, - int **manual_keys, int *manual_keys_count, uint64_t ts_scan_start, -- const str *ts_scan_key) -+ const str *ts_scan_key, const str *ts_scan_table) - { - - struct str_hash_entry *table_e; -@@ -1070,9 +1098,9 @@ static int db_redis_scan_query_keys(km_redis_con_t *con, const str *table_name, - int len = sprintf(match, "%.*s%.*s:entry::*", table->version_code.len, - table->version_code.s, table_name->len, table_name->s); - str match_pattern = {match, len}; -- ret = db_redis_scan_query_keys_pattern(con, &match_pattern, _n, -- query_keys, query_keys_count, manual_keys, manual_keys_count, -- 1000); -+ ret = db_redis_scan_query_keys_pattern(con, &match_pattern, -+ ts_scan_table, _n, query_keys, query_keys_count, manual_keys, -+ manual_keys_count, 1000); - pkg_free(match); - return ret; - } -@@ -1136,9 +1164,9 @@ static int db_redis_scan_query_keys(km_redis_con_t *con, const str *table_name, - "'%.*s'\n", - len, match); - -- ret = db_redis_scan_query_keys_pattern(con, &match_pattern, _n, -- &set_keys, &set_keys_count, manual_keys, manual_keys_count, -- 5000); -+ ret = db_redis_scan_query_keys_pattern(con, &match_pattern, -+ ts_scan_table, _n, &set_keys, &set_keys_count, manual_keys, -+ manual_keys_count, 5000); - if(ret) - goto out; - } -@@ -1183,9 +1211,9 @@ static int db_redis_scan_query_keys(km_redis_con_t *con, const str *table_name, - LM_DBG("running timestamp/int range matching using pattern '%.*s'\n", - len, match); - -- ret = db_redis_scan_query_keys_pattern(con, &match_pattern, _n, -- &set_keys, &set_keys_count, manual_keys, manual_keys_count, -- 5000); -+ ret = db_redis_scan_query_keys_pattern(con, &match_pattern, -+ ts_scan_table, _n, &set_keys, &set_keys_count, manual_keys, -+ manual_keys_count, 5000); - if(ret) - goto out; - } -@@ -1199,9 +1227,9 @@ static int db_redis_scan_query_keys(km_redis_con_t *con, const str *table_name, - LM_DBG("running timestamp/int range matching using pattern '%.*s'\n", - len, match); - -- ret = db_redis_scan_query_keys_pattern(con, &match_pattern, _n, -- &set_keys, &set_keys_count, manual_keys, manual_keys_count, -- 5000); -+ ret = db_redis_scan_query_keys_pattern(con, &match_pattern, -+ ts_scan_table, _n, &set_keys, &set_keys_count, manual_keys, -+ manual_keys_count, 5000); - if(ret) - goto out; - } -@@ -1579,7 +1607,7 @@ static int db_redis_perform_query(const db1_con_t *_h, km_redis_con_t *con, - const db_key_t *_c, const int _n, const int _nc, db1_res_t **_r, - redis_key_t **keys, int *keys_count, int **manual_keys, - int *manual_keys_count, int do_table_scan, uint64_t ts_scan_start, -- const str *ts_scan_key) -+ const str *ts_scan_key, const str *ts_scan_table) - { - - redisReply *reply = NULL; -@@ -1614,7 +1642,8 @@ static int db_redis_perform_query(const db1_con_t *_h, km_redis_con_t *con, - CON_TABLE(_h)->s); - } - if(db_redis_scan_query_keys(con, CON_TABLE(_h), _n, keys, keys_count, -- manual_keys, manual_keys_count, ts_scan_start, ts_scan_key) -+ manual_keys, manual_keys_count, ts_scan_start, ts_scan_key, -+ ts_scan_table) - != 0) { - LM_ERR("failed to scan query keys\n"); - goto error; -@@ -1769,7 +1798,7 @@ static int db_redis_perform_delete(const db1_con_t *_h, km_redis_con_t *con, - const db_key_t *_k, const db_val_t *_v, const db_op_t *_op, - const int _n, redis_key_t **keys, int *keys_count, int **manual_keys, - int *manual_keys_count, int do_table_scan, uint64_t ts_scan_start, -- const str *ts_scan_key) -+ const str *ts_scan_key, const str *ts_scan_table) - { - - int i = 0, j = 0; -@@ -1807,7 +1836,8 @@ static int db_redis_perform_delete(const db1_con_t *_h, km_redis_con_t *con, - LM_WARN(" scan key %d is '%.*s'\n", i, _k[i]->len, _k[i]->s); - } - if(db_redis_scan_query_keys(con, CON_TABLE(_h), _n, keys, keys_count, -- manual_keys, manual_keys_count, ts_scan_start, ts_scan_key) -+ manual_keys, manual_keys_count, ts_scan_start, ts_scan_key, -+ ts_scan_table) - != 0) { - LM_ERR("failed to scan query keys\n"); - goto error; -@@ -2083,7 +2113,7 @@ static int db_redis_perform_update(const db1_con_t *_h, km_redis_con_t *con, - const db_key_t *_uk, const db_val_t *_uv, const int _n, const int _nu, - redis_key_t **keys, int *keys_count, int **manual_keys, - int *manual_keys_count, int do_table_scan, uint64_t ts_scan_start, -- const str *ts_scan_key) -+ const str *ts_scan_key, const str *ts_scan_table) - { - - redisReply *reply = NULL; -@@ -2115,7 +2145,8 @@ static int db_redis_perform_update(const db1_con_t *_h, km_redis_con_t *con, - LM_WARN(" scan key %d is '%.*s'\n", i, _k[i]->len, _k[i]->s); - } - if(db_redis_scan_query_keys(con, CON_TABLE(_h), _n, keys, keys_count, -- manual_keys, manual_keys_count, ts_scan_start, ts_scan_key) -+ manual_keys, manual_keys_count, ts_scan_start, ts_scan_key, -+ ts_scan_table) - != 0) { - LM_ERR("failed to scan query keys\n"); - goto error; -@@ -2589,6 +2620,9 @@ int db_redis_query(const db1_con_t *_h, const db_key_t *_k, const db_op_t *_op, - str ts_scan_key = { - 0, - }; -+ str ts_scan_table = { -+ 0, -+ }; - - redis_key_t *keys = NULL; - int keys_count = 0; -@@ -2663,7 +2697,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, &ts_scan_key) -+ &do_table_scan, &ts_scan_start, &ts_scan_key, &ts_scan_table) - != 0) { - LM_ERR("failed to build query keys\n"); - goto error; -@@ -2686,7 +2720,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, - &keys, &keys_count, &manual_keys, &manual_keys_count, -- do_table_scan, ts_scan_start, &ts_scan_key) -+ do_table_scan, ts_scan_start, &ts_scan_key, &ts_scan_table) - != 0) { - goto error; - } -@@ -2703,6 +2737,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); -+ if(ts_scan_table.s) -+ pkg_free(ts_scan_table.s); - - db_redis_consume_replies(con); - return 0; -@@ -2718,6 +2754,8 @@ error: - } - if(ts_scan_key.s) - pkg_free(ts_scan_key.s); -+ if(ts_scan_table.s) -+ pkg_free(ts_scan_table.s); - db_redis_consume_replies(con); - - -@@ -2909,6 +2947,9 @@ int db_redis_delete(const db1_con_t *_h, const db_key_t *_k, const db_op_t *_op, - str ts_scan_key = { - 0, - }; -+ str ts_scan_table = { -+ 0, -+ }; - db_op_t *query_ops = NULL; - int i; - -@@ -2954,7 +2995,7 @@ int db_redis_delete(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, &ts_scan_key) -+ &do_table_scan, &ts_scan_start, &ts_scan_key, &ts_scan_table) - != 0) { - LM_ERR("failed to build query keys\n"); - goto error; -@@ -2977,7 +3018,7 @@ int db_redis_delete(const db1_con_t *_h, const db_key_t *_k, const db_op_t *_op, - - if(db_redis_perform_delete(_h, con, _k, _v, query_ops, _n, &keys, - &keys_count, &manual_keys, &manual_keys_count, do_table_scan, -- ts_scan_start, &ts_scan_key) -+ ts_scan_start, &ts_scan_key, &ts_scan_table) - != 0) { - goto error; - } -@@ -2992,6 +3033,8 @@ int db_redis_delete(const db1_con_t *_h, const db_key_t *_k, const db_op_t *_op, - pkg_free(manual_keys); - if(ts_scan_key.s) - pkg_free(ts_scan_key.s); -+ if(ts_scan_table.s) -+ pkg_free(ts_scan_table.s); - db_redis_consume_replies(con); - - return 0; -@@ -3006,6 +3049,8 @@ error: - pkg_free(manual_keys); - if(ts_scan_key.s) - pkg_free(ts_scan_key.s); -+ if(ts_scan_table.s) -+ pkg_free(ts_scan_table.s); - db_redis_consume_replies(con); - return -1; - } -@@ -3032,6 +3077,9 @@ int db_redis_update(const db1_con_t *_h, const db_key_t *_k, const db_op_t *_op, - str ts_scan_key = { - 0, - }; -+ str ts_scan_table = { -+ 0, -+ }; - - redis_key_t *keys = NULL; - int keys_count = 0; -@@ -3082,7 +3130,7 @@ int db_redis_update(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, &ts_scan_key) -+ &do_table_scan, &ts_scan_start, &ts_scan_key, &ts_scan_table) - != 0) { - LM_ERR("failed to build query keys\n"); - goto error; -@@ -3104,7 +3152,7 @@ int db_redis_update(const db1_con_t *_h, const db_key_t *_k, const db_op_t *_op, - - if(db_redis_perform_update(_h, con, _k, _v, query_ops, _uk, _uv, _n, _nu, - &keys, &keys_count, &manual_keys, &manual_keys_count, -- do_table_scan, ts_scan_start, &ts_scan_key) -+ do_table_scan, ts_scan_start, &ts_scan_key, &ts_scan_table) - != 0) { - goto error; - } -@@ -3121,6 +3169,8 @@ int db_redis_update(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); -+ if(ts_scan_table.s) -+ pkg_free(ts_scan_table.s); - db_redis_consume_replies(con); - return 0; - -@@ -3135,6 +3185,8 @@ error: - } - if(ts_scan_key.s) - pkg_free(ts_scan_key.s); -+ if(ts_scan_table.s) -+ pkg_free(ts_scan_table.s); - db_redis_consume_replies(con); - return -1; - } diff --git a/debian/patches/sipwise/db_redis_sscan_fix_empty_key.patch b/debian/patches/sipwise/db_redis_sscan_fix_empty_key.patch deleted file mode 100644 index 0fea56102..000000000 --- a/debian/patches/sipwise/db_redis_sscan_fix_empty_key.patch +++ /dev/null @@ -1,21 +0,0 @@ -From: Sipwise Development Team -Date: Wed, 12 May 2021 11:53:43 +0200 -Subject: db_redis_sscan_fix_empty_key - ---- - src/modules/db_redis/redis_dbase.c | 2 +- - 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 b98e0f3..c0b9416 100644 ---- a/src/modules/db_redis/redis_dbase.c -+++ b/src/modules/db_redis/redis_dbase.c -@@ -854,7 +854,7 @@ static int db_redis_scan_query_keys_pattern(km_redis_con_t *con, - do { - snprintf(cursor_str, sizeof(cursor_str), "%lu", cursor); - -- if(!index_key) { -+ if(!index_key || !index_key->len) { - if(db_redis_key_add_string(&query_v, "SCAN", 4) != 0) { - LM_ERR("Failed to add scan command to scan query\n"); - goto err; diff --git a/debian/patches/sipwise/dialog-support-profile_get_size-for-all-profiles.patch b/debian/patches/sipwise/dialog-support-profile_get_size-for-all-profiles.patch index c7b506ea3..f1020c1a2 100644 --- a/debian/patches/sipwise/dialog-support-profile_get_size-for-all-profiles.patch +++ b/debian/patches/sipwise/dialog-support-profile_get_size-for-all-profiles.patch @@ -76,10 +76,10 @@ index 79221a1..0127e61 100644 RET_ARRAY}, {"dlg.bridge_dlg", rpc_dlg_bridge, rpc_dlg_bridge_doc, 0}, diff --git a/src/modules/dialog/dlg_profile.c b/src/modules/dialog/dlg_profile.c -index 5dd3b37..2b2493e 100644 +index 43aee62..dc334be 100644 --- a/src/modules/dialog/dlg_profile.c +++ b/src/modules/dialog/dlg_profile.c -@@ -127,6 +127,14 @@ int add_profile_definitions(char *profiles, unsigned int has_value) +@@ -127,6 +127,14 @@ int add_profile_definitions(char *profiledef, unsigned int has_value) return 0; } diff --git a/debian/patches/sipwise/dialplan-don-t-stop-loading-rules-on-error.patch b/debian/patches/sipwise/dialplan-don-t-stop-loading-rules-on-error.patch index 559eb8969..84ef2d240 100644 --- a/debian/patches/sipwise/dialplan-don-t-stop-loading-rules-on-error.patch +++ b/debian/patches/sipwise/dialplan-don-t-stop-loading-rules-on-error.patch @@ -7,10 +7,10 @@ Subject: dialplan: don't stop loading rules on error 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/dialplan/dp_db.c b/src/modules/dialplan/dp_db.c -index cc4ebeb..a3a9dac 100644 +index 857a2e4..0e18571 100644 --- a/src/modules/dialplan/dp_db.c +++ b/src/modules/dialplan/dp_db.c -@@ -304,8 +304,10 @@ int dp_load_db(void) +@@ -332,8 +332,10 @@ int dp_load_db(void) values = ROW_VALUES(rows + i); diff --git a/debian/patches/sipwise/do-not-install-default-config.patch b/debian/patches/sipwise/do-not-install-default-config.patch index 48826638f..1b44ab258 100644 --- a/debian/patches/sipwise/do-not-install-default-config.patch +++ b/debian/patches/sipwise/do-not-install-default-config.patch @@ -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 eb1a8c6..9cbc353 100644 +index 41c3624..c1530e5 100644 --- a/src/Makefile +++ b/src/Makefile @@ -649,7 +649,7 @@ sunpkg: diff --git a/debian/patches/sipwise/kamctl-TMPDIR-config.patch b/debian/patches/sipwise/kamctl-TMPDIR-config.patch index da969e710..9795ba481 100644 --- a/debian/patches/sipwise/kamctl-TMPDIR-config.patch +++ b/debian/patches/sipwise/kamctl-TMPDIR-config.patch @@ -13,10 +13,10 @@ Subject: kamctl: TMPDIR config 5 files changed, 23 insertions(+), 13 deletions(-) diff --git a/utils/kamctl/kamctl b/utils/kamctl/kamctl -index 7eea9be..1fff779 100755 +index 6bdcfa2..d9622ab 100755 --- a/utils/kamctl/kamctl +++ b/utils/kamctl/kamctl -@@ -77,6 +77,10 @@ if [ -z "$STARTUP_CONFIG_FILE" ]; then +@@ -80,6 +80,10 @@ if [ -z "$STARTUP_CONFIG_FILE" ]; then STARTUP_CONFIG_FILE="kamailio.cfg" fi @@ -27,7 +27,7 @@ index 7eea9be..1fff779 100755 ##### ------------------------------------------------ ##### ### load base functions # -@@ -2940,7 +2944,7 @@ kamailio_trap() { +@@ -2977,7 +2981,7 @@ kamailio_trap() { exit fi DATE=`/bin/date +%Y%m%d_%H%M%S` @@ -36,7 +36,7 @@ index 7eea9be..1fff779 100755 minfo "Trap file: $LOG_FILE" ctl_cmd_run core.psx > $LOG_FILE echo -n "Trapping Kamailio with gdb: " -@@ -2967,7 +2971,7 @@ kamailio_pstrap() { +@@ -3004,7 +3008,7 @@ kamailio_pstrap() { exit fi DATE=`/bin/date +%Y%m%d_%H%M%S` @@ -99,7 +99,7 @@ index f7408b5..478864a 100644 trap "rm $path; clear; echo monitor ^C-ed; exit 1" 2 attempt=0 diff --git a/utils/kamctl/kamdbctl b/utils/kamctl/kamdbctl -index 5a89a95..19a50c5 100755 +index 37180f7..6648f42 100755 --- a/utils/kamctl/kamdbctl +++ b/utils/kamctl/kamdbctl @@ -303,7 +303,7 @@ case $1 in diff --git a/debian/patches/sipwise/lcr-stats.patch b/debian/patches/sipwise/lcr-stats.patch index 1873e3be5..8a14068d2 100644 --- a/debian/patches/sipwise/lcr-stats.patch +++ b/debian/patches/sipwise/lcr-stats.patch @@ -3,16 +3,16 @@ Date: Fri, 10 Mar 2023 11:58:50 +0100 Subject: lcr: add stats per gw --- - src/modules/lcr/lcr_mod.c | 323 +++++++++++++++++++++++++++++++++ + src/modules/lcr/lcr_mod.c | 324 +++++++++++++++++++++++++++++++++ src/modules/lcr/lcr_mod.h | 53 ++++++ src/modules/lcr/lcr_rpc.c | 451 ++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 827 insertions(+) + 3 files changed, 828 insertions(+) diff --git a/src/modules/lcr/lcr_mod.c b/src/modules/lcr/lcr_mod.c -index 826f853..834612c 100644 +index c6f64d2..67b071d 100644 --- a/src/modules/lcr/lcr_mod.c +++ b/src/modules/lcr/lcr_mod.c -@@ -65,6 +65,7 @@ +@@ -66,6 +66,7 @@ #include "../../core/pvar.h" #include "../../core/rand/kam_rand.h" #include "../../core/kemi.h" @@ -20,7 +20,7 @@ index 826f853..834612c 100644 #include "hash.h" #include "lcr_rpc.h" #include "../../core/rpc_lookup.h" -@@ -208,6 +209,9 @@ str mtree_param = {"lcr", 3}; +@@ -212,6 +213,9 @@ static pcre2_compile_context *lcr_ctx = NULL; #define DEF_LCR_STOPPER_MODE 0 unsigned int stopper_mode_param = DEF_LCR_STOPPER_MODE; @@ -30,7 +30,7 @@ index 826f853..834612c 100644 /* * Other module types and variables */ -@@ -249,6 +253,9 @@ unsigned int ping_rc_count = 0; +@@ -253,6 +257,9 @@ unsigned int ping_rc_count = 0; /* Mtree API var */ mtree_api_t mtree_api; @@ -40,7 +40,7 @@ index 826f853..834612c 100644 /* * Functions that are defined later */ -@@ -272,6 +279,10 @@ static int to_gw_1(struct sip_msg *_m, char *_s1, char *_s2); +@@ -276,6 +283,10 @@ static int to_gw_1(struct sip_msg *_m, char *_s1, char *_s2); static int to_gw_3(struct sip_msg *_m, char *_s1, char *_s2, char *_s3); static int to_any_gw_0(struct sip_msg *_m, char *_s1, char *_s2); static int to_any_gw_2(struct sip_msg *_m, char *_s1, char *_s2); @@ -51,7 +51,7 @@ index 826f853..834612c 100644 /* clang-format off */ /* -@@ -362,6 +373,7 @@ static param_export_t params[] = { +@@ -366,6 +377,7 @@ static param_export_t params[] = { {"ping_from", PARAM_STR, &ping_from_param}, {"ping_socket", PARAM_STR, &ping_socket_param}, {"stopper_mode", PARAM_INT, &stopper_mode_param}, @@ -59,8 +59,8 @@ index 826f853..834612c 100644 {0, 0, 0} }; -@@ -427,6 +439,180 @@ static void lcr_db_close(void) - } +@@ -442,6 +454,181 @@ static void pcre2_free(void *ptr, void *ext) + ptr = NULL; } +// stats request callback function @@ -237,10 +237,11 @@ index 826f853..834612c 100644 + } + return 1; +} - ++ /* * Module initialization function that is called before the main process forks -@@ -439,6 +625,28 @@ static int mod_init(void) + */ +@@ -453,6 +640,28 @@ static int mod_init(void) unsigned int i; char *at, *past, *sep; @@ -269,7 +270,7 @@ index 826f853..834612c 100644 /* Register RPC commands */ if(rpc_register_array(lcr_rpc) != 0) { LM_ERR("failed to register RPC commands\n"); -@@ -1022,6 +1230,10 @@ static int insert_gw(struct gw_info *gws, unsigned int i, unsigned int gw_id, +@@ -1054,6 +1263,10 @@ static int insert_gw(struct gw_info *gws, unsigned int i, unsigned int gw_id, append_str(at, transport, transport_len); } gws[i].uri_len = at - &(gws[i].uri[0]); @@ -280,7 +281,7 @@ index 826f853..834612c 100644 LM_DBG("inserted gw <%u, %.*s, %.*s> at index %u\n", gw_id, gw_name_len, gw_name, gws[i].uri_len, gws[i].uri, i); return 1; -@@ -2288,6 +2500,65 @@ done: +@@ -2334,6 +2547,65 @@ done: return j; } @@ -346,7 +347,7 @@ index 826f853..834612c 100644 /* * Load info of matching GWs into gw_uri_avps -@@ -3726,3 +3997,55 @@ int mod_register(char *path, int *dlflags, void *p1, void *p2) +@@ -3793,3 +4065,55 @@ int mod_register(char *path, int *dlflags, void *p1, void *p2) sr_kemi_modules_add(sr_kemi_lcr_exports); return 0; } @@ -402,12 +403,11 @@ index 826f853..834612c 100644 + } + return NULL; +} -\ No newline at end of file diff --git a/src/modules/lcr/lcr_mod.h b/src/modules/lcr/lcr_mod.h -index 193e216..e14ffd7 100644 +index 131cb64..a1c7b00 100644 --- a/src/modules/lcr/lcr_mod.h +++ b/src/modules/lcr/lcr_mod.h -@@ -37,6 +37,7 @@ +@@ -39,6 +39,7 @@ #include "../../core/locking.h" #include "../../core/parser/parse_uri.h" #include "../../core/ip_addr.h" @@ -415,7 +415,7 @@ index 193e216..e14ffd7 100644 #define MAX_PREFIX_LEN 16 #define MAX_URI_LEN 256 -@@ -134,6 +135,54 @@ struct gw_info +@@ -136,6 +137,54 @@ struct gw_info char uri[MAX_URI_LEN]; unsigned short uri_len; unsigned int defunct_until; @@ -470,7 +470,7 @@ index 193e216..e14ffd7 100644 }; extern unsigned int lcr_rule_hash_size_param; -@@ -150,5 +199,9 @@ extern int load_gws_dummy(int lcr_id, str *ruri_user, str *from_uri, +@@ -152,5 +201,9 @@ extern int load_gws_dummy(int lcr_id, str *ruri_user, str *from_uri, str *request_uri, unsigned int *gw_indexes); extern int reload_tables(); extern int rpc_defunct_gw(unsigned int, unsigned int, unsigned int); diff --git a/debian/patches/sipwise/lcr-stopper_mode-parameter.patch b/debian/patches/sipwise/lcr-stopper_mode-parameter.patch index 3320a85a5..f26a4f5e6 100644 --- a/debian/patches/sipwise/lcr-stopper_mode-parameter.patch +++ b/debian/patches/sipwise/lcr-stopper_mode-parameter.patch @@ -10,12 +10,12 @@ 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 1d5a1ff..826f853 100644 +index dac215a..c6f64d2 100644 --- a/src/modules/lcr/lcr_mod.c +++ b/src/modules/lcr/lcr_mod.c -@@ -204,6 +204,10 @@ static unsigned int priority_ordering_param = 0; - /* mtree tree name */ - str mtree_param = {"lcr", 3}; +@@ -208,6 +208,10 @@ str mtree_param = {"lcr", 3}; + static pcre2_general_context *lcr_gctx = NULL; + static pcre2_compile_context *lcr_ctx = NULL; +/* stopper mode */ +#define DEF_LCR_STOPPER_MODE 0 @@ -24,7 +24,7 @@ index 1d5a1ff..826f853 100644 /* * Other module types and variables */ -@@ -357,6 +361,7 @@ static param_export_t params[] = { +@@ -361,6 +365,7 @@ static param_export_t params[] = { {"ping_valid_reply_codes", PARAM_STR, &ping_valid_reply_codes_param}, {"ping_from", PARAM_STR, &ping_from_param}, {"ping_socket", PARAM_STR, &ping_socket_param}, @@ -32,7 +32,7 @@ index 1d5a1ff..826f853 100644 {0, 0, 0} }; -@@ -2233,6 +2238,8 @@ int load_gws_dummy(int lcr_id, str *ruri_user, str *from_uri, str *request_uri, +@@ -2279,6 +2284,8 @@ int load_gws_dummy(int lcr_id, str *ruri_user, str *from_uri, str *request_uri, matched_gws[gw_index].priority = t->priority; matched_gws[gw_index].weight = t->weight * (kam_rand() >> 8); matched_gws[gw_index].duplicate = 0; @@ -41,7 +41,7 @@ index 1d5a1ff..826f853 100644 LM_DBG("added matched_gws[%d]=[%u, %u, %u, %u]\n", gw_index, t->gw_index, pl->prefix_len, t->priority, matched_gws[gw_index].weight); -@@ -2240,8 +2247,10 @@ int load_gws_dummy(int lcr_id, str *ruri_user, str *from_uri, str *request_uri, +@@ -2286,8 +2293,10 @@ int load_gws_dummy(int lcr_id, str *ruri_user, str *from_uri, str *request_uri, skip_gw: t = t->next; } @@ -53,7 +53,7 @@ index 1d5a1ff..826f853 100644 next: rule = rule->next; -@@ -2268,6 +2277,11 @@ done: +@@ -2314,6 +2323,11 @@ done: if(matched_gws[i].duplicate == 1) continue; gw_indexes[j] = matched_gws[i].gw_index; @@ -65,16 +65,16 @@ index 1d5a1ff..826f853 100644 j++; } -@@ -2283,7 +2297,7 @@ static int ki_load_gws_furi( +@@ -2329,7 +2343,7 @@ static int ki_load_gws_furi( { str *request_uri; - int i, j; + int i, j, rc; - unsigned int gw_index, now, dex; + unsigned int gw_index, now, dex, stopper_flag; int_str val; + pcre2_match_data *pcre_md = NULL; struct matched_gw_info matched_gws[MAX_NO_OF_GWS + 1]; - struct rule_info **rules, *rule, *pl; -@@ -2403,6 +2417,8 @@ static int ki_load_gws_furi( +@@ -2466,6 +2480,8 @@ static int ki_load_gws_furi( matched_gws[gw_index].priority = t->priority; matched_gws[gw_index].weight = t->weight * (kam_rand() >> 8); matched_gws[gw_index].duplicate = 0; @@ -83,7 +83,7 @@ index 1d5a1ff..826f853 100644 LM_DBG("added matched_gws[%d]=[%u, %u, %u, %u]\n", gw_index, t->gw_index, pl->prefix_len, t->priority, matched_gws[gw_index].weight); -@@ -2411,8 +2427,10 @@ static int ki_load_gws_furi( +@@ -2474,8 +2490,10 @@ static int ki_load_gws_furi( t = t->next; } /* Do not look further if this matching rule was stopper */ @@ -95,7 +95,7 @@ index 1d5a1ff..826f853 100644 next: rule = rule->next; -@@ -2437,6 +2455,24 @@ done: +@@ -2500,6 +2518,24 @@ done: } } @@ -121,10 +121,10 @@ index 1d5a1ff..826f853 100644 add_gws_into_avps(gws, matched_gws, gw_index, ruri_user); diff --git a/src/modules/lcr/lcr_mod.h b/src/modules/lcr/lcr_mod.h -index 421fe68..193e216 100644 +index 0255241..131cb64 100644 --- a/src/modules/lcr/lcr_mod.h +++ b/src/modules/lcr/lcr_mod.h -@@ -85,6 +85,7 @@ struct matched_gw_info +@@ -87,6 +87,7 @@ struct matched_gw_info unsigned short priority; unsigned int weight; unsigned short duplicate; diff --git a/debian/patches/sipwise/lcr_read_id.patch b/debian/patches/sipwise/lcr_read_id.patch index 91641c166..8124347e8 100644 --- a/debian/patches/sipwise/lcr_read_id.patch +++ b/debian/patches/sipwise/lcr_read_id.patch @@ -3,14 +3,14 @@ Date: Thu, 2 Nov 2023 11:45:00 +0100 Subject: lcr_read_id --- - src/modules/lcr/lcr_mod.c | 93 +++++++++++++++++++++++++++++++++++++---------- - 1 file changed, 73 insertions(+), 20 deletions(-) + src/modules/lcr/lcr_mod.c | 91 +++++++++++++++++++++++++++++++++++++---------- + 1 file changed, 72 insertions(+), 19 deletions(-) diff --git a/src/modules/lcr/lcr_mod.c b/src/modules/lcr/lcr_mod.c -index 834612c..3f4cb86 100644 +index 67b071d..6b53dc6 100644 --- a/src/modules/lcr/lcr_mod.c +++ b/src/modules/lcr/lcr_mod.c -@@ -172,6 +172,7 @@ static char *gw_uri_avp_param = NULL; +@@ -173,6 +173,7 @@ static char *gw_uri_avp_param = NULL; static char *ruri_user_avp_param = NULL; static char *tag_avp_param = NULL; static char *flags_avp_param = NULL; @@ -18,7 +18,7 @@ index 834612c..3f4cb86 100644 static char *rule_id_avp_param = NULL; static char *defunct_gw_avp_param = NULL; static char *lcr_id_avp_param = NULL; -@@ -224,6 +225,8 @@ static int tag_avp_type; +@@ -228,6 +229,8 @@ static int tag_avp_type; static int_str tag_avp; static int flags_avp_type; static int_str flags_avp; @@ -27,7 +27,7 @@ index 834612c..3f4cb86 100644 static int rule_id_avp_type; static int_str rule_id_avp; static int defunct_gw_avp_type; -@@ -355,6 +358,7 @@ static param_export_t params[] = { +@@ -359,6 +362,7 @@ static param_export_t params[] = { {"ruri_user_avp", PARAM_STRING, &ruri_user_avp_param}, {"tag_avp", PARAM_STRING, &tag_avp_param}, {"flags_avp", PARAM_STRING, &flags_avp_param}, @@ -35,7 +35,7 @@ index 834612c..3f4cb86 100644 {"rule_id_avp", PARAM_STRING, &rule_id_avp_param}, {"defunct_capability", INT_PARAM, &defunct_capability_param}, {"defunct_gw_avp", PARAM_STRING, &defunct_gw_avp_param}, -@@ -760,6 +764,21 @@ static int mod_init(void) +@@ -775,6 +779,21 @@ static int mod_init(void) flags_avp_type = avp_flags; } @@ -57,16 +57,16 @@ index 834612c..3f4cb86 100644 if(rule_id_avp_param) { s.s = rule_id_avp_param; s.len = strlen(s.s); -@@ -2098,7 +2117,7 @@ static inline int encode_avp_value(char *value, unsigned int gw_index, +@@ -2131,7 +2150,7 @@ static inline int encode_avp_value(char *value, unsigned int gw_index, struct ip_addr *ip_addr, char *hostname, unsigned int hostname_len, - unsigned int port, char *params, unsigned int params_len, + unsigned int port, char *uparams, unsigned int uparams_len, char *transport, unsigned int transport_len, unsigned int flags, - unsigned int rule_id) + unsigned int rule_id, unsigned int gw_id) { char *at, *string; int len; -@@ -2154,13 +2173,18 @@ static inline int encode_avp_value(char *value, unsigned int gw_index, +@@ -2187,13 +2206,18 @@ static inline int encode_avp_value(char *value, unsigned int gw_index, /* rule id */ string = int2str(rule_id, &len); append_str(at, string, len); @@ -79,14 +79,14 @@ index 834612c..3f4cb86 100644 static inline int decode_avp_value(char *value, unsigned int *gw_index, str *scheme, unsigned int *strip, str *prefix, str *tag, - struct ip_addr *addr, str *hostname, str *port, str *params, + struct ip_addr *addr, str *hostname, str *port, str *uparams, - str *transport, unsigned int *flags, unsigned int *rule_id) + str *transport, unsigned int *flags, unsigned int *rule_id, + unsigned int *gw_id) { unsigned int u = 0; str s; -@@ -2276,6 +2300,12 @@ static inline int decode_avp_value(char *value, unsigned int *gw_index, +@@ -2309,6 +2333,12 @@ static inline int decode_avp_value(char *value, unsigned int *gw_index, s.s = sep + 1; s.len = strlen(s.s); str2int(&s, rule_id); @@ -99,17 +99,17 @@ index 834612c..3f4cb86 100644 return 1; } -@@ -2326,7 +2356,8 @@ void add_gws_into_avps(struct gw_info *gws, struct matched_gw_info *matched_gws, +@@ -2359,7 +2389,8 @@ void add_gws_into_avps(struct gw_info *gws, struct matched_gw_info *matched_gws, gws[index].tag, tag_len, &gws[index].ip_addr, gws[index].hostname, hostname_len, gws[index].port, - gws[index].params, params_len, gws[index].transport, + gws[index].params, uparams_len, gws[index].transport, - gws[index].transport_len, gws[index].flags, rule_id); + gws[index].transport_len, gws[index].flags, rule_id, + gws[index].gw_id); value.s = (char *)&(encoded_value[0]); val.s = value; add_avp(gw_uri_avp_type | AVP_VAL_STR, gw_uri_avp, val); -@@ -2489,9 +2520,9 @@ done: +@@ -2536,9 +2567,9 @@ done: if(matched_gws[i].duplicate == 1) continue; gw_indexes[j] = matched_gws[i].gw_index; @@ -121,7 +121,7 @@ index 834612c..3f4cb86 100644 i = -1; } j++; -@@ -2523,28 +2554,36 @@ void reset_gw_stats(struct gw_info *gw) +@@ -2570,28 +2601,36 @@ void reset_gw_stats(struct gw_info *gw) gw->rcv_gw_rpl = 0; gw->rcv_gw_rpl_invite = 0; @@ -166,7 +166,7 @@ index 834612c..3f4cb86 100644 gw->rcv_gw_rpls_1xx = 0; gw->rcv_gw_rpls_18x = 0; -@@ -2739,7 +2778,7 @@ done: +@@ -2803,7 +2842,7 @@ done: } else if(matched_gws[i].stopper == 1) { stopper_flag = 1; LM_DBG("lcr_rule[%d] has stopper, skip the rest\n", @@ -175,7 +175,7 @@ index 834612c..3f4cb86 100644 } } } -@@ -2838,7 +2877,7 @@ static int load_gws(struct sip_msg *_m, int argc, action_u_t argv[]) +@@ -2902,7 +2941,7 @@ static int load_gws(struct sip_msg *_m, int argc, action_u_t argv[]) static int generate_uris(struct sip_msg *_m, char *r_uri, str *r_uri_user, unsigned int *r_uri_len, char *dst_uri, unsigned int *dst_uri_len, struct ip_addr *addr, unsigned int *gw_index, unsigned int *flags, @@ -184,16 +184,16 @@ index 834612c..3f4cb86 100644 { int_str gw_uri_val; struct usr_avp *gu_avp; -@@ -2864,7 +2903,7 @@ static int generate_uris(struct sip_msg *_m, char *r_uri, str *r_uri_user, +@@ -2928,7 +2967,7 @@ static int generate_uris(struct sip_msg *_m, char *r_uri, str *r_uri_user, decode_avp_value(gw_uri_val.s.s, gw_index, &scheme, &strip, &prefix, - &tmp_tag, addr, &hostname, &port, ¶ms, &transport, flags, + &tmp_tag, addr, &hostname, &port, &uparams, &transport, flags, - rule_id); + rule_id, gw_id); if(addr->af != 0) { addr_str.s = ip_addr2a(addr); -@@ -3222,7 +3261,7 @@ static int ki_next_gw(sip_msg_t *_m) +@@ -3287,7 +3326,7 @@ static int ki_next_gw(sip_msg_t *_m) int rval; str uri_str, tag_str; char tag[MAX_TAG_LEN]; @@ -202,7 +202,7 @@ index 834612c..3f4cb86 100644 char r_uri[MAX_URI_LEN], dst_uri[MAX_URI_LEN]; struct ip_addr addr; -@@ -3244,7 +3283,8 @@ static int ki_next_gw(sip_msg_t *_m) +@@ -3309,7 +3348,8 @@ static int ki_next_gw(sip_msg_t *_m) return -1; } if(generate_uris(_m, r_uri, &(_m->parsed_uri.user), &r_uri_len, dst_uri, @@ -212,7 +212,7 @@ index 834612c..3f4cb86 100644 <= 0) { return -1; } -@@ -3263,7 +3303,8 @@ static int ki_next_gw(sip_msg_t *_m) +@@ -3328,7 +3368,8 @@ static int ki_next_gw(sip_msg_t *_m) * and Destination URIs. */ if(generate_uris(_m, r_uri, &(ruri_user_val.s), &r_uri_len, dst_uri, @@ -222,7 +222,7 @@ index 834612c..3f4cb86 100644 <= 0) { return -1; } -@@ -3296,6 +3337,13 @@ static int ki_next_gw(sip_msg_t *_m) +@@ -3361,6 +3402,13 @@ static int ki_next_gw(sip_msg_t *_m) LM_DBG("added flags_avp <%u>\n", (unsigned int)val.n); } @@ -236,7 +236,7 @@ index 834612c..3f4cb86 100644 /* Set tag_avp */ if(tag_avp_param) { val.s = tag_str; -@@ -3374,6 +3422,11 @@ static int do_from_gw(struct sip_msg *_m, unsigned int lcr_id, +@@ -3439,6 +3487,11 @@ static int do_from_gw(struct sip_msg *_m, unsigned int lcr_id, add_avp(flags_avp_type, flags_avp, val); LM_DBG("added flags_avp <%u>\n", (unsigned int)val.n); } @@ -248,10 +248,3 @@ index 834612c..3f4cb86 100644 return 1; } else { LM_DBG("request did not come from gw\n"); -@@ -4048,4 +4101,4 @@ static struct gw_info *ki_lcr_check_sip_msg_against_gwlist(sip_msg_t *_m) - } - } - return NULL; --} -\ No newline at end of file -+} diff --git a/debian/patches/sipwise/presence_vqr.patch b/debian/patches/sipwise/presence_vqr.patch index ebf952c4c..89fa34388 100644 --- a/debian/patches/sipwise/presence_vqr.patch +++ b/debian/patches/sipwise/presence_vqr.patch @@ -25,10 +25,10 @@ Subject: presence_vqr create mode 100644 src/modules/presence_vqr/presence_vqr.h diff --git a/src/Makefile.groups b/src/Makefile.groups -index f61bcec..be89aae 100644 +index 698847f..f0fe234 100644 --- a/src/Makefile.groups +++ b/src/Makefile.groups -@@ -121,7 +121,7 @@ mod_list_presence=presence presence_conference presence_dialoginfo \ +@@ -118,7 +118,7 @@ mod_list_presence=presence presence_conference presence_dialoginfo \ presence_xml \ pua pua_bla pua_dialoginfo pua_reginfo \ pua_rpc pua_usrloc pua_xmpp \ diff --git a/debian/patches/sipwise/pua_dialoginfo-fix-dlg_var-store-and-retrieval.patch b/debian/patches/sipwise/pua_dialoginfo-fix-dlg_var-store-and-retrieval.patch deleted file mode 100644 index 3eda24905..000000000 --- a/debian/patches/sipwise/pua_dialoginfo-fix-dlg_var-store-and-retrieval.patch +++ /dev/null @@ -1,298 +0,0 @@ -From: Victor Seva -Date: Fri, 9 Jun 2023 13:56:33 +0200 -Subject: pua_dialoginfo: fix dlg_var store and retrieval - -* dlg_var can have more than one value -* store values as comma separate strings -* alloc string values always for str_list ---- - src/modules/pua_dialoginfo/pua_dialoginfo.c | 203 +++++++++++++++++++--------- - 1 file changed, 137 insertions(+), 66 deletions(-) - -diff --git a/src/modules/pua_dialoginfo/pua_dialoginfo.c b/src/modules/pua_dialoginfo/pua_dialoginfo.c -index 6efcdc0..089586d 100644 ---- a/src/modules/pua_dialoginfo/pua_dialoginfo.c -+++ b/src/modules/pua_dialoginfo/pua_dialoginfo.c -@@ -83,6 +83,7 @@ unsigned short pubruri_callee_avp_type; - int_str pubruri_callee_avp_name; - sruid_t _puadi_sruid; - -+static char *DLG_VAR_SEP = ","; - static str caller_dlg_var = {0, 0}; /* pubruri_caller */ - static str callee_dlg_var = {0, 0}; /* pubruri_callee */ - static str caller_entity_when_publish_disabled = {0, 0}; /* pubruri_caller */ -@@ -596,7 +597,6 @@ struct str_list *get_str_list(unsigned short avp_flags, int_str avp_name) - { - - int_str avp_value; -- unsigned int len; - struct str_list *list_first = 0; - struct str_list *list_current = 0; - struct search_state st; -@@ -606,33 +606,122 @@ struct str_list *get_str_list(unsigned short avp_flags, int_str avp_name) - } - - do { -- - LM_DBG("AVP found '%.*s'\n", avp_value.s.len, avp_value.s.s); -- -- len = sizeof(struct str_list) + avp_value.s.len; -- - if(list_current) { -- list_current->next = (struct str_list *)shm_malloc(len); -+ list_current->next = -+ (struct str_list *)shm_malloc(sizeof(struct str_list)); - list_current = list_current->next; - } else { -- list_current = list_first = (struct str_list *)shm_malloc(len); -+ list_current = list_first = -+ (struct str_list *)shm_malloc(sizeof(struct str_list)); - } -- -- if(list_current == 0) { -+ if(!list_current) { - SHM_MEM_ERROR; -- return 0; -+ free_str_list_all(list_first); -+ return NULL; -+ } -+ memset(list_current, 0, sizeof(struct str_list)); -+ list_current->s.s = shm_str2char_dup(&avp_value.s); -+ if(!list_current->s.s) { -+ free_str_list_all(list_first); -+ return NULL; - } -+ list_current->s.len = avp_value.s.len; -+ } while(search_next_avp(&st, &avp_value)); - -- memset(list_current, 0, len); -+ return list_first; -+} - -- list_current->s.s = (char *)list_current + sizeof(struct str_list); -- list_current->s.len = avp_value.s.len; -- memcpy(list_current->s.s, avp_value.s.s, avp_value.s.len); -+/** -+ * @brief set dlg_var value from str_list as comma separated values -+ * -+ * @param dlg dialog -+ * @param key dlg_var keyname -+ * @param lst list of str values -+ * @return int -+ */ -+static int set_dlg_var(struct dlg_cell *dlg, str *key, struct str_list *lst) -+{ -+ str buf = STR_NULL; -+ struct str_list *it = lst; -+ int num = -1; -+ int res; - -+ if(!lst) -+ return -1; - -- } while(search_next_avp(&st, &avp_value)); -+ while(it) { -+ buf.len += it->s.len + ++num; -+ it = it->next; -+ } -+ buf.s = (char *)pkg_malloc(sizeof(char) * buf.len); -+ -+ it = lst; -+ num = 0; -+ while(it) { -+ memcpy(buf.s + num, it->s.s, it->s.len); -+ if(it->next) { -+ num += it->s.len; -+ buf.s[num++] = *DLG_VAR_SEP; -+ } -+ it = it->next; -+ } -+ res = dlg_api.set_dlg_var(dlg, key, &buf); -+ pkg_free(buf.s); - -- return list_first; -+ return res; -+} -+ -+static int get_dlg_var(struct dlg_cell *dlg, str *key, struct str_list **lst) -+{ -+ str dval = STR_NULL; -+ str val = STR_NULL; -+ struct str_list *it, *prev; -+ char *sep, *ini, *end; -+ -+ if(dlg_api.get_dlg_varval(dlg, &caller_dlg_var, &dval) != 0 -+ || dval.s == NULL) -+ return 0; -+ -+ if(*lst) { -+ free_str_list_all(*lst); -+ } -+ *lst = prev = NULL; -+ ini = dval.s; -+ end = dval.s + dval.len - 1; -+ sep = stre_search_strz(ini, end, DLG_VAR_SEP); -+ if(!sep) -+ sep = end; -+ do { -+ val.s = ini; -+ val.len = sep - ini + 1; -+ ini = sep + 1; -+ it = (struct str_list *)shm_malloc(sizeof(struct str_list)); -+ if(!it) { -+ SHM_MEM_ERROR; -+ return -1; -+ } -+ memset(it, 0, sizeof(struct str_list)); -+ it->s.s = shm_str2char_dup(&val); -+ if(!it->s.s) { -+ free_str_list_all(*lst); -+ return -1; -+ } -+ it->s.len = val.len; -+ LM_DBG("Found uri '%.*s' in dlg_var:'%.*s'\n", val.len, val.s, key->len, -+ key->s); -+ if(!*lst) { -+ *lst = prev = it; -+ } else { -+ prev->next = it; -+ } -+ if(ini < end) -+ sep = stre_search_strz(ini, end, DLG_VAR_SEP); -+ else -+ sep = NULL; -+ } while(sep); -+ -+ return 0; - } - - struct dlginfo_cell *get_dialog_data(struct dlg_cell *dlg, int type, -@@ -640,7 +729,6 @@ struct dlginfo_cell *get_dialog_data(struct dlg_cell *dlg, int type, - { - struct dlginfo_cell *dlginfo; - int len; -- str dval = {0}; - - // generate new random uuid - if(sruid_next_safe(&_puadi_sruid) < 0) { -@@ -701,59 +789,35 @@ struct dlginfo_cell *get_dialog_data(struct dlg_cell *dlg, int type, - dlginfo->pubruris_callee = get_str_list( - pubruri_callee_avp_type, pubruri_callee_avp_name); - -- if(dlginfo->pubruris_callee != NULL && callee_dlg_var.len > 0) -- dlg_api.set_dlg_var( -- dlg, &callee_dlg_var, &dlginfo->pubruris_callee->s); -- -- if(dlginfo->pubruris_caller != NULL && caller_dlg_var.len > 0) -- dlg_api.set_dlg_var( -- dlg, &caller_dlg_var, &dlginfo->pubruris_caller->s); -- -+ if(dlginfo->pubruris_callee != NULL && callee_dlg_var.len > 0) { -+ if(set_dlg_var(dlg, &callee_dlg_var, dlginfo->pubruris_callee) -+ < 0) { -+ free_str_list_all(dlginfo->pubruris_callee); -+ dlginfo->pubruris_callee = NULL; -+ } -+ } -+ if(dlginfo->pubruris_caller != NULL && caller_dlg_var.len > 0) { -+ if(set_dlg_var(dlg, &caller_dlg_var, dlginfo->pubruris_caller) -+ < 0) { -+ free_str_list_all(dlginfo->pubruris_caller); -+ dlginfo->pubruris_caller = NULL; -+ } -+ } - } else { -- if(caller_dlg_var.len > 0 -- && (dlg_api.get_dlg_varval(dlg, &caller_dlg_var, &dval) -- == 0) -- && dval.s != NULL) { -- dlginfo->pubruris_caller = (struct str_list *)shm_malloc( -- sizeof(struct str_list) + dval.len + 1); -- if(dlginfo->pubruris_caller == 0) { -- SHM_MEM_ERROR; -+ if(caller_dlg_var.len > 0) { -+ if(get_dlg_var(dlg, &caller_dlg_var, &dlginfo->pubruris_caller) -+ < 0) { - free_dlginfo_cell(dlginfo); - return NULL; - } -- memset(dlginfo->pubruris_caller, 0, sizeof(struct str_list)); -- dlginfo->pubruris_caller->s.s = -- (char *)dlginfo->pubruris_caller -- + sizeof(sizeof(struct str_list)); -- memcpy(dlginfo->pubruris_caller->s.s, dval.s, dval.len); -- dlginfo->pubruris_caller->s.s[dval.len] = '\0'; -- dlginfo->pubruris_caller->s.len = dval.len; -- LM_DBG("Found pubruris_caller in dialog '%.*s'\n", -- dlginfo->pubruris_caller->s.len, -- dlginfo->pubruris_caller->s.s); - } - -- if(callee_dlg_var.len > 0 -- && (dlg_api.get_dlg_varval(dlg, &callee_dlg_var, &dval) -- == 0) -- && dval.s != NULL) { -- dlginfo->pubruris_callee = (struct str_list *)shm_malloc( -- sizeof(struct str_list) + dval.len + 1); -- if(dlginfo->pubruris_callee == 0) { -- SHM_MEM_ERROR; -+ if(callee_dlg_var.len > 0) { -+ if(get_dlg_var(dlg, &callee_dlg_var, &dlginfo->pubruris_callee) -+ < 0) { - free_dlginfo_cell(dlginfo); - return NULL; - } -- memset(dlginfo->pubruris_callee, 0, sizeof(struct str_list)); -- dlginfo->pubruris_callee->s.s = -- (char *)dlginfo->pubruris_callee -- + sizeof(sizeof(struct str_list)); -- memcpy(dlginfo->pubruris_callee->s.s, dval.s, dval.len); -- dlginfo->pubruris_callee->s.s[dval.len] = '\0'; -- dlginfo->pubruris_callee->s.len = dval.len; -- LM_DBG("Found pubruris_callee in dialog '%.*s'\n", -- dlginfo->pubruris_callee->s.len, -- dlginfo->pubruris_callee->s.s); - } - } - -@@ -772,7 +836,12 @@ struct dlginfo_cell *get_dialog_data(struct dlg_cell *dlg, int type, - return NULL; - } - memset(dlginfo->pubruris_caller, 0, sizeof(struct str_list)); -- dlginfo->pubruris_caller->s = dlginfo->from_uri; -+ dlginfo->pubruris_caller->s.s = shm_str2char_dup(&dlginfo->from_uri); -+ if(!dlginfo->pubruris_caller->s.s) { -+ free_dlginfo_cell(dlginfo); -+ return NULL; -+ } -+ dlginfo->pubruris_caller->s.len = dlginfo->from_uri.len; - - dlginfo->pubruris_callee = - (struct str_list *)shm_malloc(sizeof(struct str_list)); -@@ -784,9 +853,11 @@ struct dlginfo_cell *get_dialog_data(struct dlg_cell *dlg, int type, - memset(dlginfo->pubruris_callee, 0, sizeof(struct str_list)); - - if(include_req_uri) { -- dlginfo->pubruris_callee->s = dlginfo->req_uri; -+ dlginfo->pubruris_callee->s.s = shm_str2char_dup(&dlginfo->req_uri); -+ dlginfo->pubruris_callee->s.len = dlginfo->req_uri.len; - } else { -- dlginfo->pubruris_callee->s = dlginfo->to_uri; -+ dlginfo->pubruris_callee->s.s = shm_str2char_dup(&dlginfo->to_uri); -+ dlginfo->pubruris_callee->s.len = dlginfo->to_uri.len; - } - } - -@@ -1105,10 +1176,10 @@ void free_str_list_all(struct str_list *del_current) - struct str_list *del_next; - - while(del_current) { -- - del_next = del_current->next; -+ if(del_current->s.s) -+ shm_free(del_current->s.s); - shm_free(del_current); -- - del_current = del_next; - } - } diff --git a/debian/patches/sipwise/pv_headers-rework-pvh_remove_header_param-take-two.patch b/debian/patches/sipwise/pv_headers-rework-pvh_remove_header_param-take-two.patch deleted file mode 100644 index f0b0437ca..000000000 --- a/debian/patches/sipwise/pv_headers-rework-pvh_remove_header_param-take-two.patch +++ /dev/null @@ -1,245 +0,0 @@ -From: Victor Seva -Date: Mon, 29 Aug 2022 13:59:38 +0200 -Subject: pv_headers: rework pvh_remove_header_param, take two - -* pvh_set_xavi changes/removes xavi, so we need the new value -* after pvh_remove_header, search for the header again ---- - src/modules/pv_headers/pv_headers.c | 22 ++++++++++++++++------ - src/modules/pv_headers/pvh_func.c | 12 ++++++++---- - src/modules/pv_headers/pvh_xavp.c | 34 +++++++++++++++------------------- - src/modules/pv_headers/pvh_xavp.h | 2 +- - 4 files changed, 40 insertions(+), 30 deletions(-) - -diff --git a/src/modules/pv_headers/pv_headers.c b/src/modules/pv_headers/pv_headers.c -index a833b96..fdb6f2e 100644 ---- a/src/modules/pv_headers/pv_headers.c -+++ b/src/modules/pv_headers/pv_headers.c -@@ -224,12 +224,15 @@ static int w_pvh_header_param_exists(struct sip_msg *msg, char *p1, char *p2) - static int ki_pvh_remove_header_param( - struct sip_msg *msg, str *hname, str *toRemove) - { -- int idx; -+ int next; -+ int idx = 0; - int new_size; - str dst = STR_NULL; - sr_xavp_t *avi = pvh_xavi_get_child(msg, &xavi_name, hname); - -- for(idx = 0; avi != NULL; avi = xavi_get_next(avi)) { -+ while(avi) { -+ next = 1; -+ LM_DBG("hname:%.*s[%d]\n", STR_FMT(hname), idx); - if(avi->val.type == SR_XTYPE_STR && avi->val.v.s.s != NULL) { - if(str_casesearch(&avi->val.v.s, toRemove) != NULL) { - new_size = pvh_remove_header_param_helper( -@@ -239,15 +242,19 @@ static int ki_pvh_remove_header_param( - STR_FMT(hname), idx); - if(pvh_remove_header(msg, hname, idx) < 0) - return -1; -+ avi = pvh_xavi_get_child(msg, &xavi_name, hname); -+ if(idx > 0) -+ idx = 0; -+ next = 0; - } else if(dst.len < 0 || new_size == avi->val.v.s.len) { - LM_DBG("'%.*s' not found at '%.*s'\n", STR_FMT(toRemove), - STR_FMT(&avi->val.v.s)); - } else { - LM_DBG("old_value:'%.*s' new_value:'%.*s'\n", - STR_FMT(&avi->val.v.s), STR_FMT(&dst)); -- if(pvh_set_xavi(msg, &xavi_name, hname, &dst, SR_XTYPE_STR, -- idx, 0) -- < 0) { -+ avi = pvh_set_xavi( -+ msg, &xavi_name, hname, &dst, SR_XTYPE_STR, idx, 0); -+ if(avi == NULL) { - LM_ERR("can't set new value\n"); - return -1; - } -@@ -257,7 +264,10 @@ static int ki_pvh_remove_header_param( - STR_FMT(&avi->val.v.s)); - } - } -- idx++; -+ if(next) { -+ avi = xavi_get_next(avi); -+ idx++; -+ } - } - return 1; - } -diff --git a/src/modules/pv_headers/pvh_func.c b/src/modules/pv_headers/pvh_func.c -index 7b1c6f9..b0e7a82 100644 ---- a/src/modules/pv_headers/pvh_func.c -+++ b/src/modules/pv_headers/pvh_func.c -@@ -325,12 +325,16 @@ int pvh_check_header(struct sip_msg *msg, str *hname) - - int pvh_append_header(struct sip_msg *msg, str *hname, str *hvalue) - { -- return pvh_set_xavi(msg, &xavi_name, hname, hvalue, SR_XTYPE_STR, 0, 1); -+ if(pvh_set_xavi(msg, &xavi_name, hname, hvalue, SR_XTYPE_STR, 0, 1) == NULL) -+ return -1; -+ return 1; - } - - int pvh_modify_header(struct sip_msg *msg, str *hname, str *hvalue, int indx) - { -- return pvh_set_xavi(msg, &xavi_name, hname, hvalue, SR_XTYPE_STR, indx, 0); -+ if(pvh_set_xavi(msg, &xavi_name, hname, hvalue, SR_XTYPE_STR, indx, 0) == NULL) -+ return -1; -+ return 1; - } - - int pvh_remove_header(struct sip_msg *msg, str *hname, int indx) -@@ -346,12 +350,12 @@ int pvh_remove_header(struct sip_msg *msg, str *hname, int indx) - do { - if(pvh_set_xavi( - msg, &xavi_name, hname, NULL, SR_XTYPE_STR, indx++, 0) -- < 1) -+ == NULL) - return -1; - } while(indx < count); - } else { - if(pvh_set_xavi(msg, &xavi_name, hname, NULL, SR_XTYPE_STR, indx, 0) -- < 1) -+ == NULL) - return -1; - } - -diff --git a/src/modules/pv_headers/pvh_xavp.c b/src/modules/pv_headers/pvh_xavp.c -index e52f9da..fb9a714 100644 ---- a/src/modules/pv_headers/pvh_xavp.c -+++ b/src/modules/pv_headers/pvh_xavp.c -@@ -131,18 +131,18 @@ static sr_xavp_t *pvh_xavi_new_value(str *name, sr_xval_t *val) - return avp; - } - --int pvh_xavi_append_value(str *name, sr_xval_t *val, sr_xavp_t **start) -+static sr_xavp_t * pvh_xavi_append_value(str *name, sr_xval_t *val, sr_xavp_t **start) - { - sr_xavp_t *last = NULL; - sr_xavp_t *xavi = NULL; - - if((xavi = pvh_xavi_new_value(name, val)) == NULL) -- return -1; -+ return xavi; - - if(*start == NULL) { - xavi->next = *start; - *start = xavi; -- return 1; -+ return xavi; - } - - last = *start; -@@ -150,13 +150,13 @@ int pvh_xavi_append_value(str *name, sr_xval_t *val, sr_xavp_t **start) - last = last->next; - last->next = xavi; - -- return 1; -+ return xavi; - } - - /** - * - */ --static int pvh_xavi_set_value( -+static sr_xavp_t * pvh_xavi_set_value( - str *name, sr_xval_t *val, int idx, sr_xavp_t **start) - { - int cnt = 0; -@@ -166,14 +166,11 @@ static int pvh_xavi_set_value( - idx = idx + cnt; - if(idx < 0) { - LM_ERR("wrong calculated idx:%d\n", idx); -- return -1; -+ return NULL; - } - } - LM_DBG("xavi name: %.*s\n", name->len, name->s); -- if(xavi_set_value(name, idx, val, start) == NULL) -- return -1; -- -- return 1; -+ return xavi_set_value(name, idx, val, start); - } - - /** -@@ -356,11 +353,12 @@ int pvh_xavi_keys_count(sr_xavp_t **start) - /** - * - */ --int pvh_set_xavi(struct sip_msg *msg, str *xname, str *name, void *data, -+sr_xavp_t * pvh_set_xavi(struct sip_msg *msg, str *xname, str *name, void *data, - sr_xtype_t type, int idx, int append) - { - sr_xavp_t **xavi = NULL; - sr_xavp_t *root = NULL; -+ sr_xavp_t *result = NULL; - sr_xval_t root_xval; - sr_xval_t xval; - char t[header_name_size]; -@@ -368,7 +366,7 @@ int pvh_set_xavi(struct sip_msg *msg, str *xname, str *name, void *data, - - if(xname == NULL || name == NULL) { - LM_ERR("missing xavi/pv name\n"); -- return -1; -+ return result; - } - - pvh_get_branch_xname(msg, xname, &br_xname); -@@ -385,7 +383,7 @@ int pvh_set_xavi(struct sip_msg *msg, str *xname, str *name, void *data, - xval.v.data = (sr_data_t *)shm_malloc(sizeof(sr_data_t)); - if(xval.v.data == NULL) { - SHM_MEM_ERROR; -- return -1; -+ return result; - } - memset(xval.v.data, 0, sizeof(sr_data_t)); - xval.v.data->p = data; -@@ -409,7 +407,7 @@ int pvh_set_xavi(struct sip_msg *msg, str *xname, str *name, void *data, - - if((root = xavi_add_value(&br_xname, &root_xval, NULL)) == NULL) { - LM_ERR("error create xavi %.*s\n", br_xname.len, br_xname.s); -- return -1; -+ return NULL; - } - xavi = &root->val.v.xavp; - } else if(xavi_get_child(&br_xname, name) == NULL) { -@@ -417,20 +415,18 @@ int pvh_set_xavi(struct sip_msg *msg, str *xname, str *name, void *data, - } - - if(append) { -- if(pvh_xavi_append_value(name, &xval, xavi) < 0) { -+ if((result = pvh_xavi_append_value(name, &xval, xavi)) == NULL) { - LM_ERR("error append xavi=>name %.*s=>%.*s\n", br_xname.len, - br_xname.s, name->len, name->s); -- return -1; - } - } else { -- if(pvh_xavi_set_value(name, &xval, idx, xavi) < 0) { -+ if((result = pvh_xavi_set_value(name, &xval, idx, xavi)) == NULL) { - LM_ERR("error modify xavi=>name %.*s=>%.*s idx=%d\n", br_xname.len, - br_xname.s, name->len, name->s, idx); -- return -1; - } - } - -- return 1; -+ return result; - } - - -diff --git a/src/modules/pv_headers/pvh_xavp.h b/src/modules/pv_headers/pvh_xavp.h -index 646ebd7..2ced2eb 100644 ---- a/src/modules/pv_headers/pvh_xavp.h -+++ b/src/modules/pv_headers/pvh_xavp.h -@@ -33,7 +33,7 @@ - - int pvh_reply_append(sr_xavp_t **start); - --int pvh_set_xavi(struct sip_msg *msg, str *xname, str *name, void *data, -+sr_xavp_t * pvh_set_xavi(struct sip_msg *msg, str *xname, str *name, void *data, - sr_xtype_t type, int idx, int append); - int pvh_xavi_keys_count(sr_xavp_t **start); - sr_xavp_t *pvh_xavi_get_child(struct sip_msg *msg, str *xname, str *name); diff --git a/debian/patches/sipwise/pv_trans_eval_uri.patch b/debian/patches/sipwise/pv_trans_eval_uri.patch index 483c98a1c..6178a839c 100644 --- a/debian/patches/sipwise/pv_trans_eval_uri.patch +++ b/debian/patches/sipwise/pv_trans_eval_uri.patch @@ -7,10 +7,10 @@ Subject: pv_trans_eval_uri 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/pv/pv_trans.c b/src/modules/pv/pv_trans.c -index e4754e7..07a3957 100644 +index 0cc6f8f..b36b55b 100644 --- a/src/modules/pv/pv_trans.c +++ b/src/modules/pv/pv_trans.c -@@ -1542,7 +1542,8 @@ int tr_eval_uri( +@@ -1544,7 +1544,8 @@ int tr_eval_uri( } /* parse uri -- params only when requested */ if(parse_uri(_tr_uri.s, _tr_uri.len - dlen, &_tr_parsed_uri) != 0) { diff --git a/debian/patches/sipwise/rtpengine-set-mime-content-length.patch b/debian/patches/sipwise/rtpengine-set-mime-content-length.patch deleted file mode 100644 index df7dbb796..000000000 --- a/debian/patches/sipwise/rtpengine-set-mime-content-length.patch +++ /dev/null @@ -1,193 +0,0 @@ -From: Sipwise Development Team -Date: Fri, 18 Aug 2023 12:49:37 +0200 -Subject: rtpengine-set-mime-content-length - ---- - src/modules/rtpengine/rtpengine.c | 43 ++++++++++++++++++++++++--------- - src/modules/rtpengine/rtpengine_funcs.c | 9 ++++--- - src/modules/rtpengine/rtpengine_funcs.h | 3 +-- - 3 files changed, 38 insertions(+), 17 deletions(-) - -diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c -index 442df8d..1c7da31 100644 ---- a/src/modules/rtpengine/rtpengine.c -+++ b/src/modules/rtpengine/rtpengine.c -@@ -2550,7 +2550,7 @@ error: - - static bencode_item_t *rtpp_function_call(bencode_buffer_t *bencbuf, - struct sip_msg *msg, enum rtpe_operation op, const char *flags_str, -- str *body_out) -+ str *body_out, str *cl_field) - { - struct ng_flags_parse ng_flags; - bencode_item_t *item, *resp; -@@ -2616,7 +2616,7 @@ static bencode_item_t *rtpp_function_call(bencode_buffer_t *bencbuf, - body = pv_val.rs; - } - -- } else if((cont_type = extract_body(msg, &body)) == -1) { -+ } else if((cont_type = extract_body(msg, &body, cl_field)) == -1) { - LM_ERR("can't extract body from the message\n"); - goto error; - } -@@ -2953,7 +2953,7 @@ static int rtpp_function_call_simple( - bencode_buffer_t bencbuf; - bencode_item_t *ret; - -- ret = rtpp_function_call(&bencbuf, msg, op, flags_str, NULL); -+ ret = rtpp_function_call(&bencbuf, msg, op, flags_str, NULL, NULL); - if(!ret) - return -1; - -@@ -2976,11 +2976,11 @@ static int rtpengine_simple_wrap( - - static bencode_item_t *rtpp_function_call_ok(bencode_buffer_t *bencbuf, - struct sip_msg *msg, enum rtpe_operation op, const char *flags_str, -- str *body) -+ str *body, str *cl_field) - { - bencode_item_t *ret; - -- ret = rtpp_function_call(bencbuf, msg, op, flags_str, body); -+ ret = rtpp_function_call(bencbuf, msg, op, flags_str, body, cl_field); - if(!ret) - return NULL; - -@@ -3804,7 +3804,7 @@ static int rtpengine_delete(struct sip_msg *msg, const char *flags) - { - bencode_buffer_t bencbuf; - bencode_item_t *ret = -- rtpp_function_call_ok(&bencbuf, msg, OP_DELETE, flags, NULL); -+ rtpp_function_call_ok(&bencbuf, msg, OP_DELETE, flags, NULL, NULL); - if(!ret) - return -1; - parse_call_stats(ret, msg); -@@ -3816,7 +3816,7 @@ static int rtpengine_query(struct sip_msg *msg, const char *flags) - { - bencode_buffer_t bencbuf; - bencode_item_t *ret = -- rtpp_function_call_ok(&bencbuf, msg, OP_QUERY, flags, NULL); -+ rtpp_function_call_ok(&bencbuf, msg, OP_QUERY, flags, NULL, NULL); - if(!ret) - return -1; - parse_call_stats(ret, msg); -@@ -4097,9 +4097,11 @@ static int rtpengine_offer_answer(struct sip_msg *msg, const char *flags, - str body, newbody; - struct lump *anchor; - pv_value_t pv_val; -- str cur_body = {0, 0}; -+ str cur_body = STR_NULL; -+ str cl_field = STR_NULL; -+ str cl_repl = STR_NULL; - -- dict = rtpp_function_call_ok(&bencbuf, msg, op, flags, &body); -+ dict = rtpp_function_call_ok(&bencbuf, msg, op, flags, &body, &cl_field); - if(!dict) - return -1; - -@@ -4129,6 +4131,21 @@ static int rtpengine_offer_answer(struct sip_msg *msg, const char *flags, - pkg_free(newbody.s); - - } else { -+ if(cl_field.len) { -+ anchor = del_lump(msg, cl_field.s - msg->buf, cl_field.len, 0); -+ cl_repl.s = pkg_malloc(10); -+ if(!cl_repl.s) { -+ LM_ERR("pkg_malloc for Content-Length failed\n"); -+ goto error_free; -+ } -+ cl_repl.len = snprintf(cl_repl.s, 10, "%i", (int)newbody.len); -+ if(!insert_new_lump_after(anchor, cl_repl.s, cl_repl.len, 0)) { -+ LM_ERR("insert_new_lump_after failed\n"); -+ goto error_free; -+ } -+ cl_repl.s = NULL; -+ } -+ - if(read_sdp_pvar_str.len > 0) { - /* get the body from the message as body ptr may have changed - * when using read_sdp_pv */ -@@ -4156,6 +4173,8 @@ static int rtpengine_offer_answer(struct sip_msg *msg, const char *flags, - - error_free: - pkg_free(newbody.s); -+ if(cl_repl.s) -+ pkg_free(cl_repl.s); - error: - bencode_buffer_free(&bencbuf); - return -1; -@@ -4219,7 +4238,7 @@ static int rtpengine_play_media( - pv_value_t val; - int retval = 1; - -- ret = rtpp_function_call_ok(&bencbuf, msg, OP_PLAY_MEDIA, d, NULL); -+ ret = rtpp_function_call_ok(&bencbuf, msg, OP_PLAY_MEDIA, d, NULL, NULL); - if(!ret) - return -1; - if(media_duration_pvar) { -@@ -4283,7 +4302,7 @@ static int rtpengine_rtpstat_wrap( - param = parms[0]; - res = parms[1]; - -- dict = rtpp_function_call_ok(&bencbuf, msg, OP_QUERY, NULL, NULL); -+ dict = rtpp_function_call_ok(&bencbuf, msg, OP_QUERY, NULL, NULL, NULL); - if(!dict) - return -1; - -@@ -4452,7 +4471,7 @@ static int rtpengine_query_v_wrap( - fmt = parms[0]; - dst = parms[1]; - -- dict = rtpp_function_call_ok(&bencbuf, msg, OP_QUERY, NULL, NULL); -+ dict = rtpp_function_call_ok(&bencbuf, msg, OP_QUERY, NULL, NULL, NULL); - if(!dict) { - return -1; - } -diff --git a/src/modules/rtpengine/rtpengine_funcs.c b/src/modules/rtpengine/rtpengine_funcs.c -index 7ef7c8b..dde9cf5 100644 ---- a/src/modules/rtpengine/rtpengine_funcs.c -+++ b/src/modules/rtpengine/rtpengine_funcs.c -@@ -66,7 +66,7 @@ - * 2: multipart - * 3: trickle ice sdp fragment - */ --int check_content_type(struct sip_msg *msg) -+static int check_content_type(struct sip_msg *msg) - { - static unsigned int appl[16] = {0x6c707061 /*appl*/, 0x6c707041 /*Appl*/, - 0x6c705061 /*aPpl*/, 0x6c705041 /*APpl*/, 0x6c507061 /*apPl*/, -@@ -156,7 +156,7 @@ other: - /* - * Get message body and check Content-Type header field - */ --int extract_body(struct sip_msg *msg, str *body) -+int extract_body(struct sip_msg *msg, str *body, str *cl_field) - { - char c; - int ret; -@@ -234,7 +234,10 @@ int extract_body(struct sip_msg *msg, str *body) - break; - if(hf.type == HDR_ERROR_T) - return -1; -- if(hf.type == HDR_CONTENTTYPE_T) { -+ if(hf.type == HDR_CONTENTLENGTH_T) { -+ if(cl_field) -+ *cl_field = hf.body; -+ } else if(hf.type == HDR_CONTENTTYPE_T) { - if(decode_mime_type(hf.body.s, hf.body.s + hf.body.len, &mime) - == NULL) - return -1; -diff --git a/src/modules/rtpengine/rtpengine_funcs.h b/src/modules/rtpengine/rtpengine_funcs.h -index a1221bd..ea0a720 100644 ---- a/src/modules/rtpengine/rtpengine_funcs.h -+++ b/src/modules/rtpengine/rtpengine_funcs.h -@@ -27,8 +27,7 @@ - #include "../../core/parser/msg_parser.h" - #include "../../core/parser/contact/contact.h" - --int extract_body(struct sip_msg *, str *); --int check_content_type(struct sip_msg *); -+int extract_body(struct sip_msg *, str *, str *); - int get_callid(struct sip_msg *, str *); - int get_to_tag(struct sip_msg *, str *); - int get_from_tag(struct sip_msg *, str *); diff --git a/debian/patches/sipwise/sca-add-pai_avp-parameter.patch b/debian/patches/sipwise/sca-add-pai_avp-parameter.patch index 2a6790961..529ccb912 100644 --- a/debian/patches/sipwise/sca-add-pai_avp-parameter.patch +++ b/debian/patches/sipwise/sca-add-pai_avp-parameter.patch @@ -97,10 +97,10 @@ index 3d08921..44b354e 100644 #endif // SCA_H diff --git a/src/modules/sca/sca_call_info.c b/src/modules/sca/sca_call_info.c -index e4c9b11..43153ee 100644 +index dde6e1b..1e97a2f 100644 --- a/src/modules/sca/sca_call_info.c +++ b/src/modules/sca/sca_call_info.c -@@ -1138,20 +1138,32 @@ static int sca_call_info_insert_asserted_identity( +@@ -1144,20 +1144,32 @@ static int sca_call_info_insert_asserted_identity( str aor = STR_NULL; str hdr = STR_NULL; int len; @@ -139,7 +139,7 @@ index e4c9b11..43153ee 100644 #define SCA_P_ASSERTED_IDENTITY_HDR_PREFIX "P-Asserted-Identity: " #define SCA_P_ASSERTED_IDENTITY_HDR_PREFIX_LEN strlen("P-Asserted-Identity: ") -@@ -1197,7 +1209,7 @@ static int sca_call_info_insert_asserted_identity( +@@ -1203,7 +1215,7 @@ static int sca_call_info_insert_asserted_identity( rc = 1; done: diff --git a/debian/patches/sipwise/sca-call-info-unsubscribe.patch b/debian/patches/sipwise/sca-call-info-unsubscribe.patch index e5b3ee835..c507e4c2b 100644 --- a/debian/patches/sipwise/sca-call-info-unsubscribe.patch +++ b/debian/patches/sipwise/sca-call-info-unsubscribe.patch @@ -7,10 +7,10 @@ Subject: sca-call-info-unsubscribe 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/modules/sca/sca_subscribe.c b/src/modules/sca/sca_subscribe.c -index 14c6062..86d348d 100644 +index 3a7d46f..b5f473b 100644 --- a/src/modules/sca/sca_subscribe.c +++ b/src/modules/sca/sca_subscribe.c -@@ -1160,6 +1160,8 @@ int ki_sca_handle_subscribe(sip_msg_t *msg, str *uri_to, str *uri_from) +@@ -1171,6 +1171,8 @@ int ki_sca_handle_subscribe(sip_msg_t *msg, str *uri_to, str *uri_from) int released = 0; int_str val; sca_to_body_t tmp_to; @@ -19,7 +19,7 @@ index 14c6062..86d348d 100644 memset(&tmp_to, 0, sizeof(tmp_to)); if(parse_headers(msg, HDR_EOH_F, 0) < 0) { -@@ -1252,12 +1254,17 @@ int ki_sca_handle_subscribe(sip_msg_t *msg, str *uri_to, str *uri_from) +@@ -1263,12 +1265,17 @@ int ki_sca_handle_subscribe(sip_msg_t *msg, str *uri_to, str *uri_from) } } @@ -39,7 +39,7 @@ index 14c6062..86d348d 100644 // this will remove the subscription if expires == 0 if(sca_subscription_update_unsafe(sca, sub, &req_sub, idx) < 0) { SCA_SUB_REPLY_ERROR(sca, 500, -@@ -1314,10 +1321,25 @@ int ki_sca_handle_subscribe(sip_msg_t *msg, str *uri_to, str *uri_from) +@@ -1325,10 +1332,25 @@ int ki_sca_handle_subscribe(sip_msg_t *msg, str *uri_to, str *uri_from) LM_INFO("sca_handle_subscribe: released %d appearances " "for subscriber %.*s\n", released, STR_FMT(&req_sub.subscriber)); @@ -65,7 +65,7 @@ index 14c6062..86d348d 100644 // in-dialog request, but we didn't find it. if(!SCA_STR_EMPTY(to_tag)) { SCA_SUB_REPLY_ERROR( -@@ -1356,6 +1378,8 @@ int ki_sca_handle_subscribe(sip_msg_t *msg, str *uri_to, str *uri_from) +@@ -1367,6 +1389,8 @@ int ki_sca_handle_subscribe(sip_msg_t *msg, str *uri_to, str *uri_from) // we got an in-dialog SUBSCRIBE with an "Expires: 0" header, // but the dialog wasn't in our table. just reply with the // subscription info we got, without saving or creating anything. diff --git a/debian/patches/sipwise/sca-debug.patch b/debian/patches/sipwise/sca-debug.patch index ba7995967..8c8aab999 100644 --- a/debian/patches/sipwise/sca-debug.patch +++ b/debian/patches/sipwise/sca-debug.patch @@ -9,7 +9,7 @@ Subject: sca-debug 3 files changed, 59 insertions(+), 1 deletion(-) diff --git a/src/modules/sca/sca_appearance.c b/src/modules/sca/sca_appearance.c -index c467137..c141a6e 100644 +index fcc94c4..79f56ba 100644 --- a/src/modules/sca/sca_appearance.c +++ b/src/modules/sca/sca_appearance.c @@ -911,8 +911,10 @@ int sca_appearance_update_index(sca_mod *scam, str *aor, int idx, int state, @@ -47,10 +47,10 @@ index c467137..c141a6e 100644 } } diff --git a/src/modules/sca/sca_call_info.c b/src/modules/sca/sca_call_info.c -index abca7d4..6b02041 100644 +index b2aa8bb..ef481a5 100644 --- a/src/modules/sca/sca_call_info.c +++ b/src/modules/sca/sca_call_info.c -@@ -975,6 +975,8 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, +@@ -981,6 +981,8 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, if(!upstream && !SCA_CALL_INFO_IS_SHARED_CALLER(call_info)) { // caller isn't SCA, no more to do. update callee in reply handler. @@ -59,7 +59,7 @@ index abca7d4..6b02041 100644 rc = 1; goto done; } -@@ -992,6 +994,7 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, +@@ -998,6 +1000,7 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, } if(sca_call_is_held(msg)) { @@ -67,7 +67,7 @@ index abca7d4..6b02041 100644 state = SCA_APPEARANCE_STATE_HELD; if(call_info->state == SCA_APPEARANCE_STATE_HELD_PRIVATE) { state = SCA_APPEARANCE_STATE_HELD_PRIVATE; -@@ -1000,13 +1003,17 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, +@@ -1006,13 +1009,17 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, } } else if(!SCA_STR_EMPTY(&to->tag_value)) { // this is a reINVITE from an SCA line that put the call on hold @@ -85,7 +85,7 @@ index abca7d4..6b02041 100644 } } -@@ -1179,6 +1186,8 @@ static int sca_call_info_insert_asserted_identity( +@@ -1185,6 +1192,8 @@ static int sca_call_info_insert_asserted_identity( memcpy(hdr.s + hdr.len, CRLF, CRLF_LEN); hdr.len += CRLF_LEN; @@ -94,7 +94,7 @@ index abca7d4..6b02041 100644 // append the PAI header before the sdp body if(insert_new_lump_before(anchor, hdr.s, hdr.len, HDR_PAI_T) == NULL) { LM_ERR("Failed to add PAI header %.*s\n", STR_FMT(&hdr)); -@@ -1220,11 +1229,19 @@ static int sca_call_info_invite_reply_200_handler(sip_msg_t *msg, +@@ -1226,11 +1235,19 @@ static int sca_call_info_invite_reply_200_handler(sip_msg_t *msg, if(SCA_CALL_INFO_IS_SHARED_CALLEE(call_info) && (!SCA_STR_EQ(from_aor, to_aor))) { @@ -114,7 +114,7 @@ index abca7d4..6b02041 100644 goto done; } -@@ -1252,6 +1269,8 @@ static int sca_call_info_invite_reply_200_handler(sip_msg_t *msg, +@@ -1258,6 +1275,8 @@ static int sca_call_info_invite_reply_200_handler(sip_msg_t *msg, &from->tag_value, NULL, slot_idx); if(app == NULL) { // no SCA line is involved with this call @@ -123,7 +123,7 @@ index abca7d4..6b02041 100644 rc = 1; goto done; } -@@ -1426,6 +1445,8 @@ void sca_call_info_ack_from_handler(sip_msg_t *msg, str *from_aor, str *to_aor) +@@ -1432,6 +1451,8 @@ void sca_call_info_ack_from_handler(sip_msg_t *msg, str *from_aor, str *to_aor) sca_appearance_update_state_unsafe(app, state); // can't send NOTIFYs until we unlock the slot below } @@ -132,7 +132,7 @@ index abca7d4..6b02041 100644 } done: -@@ -1593,7 +1614,11 @@ static int sca_call_info_bye_handler(sip_msg_t *msg, sca_call_info *call_info, +@@ -1599,7 +1620,11 @@ static int sca_call_info_bye_handler(sip_msg_t *msg, sca_call_info *call_info, str *tag = NULL; if(msg->first_line.type == SIP_REQUEST) { @@ -144,7 +144,7 @@ index abca7d4..6b02041 100644 slot_idx = sca_uri_lock_shared_appearance(sca, from_aor); if(slot_idx < 0) { LM_ERR("sca_call_info_bye_handler: failed to acquire " -@@ -1647,6 +1672,10 @@ static int sca_call_info_bye_handler(sip_msg_t *msg, sca_call_info *call_info, +@@ -1653,6 +1678,10 @@ static int sca_call_info_bye_handler(sip_msg_t *msg, sca_call_info *call_info, goto done; } } @@ -155,7 +155,7 @@ index abca7d4..6b02041 100644 } if(slot_idx >= 0) { -@@ -1702,6 +1731,7 @@ static int sca_call_info_bye_handler(sip_msg_t *msg, sca_call_info *call_info, +@@ -1708,6 +1737,7 @@ static int sca_call_info_bye_handler(sip_msg_t *msg, sca_call_info *call_info, } } } else { @@ -163,7 +163,7 @@ index abca7d4..6b02041 100644 // this is just a backup to catch anything missed on the BYE request if(SCA_CALL_INFO_IS_SHARED_CALLEE(call_info)) { slot_idx = sca_hash_table_index_for_key(sca->appearances, to_aor); -@@ -2087,28 +2117,37 @@ int sca_call_info_update( +@@ -2093,28 +2123,37 @@ int sca_call_info_update( if(sca_uri_is_shared_appearance(sca, &from_aor)) { if((update_mask & SCA_CALL_INFO_SHARED_CALLER)) { call_info.ua_shared |= SCA_CALL_INFO_SHARED_CALLER; diff --git a/debian/patches/sipwise/sca-fallback-if-no-contact.patch b/debian/patches/sipwise/sca-fallback-if-no-contact.patch index 6f008b54c..dcac54f97 100644 --- a/debian/patches/sipwise/sca-fallback-if-no-contact.patch +++ b/debian/patches/sipwise/sca-fallback-if-no-contact.patch @@ -7,10 +7,10 @@ Subject: sca-fallback-if-no-contact 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/modules/sca/sca_call_info.c b/src/modules/sca/sca_call_info.c -index 414536d..2ded7fc 100644 +index 08a3ecf..a78d3c6 100644 --- a/src/modules/sca/sca_call_info.c +++ b/src/modules/sca/sca_call_info.c -@@ -1978,9 +1978,6 @@ int sca_call_info_update( +@@ -1984,9 +1984,6 @@ int sca_call_info_update( rc = -1; goto done; } @@ -20,7 +20,7 @@ index 414536d..2ded7fc 100644 } // reset rc to -1 so we don't end up returning 0 to the script rc = -1; -@@ -2027,6 +2024,13 @@ int sca_call_info_update( +@@ -2033,6 +2030,13 @@ int sca_call_info_update( LM_DBG("to_aor[%.*s] from_aor[%.*s]\n", STR_FMT(&to_aor), STR_FMT(&from_aor)); diff --git a/debian/patches/sipwise/sca-fix-notify-after-bye.patch b/debian/patches/sipwise/sca-fix-notify-after-bye.patch index 1d7e57571..8b10c20e6 100644 --- a/debian/patches/sipwise/sca-fix-notify-after-bye.patch +++ b/debian/patches/sipwise/sca-fix-notify-after-bye.patch @@ -7,10 +7,10 @@ Subject: sca-fix-notify-after-bye 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/sca/sca_call_info.c b/src/modules/sca/sca_call_info.c -index 6b02041..e4c9b11 100644 +index ef481a5..dde6e1b 100644 --- a/src/modules/sca/sca_call_info.c +++ b/src/modules/sca/sca_call_info.c -@@ -714,7 +714,7 @@ static int sca_call_info_uri_update(str *aor, sca_call_info *call_info, +@@ -720,7 +720,7 @@ static int sca_call_info_uri_update(str *aor, sca_call_info *call_info, dialog.id.s = dlg_buf; if(sca_dialog_build_from_tags( diff --git a/debian/patches/sipwise/sca-fix-on-hold-detection-when-upstream-flow.patch b/debian/patches/sipwise/sca-fix-on-hold-detection-when-upstream-flow.patch index 85654f479..f0d52d23d 100644 --- a/debian/patches/sipwise/sca-fix-on-hold-detection-when-upstream-flow.patch +++ b/debian/patches/sipwise/sca-fix-on-hold-detection-when-upstream-flow.patch @@ -7,10 +7,10 @@ Subject: sca-fix-on-hold-detection-when-upstream-flow 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/sca/sca_call_info.c b/src/modules/sca/sca_call_info.c -index 27335d0..abca7d4 100644 +index e28bfed..b2aa8bb 100644 --- a/src/modules/sca/sca_call_info.c +++ b/src/modules/sca/sca_call_info.c -@@ -948,11 +948,13 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, +@@ -954,11 +954,13 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, int state = SCA_APPEARANCE_STATE_UNKNOWN; int rc = -1; str *target_aor = from_aor; @@ -24,7 +24,7 @@ index 27335d0..abca7d4 100644 } LM_DBG("For From-AOR %.*s To-AOR: %.*s: From: <%.*s> To: <%.*s> " -@@ -971,7 +973,7 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, +@@ -977,7 +979,7 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, goto done; } diff --git a/debian/patches/sipwise/sca-fix-pickup-when-upstream-flow.patch b/debian/patches/sipwise/sca-fix-pickup-when-upstream-flow.patch index 8b0aaabf6..827938fbc 100644 --- a/debian/patches/sipwise/sca-fix-pickup-when-upstream-flow.patch +++ b/debian/patches/sipwise/sca-fix-pickup-when-upstream-flow.patch @@ -7,10 +7,10 @@ Subject: sca-fix-pickup-when-upstream-flow 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/src/modules/sca/sca_call_info.c b/src/modules/sca/sca_call_info.c -index 0178da8..27335d0 100644 +index 78cfc35..e28bfed 100644 --- a/src/modules/sca/sca_call_info.c +++ b/src/modules/sca/sca_call_info.c -@@ -947,6 +947,13 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, +@@ -953,6 +953,13 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, str state_str = STR_NULL; int state = SCA_APPEARANCE_STATE_UNKNOWN; int rc = -1; @@ -24,7 +24,7 @@ index 0178da8..27335d0 100644 LM_DBG("For From-AOR %.*s To-AOR: %.*s: From: <%.*s> To: <%.*s> " "Contact: <%.*s> Call-Info: appearance-index=%d\n", -@@ -960,7 +967,7 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, +@@ -966,7 +973,7 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, < 0) { LM_ERR("sca_call_info_invite_request_handler: failed to register " "callback for INVITE %.*s ACK\n", @@ -33,7 +33,7 @@ index 0178da8..27335d0 100644 goto done; } -@@ -978,7 +985,7 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, +@@ -984,7 +991,7 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, < 0) { LM_ERR("sca_call_info_invite_request_handler: failed to register " "callback for INVITE %.*s ACK\n", @@ -42,7 +42,7 @@ index 0178da8..27335d0 100644 goto done; } -@@ -1011,16 +1018,16 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, +@@ -1017,16 +1024,16 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, } if(sca_appearance_update_index( @@ -63,7 +63,7 @@ index 0178da8..27335d0 100644 goto done; } -@@ -1365,6 +1372,7 @@ void sca_call_info_ack_from_handler(sip_msg_t *msg, str *from_aor, str *to_aor) +@@ -1371,6 +1378,7 @@ void sca_call_info_ack_from_handler(sip_msg_t *msg, str *from_aor, str *to_aor) str *tag; int slot_idx = -1; int state = SCA_APPEARANCE_STATE_IDLE; @@ -71,7 +71,7 @@ index 0178da8..27335d0 100644 memset(&from, 0, sizeof(from)); memset(&to, 0, sizeof(to)); -@@ -1378,19 +1386,24 @@ void sca_call_info_ack_from_handler(sip_msg_t *msg, str *from_aor, str *to_aor) +@@ -1384,19 +1392,24 @@ void sca_call_info_ack_from_handler(sip_msg_t *msg, str *from_aor, str *to_aor) goto done; } @@ -105,7 +105,7 @@ index 0178da8..27335d0 100644 STR_FMT(tag)); goto done; } -@@ -1418,10 +1431,10 @@ done: +@@ -1424,10 +1437,10 @@ done: sca_hash_table_unlock_index(sca->appearances, slot_idx); if(state != SCA_APPEARANCE_STATE_IDLE) { diff --git a/debian/patches/sipwise/sca-line-seize.patch b/debian/patches/sipwise/sca-line-seize.patch index d48ff43ef..b73e9e13e 100644 --- a/debian/patches/sipwise/sca-line-seize.patch +++ b/debian/patches/sipwise/sca-line-seize.patch @@ -211,10 +211,10 @@ index bd94e14..6ce3112 100644 enum { diff --git a/src/modules/sca/sca_call_info.c b/src/modules/sca/sca_call_info.c -index 838feca..414536d 100644 +index 2694239..08a3ecf 100644 --- a/src/modules/sca/sca_call_info.c +++ b/src/modules/sca/sca_call_info.c -@@ -842,44 +842,46 @@ static int sca_call_info_is_line_seize_reinvite(sip_msg_t *msg, +@@ -848,44 +848,46 @@ static int sca_call_info_is_line_seize_reinvite(sip_msg_t *msg, */ static void sca_call_info_local_error_reply_handler(sip_msg_t *msg, int status) { @@ -270,7 +270,7 @@ index 838feca..414536d 100644 } // two typical cases to handle. in the first case, we haven't dropped -@@ -901,7 +903,7 @@ static void sca_call_info_local_error_reply_handler(sip_msg_t *msg, int status) +@@ -907,7 +909,7 @@ static void sca_call_info_local_error_reply_handler(sip_msg_t *msg, int status) } else if(rc == 0) { // no line-seize subscription found app = sca_appearance_unlink_by_tags(sca, &aor, &msg->callid->body, @@ -279,7 +279,7 @@ index 838feca..414536d 100644 if(app) { sca_appearance_free(app); if(sca_notify_call_info_subscribers(sca, &aor) < 0) { -@@ -911,6 +913,14 @@ static void sca_call_info_local_error_reply_handler(sip_msg_t *msg, int status) +@@ -917,6 +919,14 @@ static void sca_call_info_local_error_reply_handler(sip_msg_t *msg, int status) } } } @@ -294,7 +294,7 @@ index 838feca..414536d 100644 } void sca_call_info_response_ready_cb( -@@ -1351,28 +1361,30 @@ static int sca_call_info_invite_reply_error_handler(sip_msg_t *msg, +@@ -1357,28 +1367,30 @@ static int sca_call_info_invite_reply_error_handler(sip_msg_t *msg, void sca_call_info_ack_from_handler(sip_msg_t *msg, str *from_aor, str *to_aor) { sca_appearance *app; @@ -331,7 +331,7 @@ index 838feca..414536d 100644 goto done; } -@@ -1406,17 +1418,25 @@ done: +@@ -1412,17 +1424,25 @@ done: } } } @@ -358,7 +358,7 @@ index 838feca..414536d 100644 if(!(type & TMCB_E2EACK_IN)) { return; } -@@ -1429,9 +1449,9 @@ void sca_call_info_ack_cb(struct cell *t, int type, struct tmcb_params *params) +@@ -1435,9 +1455,9 @@ void sca_call_info_ack_cb(struct cell *t, int type, struct tmcb_params *params) LM_ERR("sca_call_info_ack_cb: failed to get To-header\n"); goto done; } @@ -370,7 +370,7 @@ index 838feca..414536d 100644 goto done; } -@@ -1445,7 +1465,7 @@ void sca_call_info_ack_cb(struct cell *t, int type, struct tmcb_params *params) +@@ -1451,7 +1471,7 @@ void sca_call_info_ack_cb(struct cell *t, int type, struct tmcb_params *params) // on ACK, ensure SCA callee state is promoted to ACTIVE. app = sca_appearance_for_tags_unsafe(sca, &to_aor, @@ -379,7 +379,7 @@ index 838feca..414536d 100644 if(app && app->state == SCA_APPEARANCE_STATE_ACTIVE_PENDING) { LM_DBG("promoting %.*s appearance-index %d to active\n", STR_FMT(&to_aor), app->index); -@@ -1467,6 +1487,9 @@ done: +@@ -1473,6 +1493,9 @@ done: if(from_aor.s != NULL) { pkg_free(from_aor.s); } @@ -389,7 +389,7 @@ index 838feca..414536d 100644 } static int sca_call_info_invite_handler(sip_msg_t *msg, -@@ -1736,11 +1759,13 @@ void sca_call_info_sl_reply_cb(void *cb_arg) +@@ -1742,11 +1765,13 @@ void sca_call_info_sl_reply_cb(void *cb_arg) { sl_cbp_t *slcbp = (sl_cbp_t *)cb_arg; sip_msg_t *msg; @@ -405,7 +405,7 @@ index 838feca..414536d 100644 if(slcbp == NULL) { return; } -@@ -1768,31 +1793,31 @@ void sca_call_info_sl_reply_cb(void *cb_arg) +@@ -1774,31 +1799,31 @@ void sca_call_info_sl_reply_cb(void *cb_arg) slcbp->code, STR_FMT(slcbp->reason)); return; } @@ -443,7 +443,7 @@ index 838feca..414536d 100644 } if(sca_subscription_terminate(sca, &aor, SCA_EVENT_TYPE_LINE_SEIZE, -@@ -1802,7 +1827,15 @@ void sca_call_info_sl_reply_cb(void *cb_arg) +@@ -1808,7 +1833,15 @@ void sca_call_info_sl_reply_cb(void *cb_arg) LM_ERR("sca_call_info_sl_reply_cb: failed to terminate " "line-seize subscription for %.*s\n", STR_FMT(&contact_uri)); @@ -460,7 +460,7 @@ index 838feca..414536d 100644 } } -@@ -1844,20 +1877,21 @@ int sca_call_info_update( +@@ -1850,20 +1883,21 @@ int sca_call_info_update( { sca_call_info call_info; hdr_field_t *call_info_hdr; @@ -485,7 +485,7 @@ index 838feca..414536d 100644 n_dispatch = sizeof(call_info_dispatch) / sizeof(call_info_dispatch[0]); for(i = 0; i < n_dispatch; i++) { -@@ -1868,7 +1902,7 @@ int sca_call_info_update( +@@ -1874,7 +1908,7 @@ int sca_call_info_update( if(i >= n_dispatch) { if(msg->cseq == NULL && ((parse_headers(msg, HDR_CSEQ_F, 0) == -1) @@ -494,7 +494,7 @@ index 838feca..414536d 100644 LM_ERR("no CSEQ header\n"); return (1); } -@@ -1900,6 +1934,9 @@ int sca_call_info_update( +@@ -1906,6 +1940,9 @@ int sca_call_info_update( } } @@ -504,7 +504,7 @@ index 838feca..414536d 100644 memset(&call_info, 0, sizeof(sca_call_info)); call_info_hdr = get_hdr(msg, HDR_CALLINFO_T); if(!SCA_HEADER_EMPTY(call_info_hdr)) { -@@ -1912,34 +1949,22 @@ int sca_call_info_update( +@@ -1918,34 +1955,22 @@ int sca_call_info_update( } if(uri_from != NULL) { @@ -550,7 +550,7 @@ index 838feca..414536d 100644 LM_ERR("Bad To header\n"); goto done; } -@@ -1967,27 +1992,35 @@ int sca_call_info_update( +@@ -1973,27 +1998,35 @@ int sca_call_info_update( goto done; } aor_flags |= SCA_CALL_INFO_UPDATE_FLAG_FROM_ALLOC; @@ -597,7 +597,7 @@ index 838feca..414536d 100644 } } -@@ -2037,11 +2070,11 @@ int sca_call_info_update( +@@ -2043,11 +2076,11 @@ int sca_call_info_update( LM_DBG("Calling Dispatch Id: %d handler with From-AOR: %.*s To-AOR: %.*s " "From-URI: <%.*s> To-URI: <%.*s> Contact-URI: <%.*s>\n", @@ -613,7 +613,7 @@ index 838feca..414536d 100644 if(rc < 0) { LM_ERR("Failed to update Call-Info state for %.*s\n", STR_FMT(&contact_uri)); -@@ -2058,16 +2091,11 @@ done: +@@ -2064,16 +2097,11 @@ done: pkg_free(to_aor.s); } } @@ -673,7 +673,7 @@ index d308954..dee234c 100644 int sca_dialog_build_from_tags(sca_dialog *, int, str *, str *, str *); int sca_dialog_create_replaces_header(sca_dialog *, str *); diff --git a/src/modules/sca/sca_subscribe.c b/src/modules/sca/sca_subscribe.c -index dc33f00..14c6062 100644 +index 895141e..3a7d46f 100644 --- a/src/modules/sca/sca_subscribe.c +++ b/src/modules/sca/sca_subscribe.c @@ -844,8 +844,8 @@ static int sca_subscription_update_unsafe(sca_mod *scam, @@ -687,7 +687,7 @@ index dc33f00..14c6062 100644 dlg_id_tmp = (char *)shm_malloc(len); if(dlg_id_tmp == NULL) { -@@ -986,17 +986,19 @@ int sca_subscription_delete_subscriber_for_event( +@@ -997,17 +997,19 @@ int sca_subscription_delete_subscriber_for_event( int sca_subscription_from_request(sca_mod *scam, sip_msg_t *msg, int event_type, sca_subscription *req_sub) { @@ -709,7 +709,7 @@ index dc33f00..14c6062 100644 // parse required info first if(!SCA_HEADER_EMPTY(msg->expires)) { -@@ -1023,10 +1025,6 @@ int sca_subscription_from_request(sca_mod *scam, sip_msg_t *msg, int event_type, +@@ -1034,10 +1036,6 @@ int sca_subscription_from_request(sca_mod *scam, sip_msg_t *msg, int event_type, expires = max_expires; } @@ -720,7 +720,7 @@ index dc33f00..14c6062 100644 if(SCA_HEADER_EMPTY(msg->callid)) { LM_ERR("Empty Call-ID header\n"); goto error; -@@ -1048,30 +1046,18 @@ int sca_subscription_from_request(sca_mod *scam, sip_msg_t *msg, int event_type, +@@ -1059,30 +1057,18 @@ int sca_subscription_from_request(sca_mod *scam, sip_msg_t *msg, int event_type, goto error; } @@ -756,7 +756,7 @@ index dc33f00..14c6062 100644 } if(parse_sip_msg_uri(msg) < 0) { -@@ -1080,7 +1066,7 @@ int sca_subscription_from_request(sca_mod *scam, sip_msg_t *msg, int event_type, +@@ -1091,7 +1077,7 @@ int sca_subscription_from_request(sca_mod *scam, sip_msg_t *msg, int event_type, } ruri = GET_RURI(msg); @@ -765,7 +765,7 @@ index dc33f00..14c6062 100644 if(to_tag.s == NULL) { // XXX need hook to detect when we have a subscription and the // subscriber sends an out-of-dialog SUBSCRIBE, which indicates the -@@ -1106,7 +1092,7 @@ int sca_subscription_from_request(sca_mod *scam, sip_msg_t *msg, int event_type, +@@ -1117,7 +1103,7 @@ int sca_subscription_from_request(sca_mod *scam, sip_msg_t *msg, int event_type, } } else { /* we are in-dialog */ @@ -774,7 +774,7 @@ index dc33f00..14c6062 100644 } req_sub->subscriber = contact_uri; -@@ -1124,7 +1110,7 @@ int sca_subscription_from_request(sca_mod *scam, sip_msg_t *msg, int event_type, +@@ -1135,7 +1121,7 @@ int sca_subscription_from_request(sca_mod *scam, sip_msg_t *msg, int event_type, req_sub->dialog.id.s = NULL; req_sub->dialog.id.len = 0; req_sub->dialog.call_id = msg->callid->body; @@ -783,7 +783,7 @@ index dc33f00..14c6062 100644 req_sub->dialog.to_tag.s = pkg_malloc(to_tag.len); if(req_sub->dialog.to_tag.s == NULL) { -@@ -1138,22 +1124,26 @@ int sca_subscription_from_request(sca_mod *scam, sip_msg_t *msg, int event_type, +@@ -1149,22 +1135,26 @@ int sca_subscription_from_request(sca_mod *scam, sip_msg_t *msg, int event_type, req_sub->dialog.notify_cseq = 0; req_sub->server_id = server_id; @@ -817,7 +817,7 @@ index dc33f00..14c6062 100644 { sca_subscription req_sub; sca_subscription *sub = NULL; -@@ -1168,7 +1158,10 @@ int ki_sca_handle_subscribe(sip_msg_t *msg) +@@ -1179,7 +1169,10 @@ int ki_sca_handle_subscribe(sip_msg_t *msg) int idx = -1; int rc = -1; int released = 0; @@ -828,7 +828,7 @@ index dc33f00..14c6062 100644 if(parse_headers(msg, HDR_EOH_F, 0) < 0) { LM_ERR("header parsing failed: bad request\n"); SCA_SUB_REPLY_ERROR(sca, 400, "Bad Request", msg); -@@ -1192,6 +1185,21 @@ int ki_sca_handle_subscribe(sip_msg_t *msg) +@@ -1203,6 +1196,21 @@ int ki_sca_handle_subscribe(sip_msg_t *msg) return (-1); } @@ -850,7 +850,7 @@ index dc33f00..14c6062 100644 if(sca_subscription_from_request(sca, msg, event_type, &req_sub) < 0) { SCA_SUB_REPLY_ERROR( sca, 400, "Bad Shared Call Appearance Request", msg); -@@ -1207,7 +1215,15 @@ int ki_sca_handle_subscribe(sip_msg_t *msg) +@@ -1218,7 +1226,15 @@ int ki_sca_handle_subscribe(sip_msg_t *msg) sca_subscription_print(&req_sub); // check to see if the message has a to-tag @@ -867,7 +867,7 @@ index dc33f00..14c6062 100644 // XXX should lock starting here and use unsafe methods below? -@@ -1387,13 +1403,15 @@ done: +@@ -1398,13 +1414,15 @@ done: if(req_sub.rr.s != NULL) { pkg_free(req_sub.rr.s); } @@ -917,7 +917,7 @@ index e27883e..44f93b7 100644 #endif // SCA_SUBSCRIBE_H diff --git a/src/modules/sca/sca_util.c b/src/modules/sca/sca_util.c -index 4ab4c6f..685cf8d 100644 +index e61fb74..1c1f66c 100644 --- a/src/modules/sca/sca_util.c +++ b/src/modules/sca/sca_util.c @@ -112,94 +112,134 @@ int sca_get_msg_cseq_method(sip_msg_t *msg) diff --git a/debian/patches/sipwise/sca-rr-is-direction.patch b/debian/patches/sipwise/sca-rr-is-direction.patch index 61a72e456..e9dd5a163 100644 --- a/debian/patches/sipwise/sca-rr-is-direction.patch +++ b/debian/patches/sipwise/sca-rr-is-direction.patch @@ -47,10 +47,10 @@ index 7a80847..3d08921 100644 }; typedef struct _sca_mod sca_mod; diff --git a/src/modules/sca/sca_call_info.c b/src/modules/sca/sca_call_info.c -index 2ded7fc..0178da8 100644 +index a78d3c6..78cfc35 100644 --- a/src/modules/sca/sca_call_info.c +++ b/src/modules/sca/sca_call_info.c -@@ -1362,6 +1362,7 @@ void sca_call_info_ack_from_handler(sip_msg_t *msg, str *from_aor, str *to_aor) +@@ -1368,6 +1368,7 @@ void sca_call_info_ack_from_handler(sip_msg_t *msg, str *from_aor, str *to_aor) { sca_appearance *app; sca_to_body_t from, to; @@ -58,7 +58,7 @@ index 2ded7fc..0178da8 100644 int slot_idx = -1; int state = SCA_APPEARANCE_STATE_IDLE; -@@ -1378,13 +1379,19 @@ void sca_call_info_ack_from_handler(sip_msg_t *msg, str *from_aor, str *to_aor) +@@ -1384,13 +1385,19 @@ void sca_call_info_ack_from_handler(sip_msg_t *msg, str *from_aor, str *to_aor) } if(sca_uri_lock_if_shared_appearance(sca, from_aor, &slot_idx)) { @@ -81,7 +81,7 @@ index 2ded7fc..0178da8 100644 goto done; } -@@ -1429,11 +1436,15 @@ done: +@@ -1435,11 +1442,15 @@ done: /* XXX needs extract routines */ void sca_call_info_ack_cb(struct cell *t, int type, struct tmcb_params *params) { @@ -98,7 +98,7 @@ index 2ded7fc..0178da8 100644 memset(&to, 0, sizeof(to)); -@@ -1464,8 +1475,18 @@ void sca_call_info_ack_cb(struct cell *t, int type, struct tmcb_params *params) +@@ -1470,8 +1481,18 @@ void sca_call_info_ack_cb(struct cell *t, int type, struct tmcb_params *params) } // on ACK, ensure SCA callee state is promoted to ACTIVE. @@ -119,7 +119,7 @@ index 2ded7fc..0178da8 100644 if(app && app->state == SCA_APPEARANCE_STATE_ACTIVE_PENDING) { LM_DBG("promoting %.*s appearance-index %d to active\n", STR_FMT(&to_aor), app->index); -@@ -1487,6 +1508,9 @@ done: +@@ -1493,6 +1514,9 @@ done: if(from_aor.s != NULL) { pkg_free(from_aor.s); } @@ -129,7 +129,7 @@ index 2ded7fc..0178da8 100644 if(to.flags & SCA_UTIL_FLAG_TO_BODY_ALLOC) { free_to(to.hdr); } -@@ -1551,6 +1575,7 @@ static int sca_call_info_bye_handler(sip_msg_t *msg, sca_call_info *call_info, +@@ -1557,6 +1581,7 @@ static int sca_call_info_bye_handler(sip_msg_t *msg, sca_call_info *call_info, sca_appearance *app = NULL; int slot_idx = -1; int rc = -1; @@ -137,7 +137,7 @@ index 2ded7fc..0178da8 100644 if(msg->first_line.type == SIP_REQUEST) { if(SCA_CALL_INFO_IS_SHARED_CALLER(call_info)) { -@@ -1568,14 +1593,20 @@ static int sca_call_info_bye_handler(sip_msg_t *msg, sca_call_info *call_info, +@@ -1574,14 +1599,20 @@ static int sca_call_info_bye_handler(sip_msg_t *msg, sca_call_info *call_info, } if(app == NULL) { // try to find it by tags @@ -161,7 +161,7 @@ index 2ded7fc..0178da8 100644 goto done; } -@@ -1616,8 +1647,14 @@ static int sca_call_info_bye_handler(sip_msg_t *msg, sca_call_info *call_info, +@@ -1622,8 +1653,14 @@ static int sca_call_info_bye_handler(sip_msg_t *msg, sca_call_info *call_info, goto done; } diff --git a/debian/patches/sipwise/switch_from_python2_to_python3.patch b/debian/patches/sipwise/switch_from_python2_to_python3.patch index 15a4bddf3..0cea8cef9 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 54ce274..fbcad97 100644 +index 8762de1..8232366 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/tmrec-ical.patch b/debian/patches/sipwise/tmrec-ical.patch index c9fb188bf..a43accfc7 100644 --- a/debian/patches/sipwise/tmrec-ical.patch +++ b/debian/patches/sipwise/tmrec-ical.patch @@ -102,7 +102,7 @@ index 0000000..5e44ba1 + +#endif diff --git a/src/modules/tmrec/tmrec_mod.c b/src/modules/tmrec/tmrec_mod.c -index 5cb57aa..7195a55 100644 +index 78949a9..519247c 100644 --- a/src/modules/tmrec/tmrec_mod.c +++ b/src/modules/tmrec/tmrec_mod.c @@ -41,6 +41,7 @@ diff --git a/debian/patches/sipwise/usrloc_dbro.patch b/debian/patches/sipwise/usrloc_dbro.patch index 856e608e8..5f580faef 100644 --- a/debian/patches/sipwise/usrloc_dbro.patch +++ b/debian/patches/sipwise/usrloc_dbro.patch @@ -8,10 +8,10 @@ Subject: usrloc_dbro 2 files changed, 69 insertions(+), 1 deletion(-) diff --git a/src/modules/usrloc/usrloc_mod.c b/src/modules/usrloc/usrloc_mod.c -index 16a48e4..2c77f29 100644 +index b14fe72..cd73d04 100644 --- a/src/modules/usrloc/usrloc_mod.c +++ b/src/modules/usrloc/usrloc_mod.c -@@ -198,6 +198,7 @@ str ulattrs_last_mod_col = str_init( +@@ -200,6 +200,7 @@ str ulattrs_last_mod_col = str_init( ULATTRS_LAST_MOD_COL); /*!< Name of column containing the last modified date */ str ul_db_url = str_init(DEFAULT_DB_URL); /*!< Database URL */ @@ -19,7 +19,7 @@ index 16a48e4..2c77f29 100644 int ul_timer_interval = 60; /*!< Timer interval in seconds */ int ul_db_mode = 0; /*!< Database sync scheme: 0-no db, 1-write through, 2-write back, 3-only db */ -@@ -239,6 +240,8 @@ static cmd_export_t cmds[] = { +@@ -243,6 +244,8 @@ static cmd_export_t cmds[] = { {0, 0, 0, 0, 0, 0} }; @@ -28,7 +28,7 @@ index 16a48e4..2c77f29 100644 /*! \brief * Exported parameters -@@ -255,6 +258,7 @@ static param_export_t params[] = { +@@ -259,6 +262,7 @@ static param_export_t params[] = { {"flags_column", PARAM_STR, &ul_flags_col}, {"cflags_column", PARAM_STR, &ul_cflags_col}, {"db_url", PARAM_STR, &ul_db_url}, @@ -36,7 +36,7 @@ index 16a48e4..2c77f29 100644 {"timer_interval", INT_PARAM, &ul_timer_interval}, {"db_mode", INT_PARAM, &ul_db_mode}, {"db_load", INT_PARAM, &ul_db_load}, -@@ -327,6 +331,39 @@ struct module_exports exports = { +@@ -334,6 +338,39 @@ struct module_exports exports = { }; /* clang-format on */ @@ -76,7 +76,7 @@ index 16a48e4..2c77f29 100644 /*! \brief * Module initialization function */ -@@ -430,7 +467,22 @@ static int mod_init(void) +@@ -440,7 +477,22 @@ static int mod_init(void) } } @@ -100,7 +100,7 @@ index 16a48e4..2c77f29 100644 ul_nat_bflag = 0; } else if(ul_nat_bflag >= 8 * sizeof(ul_nat_bflag)) { LM_ERR("bflag index (%d) too big!\n", ul_nat_bflag); -@@ -524,6 +576,16 @@ static int child_init(int _rank) +@@ -534,6 +586,16 @@ static int child_init(int _rank) LM_ERR("child(%d): failed to connect to database\n", _rank); return -1; } @@ -117,7 +117,7 @@ index 16a48e4..2c77f29 100644 /* _rank==PROC_SIPINIT is used even when fork is disabled */ if(_rank == ul_load_rank && ul_db_mode != DB_ONLY && ul_db_load) { /* if cache is used, populate domains from DB */ -@@ -554,6 +616,10 @@ static void destroy(void) +@@ -564,6 +626,10 @@ static void destroy(void) ul_dbf.close(ul_dbh); } diff --git a/debian/patches/upstream/core-timer_proc-don-t-execute-timers-on-destroy_modu.patch b/debian/patches/upstream/core-timer_proc-don-t-execute-timers-on-destroy_modu.patch deleted file mode 100644 index 80275661b..000000000 --- a/debian/patches/upstream/core-timer_proc-don-t-execute-timers-on-destroy_modu.patch +++ /dev/null @@ -1,80 +0,0 @@ -From: Victor Seva -Date: Tue, 21 Nov 2023 15:30:03 +0100 -Subject: core: timer_proc don't execute timers on shutdown phase - ---- - src/core/timer_proc.c | 19 +++++++++++++++++++ - 1 file changed, 19 insertions(+) - -diff --git a/src/core/timer_proc.c b/src/core/timer_proc.c -index 0b04cf6..55bd98d 100644 ---- a/src/core/timer_proc.c -+++ b/src/core/timer_proc.c -@@ -29,6 +29,7 @@ - #include "pt.h" - #include "ut.h" - #include "mem/shm_mem.h" -+#include "sr_module.h" - - #include - -@@ -76,6 +77,9 @@ int fork_basic_timer(int child_id, char *desc, int make_sock, timer_function *f, - if(cfg_child_init()) - return -1; - for(;;) { -+ if(unlikely(ksr_shutdown_phase() != 0)) { -+ return 0; -+ } - sleep(interval); - cfg_update(); - f(get_ticks(), param); /* ticks in s for compatibility with old -@@ -99,6 +103,9 @@ int fork_basic_timer_w(int child_id, char *desc, int make_sock, - if(cfg_child_init()) - return -1; - for(;;) { -+ if(unlikely(ksr_shutdown_phase() != 0)) { -+ return 0; -+ } - sleep(interval); - cfg_update(); - f(get_ticks(), worker, -@@ -141,6 +148,9 @@ int fork_basic_utimer(int child_id, char *desc, int make_sock, - if(cfg_child_init()) - return -1; - for(;;) { -+ if(unlikely(ksr_shutdown_phase() != 0)) { -+ return 0; -+ } - sleep_us(uinterval); - cfg_update(); - ts = get_ticks_raw(); -@@ -165,6 +175,9 @@ int fork_basic_utimer_w(int child_id, char *desc, int make_sock, - if(cfg_child_init()) - return -1; - for(;;) { -+ if(unlikely(ksr_shutdown_phase() != 0)) { -+ return 0; -+ } - sleep_us(uinterval); - cfg_update(); - ts = get_ticks_raw(); -@@ -273,6 +286,9 @@ int fork_sync_timer(int child_id, char *desc, int make_sock, timer_function *f, - if(cfg_child_init()) - return -1; - for(;;) { -+ if(unlikely(ksr_shutdown_phase() != 0)) { -+ return 0; -+ } - if(ts2 > interval) - sleep_us(1000); /* 1 millisecond sleep to catch up */ - else -@@ -324,6 +340,9 @@ int fork_sync_utimer(int child_id, char *desc, int make_sock, - if(cfg_child_init()) - return -1; - for(;;) { -+ if(unlikely(ksr_shutdown_phase() != 0)) { -+ return 0; -+ } - if(ts2 > uinterval) - sleep_us(1); - else diff --git a/debian/patches/upstream/http_client-Add-parameter-timeout_mode-timeout-in-se.patch b/debian/patches/upstream/http_client-Add-parameter-timeout_mode-timeout-in-se.patch deleted file mode 100644 index 8c26ebb15..000000000 --- a/debian/patches/upstream/http_client-Add-parameter-timeout_mode-timeout-in-se.patch +++ /dev/null @@ -1,183 +0,0 @@ -From: Nicolas C -Date: Tue, 24 Oct 2023 17:10:09 +0200 -Subject: http_client: Add parameter timeout_mode (timeout in seconds or - milliseconds) - -A new parameter timeout_mode is added. -This parameter defines if timeouts are enabled, and in which unit timeout values are expressed. -- 0 - Timeouts are disabled. -- 1 - Timeout values are in seconds (default). -- 2 - Timeout values are in milliseconds. - -Implementation detail: - -default global timeout = 0 (unconfigured). - -Parse connections as usual. If they have a timeout configured, use it. - -In mod_init: - if global timeout == 0 (unconfigured), and timeout_mode is 1 or 2: - if timeout_mode == 1 -> global timeout = 4 (seconds) - if timeout_mode == 2 -> global timeout = 4000 (milliseconds) - - for each connection "conn" (fixup): - if timeout_mode is not 1 or 2 -> conn.timeout = 0 (to reflect the fact that no timeout will be handled) - else if conn.timeout is not configured -> conn.timeout = global timeout (in seconds or milliseconds, depending on timeout_mode). - -When doing Curl requests (curL_request_url): - if timeout_mode == 1: set CURLOPT_TIMEOUT - if timeout_mode == 2: set CURLOPT_TIMEOUT_MS ---- - src/modules/http_client/curlcon.c | 28 +++++++++++++++++++++++++++- - src/modules/http_client/curlcon.h | 4 ++++ - src/modules/http_client/functions.c | 13 ++++++++++++- - src/modules/http_client/http_client.c | 27 +++++++++++++++++++++++---- - src/modules/http_client/http_client.h | 1 + - 5 files changed, 67 insertions(+), 6 deletions(-) - -diff --git a/src/modules/http_client/curlcon.c b/src/modules/http_client/curlcon.c -index bffd26c..35735b7 100644 ---- a/src/modules/http_client/curlcon.c -+++ b/src/modules/http_client/curlcon.c -@@ -403,7 +403,7 @@ int curl_parse_param(char *val) - } else if(pit->name.len == 7 - && strncmp(pit->name.s, "timeout", 7) == 0) { - if(str2int(&tok, &timeout) != 0) { -- /* Bad timeout */ -+ /* Bad value */ - LM_WARN("curl connection [%.*s]: timeout bad value. Using " - "default\n", - name.len, name.s); -@@ -854,3 +854,29 @@ curl_con_t *curl_init_con(str *name) - LM_DBG("CURL: Added connection [%.*s]\n", name->len, name->s); - return cc; - } -+ -+/*! Fixup CURL connections - if timeout is not configured, Use as default global connection_timeout. -+ */ -+void curl_conn_list_fixup(void) -+{ -+ curl_con_t *cc; -+ cc = _curl_con_root; -+ while (cc) { -+ if (!(timeout_mode == 1 || timeout_mode == 2)) { -+ /* Timeout is disabled globally. Set timeout to 0 for all connections to reflect this. */ -+ if (cc->timeout > 0) { -+ LM_WARN("curl connection [%.*s]: configured timeout is ignored " -+ "because timeouts are disabled (timeout_mode)\n", -+ cc->name.len, cc->name.s); -+ cc->timeout = 0; -+ } -+ } -+ else if (cc->timeout == 0) { -+ /* Timeout is not configured for that connection. -+ * Use as default global connection_timeout (which can be seconds or milliseconds). -+ */ -+ cc->timeout = default_connection_timeout; -+ } -+ cc = cc->next; -+ } -+} -\ No newline at end of file -diff --git a/src/modules/http_client/curlcon.h b/src/modules/http_client/curlcon.h -index ff5ebe1..3f77476 100644 ---- a/src/modules/http_client/curlcon.h -+++ b/src/modules/http_client/curlcon.h -@@ -52,4 +52,8 @@ int curl_parse_param(char *val); - curl_con_t *curl_get_connection(str *name); - curl_con_pkg_t *curl_get_pkg_connection(curl_con_t *con); - -+/*! Fixup CURL connections - if timeout is not configured, Use as default global connection_timeout. -+ */ -+void curl_conn_list_fixup(void); -+ - #endif -diff --git a/src/modules/http_client/functions.c b/src/modules/http_client/functions.c -index 1472da7..dda4721 100644 ---- a/src/modules/http_client/functions.c -+++ b/src/modules/http_client/functions.c -@@ -262,7 +262,18 @@ static int curL_request_url(struct sip_msg *_m, const char *_met, - curl, CURLOPT_SSL_VERIFYHOST, (long)params->verify_host ? 2 : 0); - - res |= curl_easy_setopt(curl, CURLOPT_NOSIGNAL, (long)1); -- res |= curl_easy_setopt(curl, CURLOPT_TIMEOUT, (long)params->timeout); -+ -+ /* timeout_mode parameter: -+ * - 0 : timeout is disabled. -+ * - 1 (default) : timeout value is in seconds. -+ * - 2 : timeout value is in milliseconds. -+ */ -+ if (timeout_mode == 1) { /* timeout is in seconds (default) */ -+ res |= curl_easy_setopt(curl, CURLOPT_TIMEOUT, (long)params->timeout); -+ } else if (timeout_mode == 2) { /* timeout is in milliseconds */ -+ res |= curl_easy_setopt(curl, CURLOPT_TIMEOUT_MS, (long)params->timeout); -+ } -+ - res |= curl_easy_setopt( - curl, CURLOPT_FOLLOWLOCATION, (long)params->http_follow_redirect); - if(params->http_follow_redirect) { -diff --git a/src/modules/http_client/http_client.c b/src/modules/http_client/http_client.c -index 430933e..4884424 100644 ---- a/src/modules/http_client/http_client.c -+++ b/src/modules/http_client/http_client.c -@@ -76,7 +76,8 @@ MODULE_VERSION - #define CURL_USER_AGENT_LEN (sizeof(CURL_USER_AGENT) - 1) - - /* Module parameter variables */ --unsigned int default_connection_timeout = 4; -+unsigned int default_connection_timeout = 0; /*!< 0 = not user configured - the default (4 seconds) will be used */ -+unsigned int timeout_mode = 1; /*!< 0 = timeout disabled, 1 (default) = timeout in seconds, 2 = timeout in ms */ - char *default_tls_cacert = - NULL; /*!< File name: Default CA cert to use for curl TLS connection */ - str default_tls_clientcert = -@@ -195,6 +196,7 @@ static cmd_export_t cmds[] = { - /* Exported parameters */ - static param_export_t params[] = { - {"connection_timeout", PARAM_INT, &default_connection_timeout}, -+ {"timeout_mode", PARAM_INT, &timeout_mode}, - {"cacert", PARAM_STRING, &default_tls_cacert }, - {"client_cert", PARAM_STR, &default_tls_clientcert }, - {"client_key", PARAM_STR, &default_tls_clientkey }, -@@ -310,10 +312,27 @@ static int mod_init(void) - } - } - -- if(default_connection_timeout == 0) { -- LM_ERR("CURL connection timeout set to zero. Using default 4 secs\n"); -- default_connection_timeout = 4; -+ /* timeout_mode parameter: -+ * - 0 : timeout is disabled. -+ * - 1 (default) : timeout value is in seconds. -+ * - 2 : timeout value is in milliseconds. -+ */ -+ if (!(timeout_mode == 1 || timeout_mode == 2)) { -+ if (default_connection_timeout > 0) { -+ LM_WARN("configured connection_timeout is ignored " -+ "because timeouts are disabled (timeout_mode)\n"); -+ } -+ } else if (default_connection_timeout == 0) { -+ LM_INFO("curl connection timeout set to zero. Using default 4 secs\n"); -+ if (timeout_mode == 1) { /* timeout is in seconds (default) */ -+ default_connection_timeout = 4; -+ } else if (timeout_mode == 2) { /* timeout is in milliseconds */ -+ default_connection_timeout = 4000; -+ } - } -+ /* Fixup named connections for which no specific timeout is configured. */ -+ curl_conn_list_fixup(); -+ - if(default_http_proxy_port == 0) { - LM_INFO("HTTP proxy port set to 0. Disabling HTTP proxy\n"); - } -diff --git a/src/modules/http_client/http_client.h b/src/modules/http_client/http_client.h -index 0f659f9..c56f411 100644 ---- a/src/modules/http_client/http_client.h -+++ b/src/modules/http_client/http_client.h -@@ -40,6 +40,7 @@ - #include "../../lib/srdb1/db.h" - - extern unsigned int default_connection_timeout; -+extern unsigned int timeout_mode; - extern char * - default_tls_cacert; /*!< File name: Default CA cert to use for curl TLS connection */ - extern str diff --git a/debian/patches/upstream/pv_headers-compare-result-of-pvh_set_xavi-with-NULL-.patch b/debian/patches/upstream/pv_headers-compare-result-of-pvh_set_xavi-with-NULL-.patch deleted file mode 100644 index 9195e7602..000000000 --- a/debian/patches/upstream/pv_headers-compare-result-of-pvh_set_xavi-with-NULL-.patch +++ /dev/null @@ -1,84 +0,0 @@ -From: Daniel-Constantin Mierla -Date: Wed, 23 Aug 2023 10:55:35 +0200 -Subject: pv_headers: compare result of pvh_set_xavi() with NULL for error - cases - -- the function returns a pointer ---- - src/modules/pv_headers/pvh_xavp.c | 18 +++++++++--------- - 1 file changed, 9 insertions(+), 9 deletions(-) - -diff --git a/src/modules/pv_headers/pvh_xavp.c b/src/modules/pv_headers/pvh_xavp.c -index fb9a714..b715baa 100644 ---- a/src/modules/pv_headers/pvh_xavp.c -+++ b/src/modules/pv_headers/pvh_xavp.c -@@ -618,11 +618,11 @@ int pvh_set_header( - 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) -+ == NULL) - goto err; - } else { - if(pvh_set_xavi(msg, &xavi_name, hname, NULL, SR_XTYPE_NULL, idx, 0) -- < 0) -+ == NULL) - goto err; - } - } else if(val->flags & (PV_VAL_STR | PV_TYPE_INT | PV_VAL_INT)) { -@@ -641,7 +641,7 @@ int pvh_set_header( - } - if(idx == 0 && idxf == PV_IDX_NONE) { - if(pvh_set_xavi(msg, &xavi_name, hname, &fval, SR_XTYPE_STR, 0, 1) -- < 0) -+ == NULL) - goto err; - } else if(idxf == PV_IDX_ALL) { - if(hname_cnt > 1) { -@@ -651,11 +651,11 @@ int pvh_set_header( - } - if(pvh_set_xavi(msg, &xavi_name, hname, &fval, SR_XTYPE_STR, 0, - hname_cnt ? 0 : 1) -- < 0) -+ == NULL) - goto err; - } else { - if(pvh_set_xavi(msg, &xavi_name, hname, &fval, SR_XTYPE_STR, idx, 0) -- < 0) -+ == NULL) - goto err; - } - if(pv_format) -@@ -693,7 +693,7 @@ xavp_c_data_t *pvh_set_parsed( - if(pvh_merge_uri(msg, SET_URI_T, cur, val, c_data) < 0) - goto err; - if(pvh_set_xavi(msg, &xavi_parsed_xname, hname, c_data, SR_XTYPE_DATA, 0, 0) -- < 0) -+ == NULL) - goto err; - LM_DBG("c_data from pvh_merge_uri hname:%.*s\n", hname->len, hname->s); - -@@ -856,12 +856,12 @@ int pvh_set_uri(struct sip_msg *msg, pv_param_t *param, int op, pv_value_t *val) - /* LM_DBG("xavi:%.*s hname:%.*s value:%.*s\n", xavi_name.len, xavi_name.s, - hname.len, hname.s, c_data->value.len, c_data->value.s); */ - if(pvh_set_xavi(msg, &xavi_name, &hname, &c_data->value, SR_XTYPE_STR, 0, 0) -- < 0) -+ == NULL) - goto err; - - if(pvh_set_xavi( - msg, &xavi_parsed_xname, &hname, c_data, SR_XTYPE_DATA, 0, 0) -- < 0) -+ == NULL) - goto err; - - if(pv_format) -@@ -1126,7 +1126,7 @@ int pvh_set_reply_sr( - case 2: // reason - if(pvh_set_xavi(msg, &xavi_name, &_hdr_reply_reason, &fval, - SR_XTYPE_STR, 0, 0) -- < 0) { -+ == NULL) { - LM_ERR("set reply: cannot set reply reason\n"); - goto err; - } diff --git a/debian/patches/sipwise/rtpengine_rework_rtpp_flags.patch b/debian/patches/upstream/rtpengine_rework_rtpp_flags.patch similarity index 87% rename from debian/patches/sipwise/rtpengine_rework_rtpp_flags.patch rename to debian/patches/upstream/rtpengine_rework_rtpp_flags.patch index 2a7a2b900..e7ac32304 100644 --- a/debian/patches/sipwise/rtpengine_rework_rtpp_flags.patch +++ b/debian/patches/upstream/rtpengine_rework_rtpp_flags.patch @@ -1,44 +1,43 @@ From: Donat Zenichev -Date: Mon, 25 Mar 2024 12:06:43 +0100 -Subject: MT#58535 rtpp_flags: add flags processing on the daemon side +Date: Sat, 16 Mar 2024 19:23:21 +0100 +Subject: [PATCH] rtpengine: add flags processing on the daemon side Introduce a versatile behavior of the rtpengine module -in terms of ability to parse flags on the daemon side, +in terms of ability to parse flags on rtpengine side, instead of module. Previous behavior is also kept. General points: -- rtpengine daemon supports rtpp flags processing from now on -- module still provides in the bencode (when calling daemon): - call-id, to/from tags, viabranch (so identification call data) -- even though the module's interface is updated, - a backwards compatibility is given, so no obligatory changes - from kamailio script users required -- each rtpengine module's function which takes rtpp flags - as a parameter, now is able to get a third parameter `viabranch`, - which is used to detect, which approach to use (older/newer): - - without the viabranch - older one used - - with the viabrnach - new one used, so rtpp flags parsing on - the daemoin side + - rtpengine daemon supports rtpp flags processing from now on + - module still provides in the bencode (when calling daemon): + call-id, to/from tags, viabranch (so identification call data) + - even though the module's interface is updated, + a backwards compatibility is given, so no obligatory changes + from kamailio script users required + - each rtpengine module's function which takes rtpp flags + as a parameter, now is able to get a third parameter `viabranch`, + which is used to detect, which approach to use (older/newer): + - without the viabranch - older one used + - with the viabrnach - new one used, so rtpp flags parsing on + rtpengine side -The goal is to deprecate processing of option flags on the module -side and only parse them on the daemon side. +The goal (for the future) is to deprecate processing of option flags +on the module side and only parse them using rtpengine. This brings a list of benifits, such as: -- no need to keep in sync daemon and module (for specific flags) -- support of different rtpp flag string formats (raw), so that, - for example, kamailio script users can use plain text or - bencode dictionary like format - -Change-Id: I3cd337236ed5aa07490ad4f038f4a9be957decb3 + - no need to keep in sync rtpengine and module (for specific flags) + - support of different rtpp flag string formats (raw), so that, + for example, kamailio script users can use plain text or + bencode dictionary like format, when providing flags from + the kamailio script --- - src/modules/rtpengine/rtpengine.c | 837 +++++++++++++++++++++++++++----------- - 1 file changed, 603 insertions(+), 234 deletions(-) + src/modules/rtpengine/rtpengine.c | 834 +++++++++++++++++++++++++++----------- + 1 file changed, 600 insertions(+), 234 deletions(-) diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c -index 1c7da31..a0ae7f9 100644 +index c0727ed..b116c05 100644 --- a/src/modules/rtpengine/rtpengine.c +++ b/src/modules/rtpengine/rtpengine.c -@@ -148,6 +148,11 @@ static const char *command_strings[] = { - [OP_PLAY_DTMF] = "play DTMF", +@@ -152,6 +152,11 @@ static const char *command_strings[] = { + [OP_PLAY_DTMF] = "play DTMF", }; +static const char *sip_type_strings[] = { @@ -46,10 +45,10 @@ index 1c7da31..a0ae7f9 100644 + [SIP_REPLY] = "sip_reply", +}; + - struct minmax_mos_stats - { + struct minmax_mos_stats { str mos_param; -@@ -226,8 +231,14 @@ static int fixup_free_rtpengine_query_v(void **param, int param_no); + str at_param; +@@ -228,8 +233,14 @@ static int fixup_free_rtpengine_query_v(void **param, int param_no); static int parse_flags(struct ng_flags_parse *, struct sip_msg *, enum rtpe_operation *, const char *); @@ -66,54 +65,54 @@ index 1c7da31..a0ae7f9 100644 enum rtpe_operation op, int more); static int fixup_set_id(void **param, int param_no); static int set_rtpengine_set_f(struct sip_msg *msg, char *str1, char *str2); -@@ -385,6 +396,8 @@ static cmd_export_t cmds[] = { - 0, ANY_ROUTE}, - {"play_media", (cmd_function)play_media_f, 1, fixup_spve_null, 0, - ANY_ROUTE}, -+ {"play_media", (cmd_function)play_media_f, 2, fixup_spve_spve, 0, -+ ANY_ROUTE}, - {"stop_media", (cmd_function)stop_media_f, 1, fixup_spve_null, 0, - ANY_ROUTE}, - {"stop_media", (cmd_function)stop_media_f, 0, 0, 0, ANY_ROUTE}, -@@ -394,25 +407,37 @@ static cmd_export_t cmds[] = { - ANY_ROUTE}, - {"rtpengine_offer", (cmd_function)rtpengine_offer1_f, 1, - fixup_spve_null, 0, ANY_ROUTE}, -+ {"rtpengine_offer", (cmd_function)rtpengine_offer1_f, 2, -+ fixup_spve_spve, 0, ANY_ROUTE}, - {"rtpengine_answer", (cmd_function)rtpengine_answer1_f, 0, 0, 0, - ANY_ROUTE}, - {"rtpengine_answer", (cmd_function)rtpengine_answer1_f, 1, - fixup_spve_null, 0, ANY_ROUTE}, -+ {"rtpengine_answer", (cmd_function)rtpengine_answer1_f, 2, -+ fixup_spve_spve, 0, ANY_ROUTE}, - {"rtpengine_info", (cmd_function)rtpengine_info1_f, 0, 0, 0, ANY_ROUTE}, - {"rtpengine_info", (cmd_function)rtpengine_info1_f, 1, fixup_spve_null, - 0, ANY_ROUTE}, -+ {"rtpengine_info", (cmd_function)rtpengine_info1_f, 2, fixup_spve_spve, -+ 0, ANY_ROUTE}, - {"rtpengine_manage", (cmd_function)rtpengine_manage1_f, 0, 0, 0, - ANY_ROUTE}, - {"rtpengine_manage", (cmd_function)rtpengine_manage1_f, 1, - fixup_spve_null, 0, ANY_ROUTE}, -+ {"rtpengine_manage", (cmd_function)rtpengine_manage1_f, 2, -+ fixup_spve_spve, 0, ANY_ROUTE}, - {"rtpengine_delete", (cmd_function)rtpengine_delete1_f, 0, 0, 0, - ANY_ROUTE}, - {"rtpengine_delete", (cmd_function)rtpengine_delete1_f, 1, - fixup_spve_null, 0, ANY_ROUTE}, -+ {"rtpengine_delete", (cmd_function)rtpengine_delete1_f, 2, -+ fixup_spve_spve, 0, ANY_ROUTE}, - {"rtpengine_query", (cmd_function)rtpengine_query1_f, 0, 0, 0, - ANY_ROUTE}, - {"rtpengine_query", (cmd_function)rtpengine_query1_f, 1, - fixup_spve_null, 0, ANY_ROUTE}, -+ {"rtpengine_query", (cmd_function)rtpengine_query1_f, 2, -+ fixup_spve_spve, 0, ANY_ROUTE}, - {"rtpengine_query_v", (cmd_function)w_rtpengine_query_v, 2, - fixup_rtpengine_query_v, fixup_free_rtpengine_query_v, - ANY_ROUTE}, -@@ -2277,6 +2302,127 @@ static int parse_codec_flag(struct ng_flags_parse *ng_flags, const str *key, +@@ -410,6 +421,8 @@ static cmd_export_t cmds[] = { + 0, ANY_ROUTE}, + {"play_media", (cmd_function)play_media_f, 1, fixup_spve_null, 0, + ANY_ROUTE}, ++ {"play_media", (cmd_function)play_media_f, 2, fixup_spve_spve, 0, ++ ANY_ROUTE}, + {"stop_media", (cmd_function)stop_media_f, 1, fixup_spve_null, 0, + ANY_ROUTE}, + {"stop_media", (cmd_function)stop_media_f, 0, 0, 0, ANY_ROUTE}, +@@ -419,25 +432,37 @@ static cmd_export_t cmds[] = { + ANY_ROUTE}, + {"rtpengine_offer", (cmd_function)rtpengine_offer1_f, 1, + fixup_spve_null, 0, ANY_ROUTE}, ++ {"rtpengine_offer", (cmd_function)rtpengine_offer1_f, 2, ++ fixup_spve_spve, 0, ANY_ROUTE}, + {"rtpengine_answer", (cmd_function)rtpengine_answer1_f, 0, 0, 0, + ANY_ROUTE}, + {"rtpengine_answer", (cmd_function)rtpengine_answer1_f, 1, + fixup_spve_null, 0, ANY_ROUTE}, ++ {"rtpengine_answer", (cmd_function)rtpengine_answer1_f, 2, ++ fixup_spve_spve, 0, ANY_ROUTE}, + {"rtpengine_info", (cmd_function)rtpengine_info1_f, 0, 0, 0, ANY_ROUTE}, + {"rtpengine_info", (cmd_function)rtpengine_info1_f, 1, fixup_spve_null, + 0, ANY_ROUTE}, ++ {"rtpengine_info", (cmd_function)rtpengine_info1_f, 2, fixup_spve_spve, ++ 0, ANY_ROUTE}, + {"rtpengine_manage", (cmd_function)rtpengine_manage1_f, 0, 0, 0, + ANY_ROUTE}, + {"rtpengine_manage", (cmd_function)rtpengine_manage1_f, 1, + fixup_spve_null, 0, ANY_ROUTE}, ++ {"rtpengine_manage", (cmd_function)rtpengine_manage1_f, 2, ++ fixup_spve_spve, 0, ANY_ROUTE}, + {"rtpengine_delete", (cmd_function)rtpengine_delete1_f, 0, 0, 0, + ANY_ROUTE}, + {"rtpengine_delete", (cmd_function)rtpengine_delete1_f, 1, + fixup_spve_null, 0, ANY_ROUTE}, ++ {"rtpengine_delete", (cmd_function)rtpengine_delete1_f, 2, ++ fixup_spve_spve, 0, ANY_ROUTE}, + {"rtpengine_query", (cmd_function)rtpengine_query1_f, 0, 0, 0, + ANY_ROUTE}, + {"rtpengine_query", (cmd_function)rtpengine_query1_f, 1, + fixup_spve_null, 0, ANY_ROUTE}, ++ {"rtpengine_query", (cmd_function)rtpengine_query1_f, 2, ++ fixup_spve_spve, 0, ANY_ROUTE}, + {"rtpengine_query_v", (cmd_function)w_rtpengine_query_v, 2, + fixup_rtpengine_query_v, fixup_free_rtpengine_query_v, + ANY_ROUTE}, +@@ -2654,6 +2679,124 @@ static int parse_codec_flag(struct ng_flags_parse *ng_flags, const str *key, return 1; } @@ -235,13 +234,10 @@ index 1c7da31..a0ae7f9 100644 + return 0; +} + -+/** -+ * parse rtpp flags by module -+ */ - static int parse_flags(struct ng_flags_parse *ng_flags, struct sip_msg *msg, - enum rtpe_operation *op, const char *flags_str) - { -@@ -2548,28 +2694,34 @@ error: + /** + * Parse the flags string + */ +@@ -2934,28 +3077,33 @@ error: return -1; } @@ -263,7 +259,6 @@ index 1c7da31..a0ae7f9 100644 str viabranch = STR_NULL; str body = STR_NULL, error = STR_NULL; int ret, queried_nodes = 0, cont_type = 0; -+ unsigned int branch_idx; + unsigned int parse_by_module = (p_viabranch) ? 0 : 1; struct rtpp_node *node; char *cp; @@ -283,7 +278,7 @@ index 1c7da31..a0ae7f9 100644 if(IS_SIP(msg) || IS_SIP_REPLY(msg)) { if(get_callid(msg, &ng_flags.call_id) == -1 || ng_flags.call_id.len == 0) { -@@ -2586,54 +2738,70 @@ static bencode_item_t *rtpp_function_call(bencode_buffer_t *bencbuf, +@@ -2972,54 +3120,70 @@ static bencode_item_t *rtpp_function_call(bencode_buffer_t *bencbuf, return NULL; } } @@ -382,7 +377,7 @@ index 1c7da31..a0ae7f9 100644 if(!IS_SIP(msg) && !IS_SIP_REPLY(msg)) { /* check required values */ if(ng_flags.call_id.len == 0) { -@@ -2646,130 +2814,95 @@ static bencode_item_t *rtpp_function_call(bencode_buffer_t *bencbuf, +@@ -3032,130 +3196,95 @@ static bencode_item_t *rtpp_function_call(bencode_buffer_t *bencbuf, } } @@ -592,7 +587,7 @@ index 1c7da31..a0ae7f9 100644 if(bencbuf->error) { LM_ERR("out of memory - bencode failed\n"); -@@ -2948,12 +3081,19 @@ error: +@@ -3334,12 +3463,19 @@ error: } static int rtpp_function_call_simple( @@ -614,7 +609,7 @@ index 1c7da31..a0ae7f9 100644 if(!ret) return -1; -@@ -2975,12 +3115,12 @@ static int rtpengine_simple_wrap( +@@ -3361,12 +3497,12 @@ static int rtpengine_simple_wrap( static bencode_item_t *rtpp_function_call_ok(bencode_buffer_t *bencbuf, @@ -629,7 +624,7 @@ index 1c7da31..a0ae7f9 100644 if(!ret) return NULL; -@@ -3800,11 +3940,19 @@ static void parse_call_stats(bencode_item_t *dict, struct sip_msg *msg) +@@ -4188,11 +4324,19 @@ static void parse_call_stats(bencode_item_t *dict, struct sip_msg *msg) parse_call_stats_1(&side_B_mos_stats, dict, msg); } @@ -651,7 +646,7 @@ index 1c7da31..a0ae7f9 100644 if(!ret) return -1; parse_call_stats(ret, msg); -@@ -3812,11 +3960,19 @@ static int rtpengine_delete(struct sip_msg *msg, const char *flags) +@@ -4200,11 +4344,19 @@ static int rtpengine_delete(struct sip_msg *msg, const char *flags) return 1; } @@ -673,7 +668,7 @@ index 1c7da31..a0ae7f9 100644 if(!ret) return -1; parse_call_stats(ret, msg); -@@ -3863,9 +4019,15 @@ static int rtpengine_delete_wrap( +@@ -4251,9 +4403,15 @@ static int rtpengine_delete_wrap( static int rtpengine_rtpp_set_wrap_fparam(struct sip_msg *msg, int (*func)(struct sip_msg *msg, void *, int, enum rtpe_operation), @@ -690,13 +685,14 @@ index 1c7da31..a0ae7f9 100644 flags.s = NULL; if(str1) { -@@ -3873,15 +4035,25 @@ static int rtpengine_rtpp_set_wrap_fparam(struct sip_msg *msg, +@@ -4261,15 +4419,25 @@ static int rtpengine_rtpp_set_wrap_fparam(struct sip_msg *msg, LM_ERR("Error getting string parameter\n"); return -1; } + parms[0] = &flags; -+ } -+ + } + +- return rtpengine_rtpp_set_wrap(msg, func, flags.s, direction, op); + viabranch.s = NULL; + if (str2) { + if(get_str_fparam(&viabranch, msg, (fparam_t *)str2)) { @@ -704,9 +700,8 @@ index 1c7da31..a0ae7f9 100644 + return -1; + } + parms[1] = &viabranch; - } - -- return rtpengine_rtpp_set_wrap(msg, func, flags.s, direction, op); ++ } ++ + return rtpengine_rtpp_set_wrap(msg, func, parms, direction, op); } @@ -718,7 +713,7 @@ index 1c7da31..a0ae7f9 100644 } static int rtpengine_query_wrap( -@@ -3893,7 +4065,7 @@ static int rtpengine_query_wrap( +@@ -4281,7 +4449,7 @@ static int rtpengine_query_wrap( static int rtpengine_query1_f(struct sip_msg *msg, char *str1, char *str2) { return rtpengine_rtpp_set_wrap_fparam( @@ -727,7 +722,7 @@ index 1c7da31..a0ae7f9 100644 } -@@ -3973,7 +4145,7 @@ static int set_rtpengine_set_f(struct sip_msg *msg, char *str1, char *str2) +@@ -4361,7 +4529,7 @@ static int set_rtpengine_set_f(struct sip_msg *msg, char *str1, char *str2) return 1; } @@ -736,7 +731,7 @@ index 1c7da31..a0ae7f9 100644 { int method; int nosdp; -@@ -4000,7 +4172,7 @@ static int rtpengine_manage(struct sip_msg *msg, const char *flags) +@@ -4388,7 +4556,7 @@ static int rtpengine_manage(struct sip_msg *msg, const char *flags) return -1; if(method & (METHOD_CANCEL | METHOD_BYE)) @@ -745,7 +740,7 @@ index 1c7da31..a0ae7f9 100644 if(msg->msg_flags & FL_SDP_BODY) nosdp = 0; -@@ -4009,9 +4181,9 @@ static int rtpengine_manage(struct sip_msg *msg, const char *flags) +@@ -4397,9 +4565,9 @@ static int rtpengine_manage(struct sip_msg *msg, const char *flags) if(msg->first_line.type == SIP_REQUEST) { if((method & (METHOD_ACK | METHOD_PRACK)) && nosdp == 0) @@ -757,7 +752,7 @@ index 1c7da31..a0ae7f9 100644 if(method == METHOD_INVITE && nosdp == 0) { msg->msg_flags |= FL_SDP_BODY; if(tmb.t_gett != NULL) { -@@ -4021,21 +4193,21 @@ static int rtpengine_manage(struct sip_msg *msg, const char *flags) +@@ -4409,21 +4577,21 @@ static int rtpengine_manage(struct sip_msg *msg, const char *flags) } } if(route_type == FAILURE_ROUTE) @@ -786,7 +781,7 @@ index 1c7da31..a0ae7f9 100644 } } return -1; -@@ -4050,13 +4222,13 @@ static int rtpengine_manage_wrap( +@@ -4438,13 +4606,13 @@ static int rtpengine_manage_wrap( static int rtpengine_manage1_f(struct sip_msg *msg, char *str1, char *str2) { return rtpengine_rtpp_set_wrap_fparam( @@ -802,7 +797,7 @@ index 1c7da31..a0ae7f9 100644 } static int rtpengine_offer_wrap( -@@ -4068,7 +4240,7 @@ static int rtpengine_offer_wrap( +@@ -4456,7 +4624,7 @@ static int rtpengine_offer_wrap( static int rtpengine_offer1_f(struct sip_msg *msg, char *str1, char *str2) { return rtpengine_rtpp_set_wrap_fparam( @@ -811,7 +806,7 @@ index 1c7da31..a0ae7f9 100644 } static int rtpengine_answer_wrap( -@@ -4079,19 +4251,21 @@ static int rtpengine_answer_wrap( +@@ -4467,19 +4635,21 @@ static int rtpengine_answer_wrap( static int rtpengine_answer1_f(struct sip_msg *msg, char *str1, char *str2) { @@ -836,7 +831,7 @@ index 1c7da31..a0ae7f9 100644 bencode_buffer_t bencbuf; bencode_item_t *dict; str body, newbody; -@@ -4101,7 +4275,11 @@ static int rtpengine_offer_answer(struct sip_msg *msg, const char *flags, +@@ -4489,7 +4659,11 @@ static int rtpengine_offer_answer(struct sip_msg *msg, const char *flags, str cl_field = STR_NULL; str cl_repl = STR_NULL; @@ -849,7 +844,7 @@ index 1c7da31..a0ae7f9 100644 if(!dict) return -1; -@@ -4185,7 +4363,7 @@ static int rtpengine_generic_f( +@@ -4573,7 +4747,7 @@ static int rtpengine_generic_f( struct sip_msg *msg, char *str1, enum rtpe_operation op) { return rtpengine_rtpp_set_wrap_fparam( @@ -858,7 +853,7 @@ index 1c7da31..a0ae7f9 100644 } static int start_recording_f(struct sip_msg *msg, char *str1, char *str2) -@@ -4231,6 +4409,9 @@ static int unsilence_media_f(struct sip_msg *msg, char *str1, char *str2) +@@ -4619,6 +4793,9 @@ static int unsilence_media_f(struct sip_msg *msg, char *str1, char *str2) static int rtpengine_play_media( struct sip_msg *msg, void *d, int more, enum rtpe_operation op) { @@ -868,7 +863,7 @@ index 1c7da31..a0ae7f9 100644 bencode_buffer_t bencbuf; long long duration; bencode_item_t *ret; -@@ -4238,7 +4419,11 @@ static int rtpengine_play_media( +@@ -4626,7 +4803,11 @@ static int rtpengine_play_media( pv_value_t val; int retval = 1; @@ -881,7 +876,7 @@ index 1c7da31..a0ae7f9 100644 if(!ret) return -1; if(media_duration_pvar) { -@@ -4264,7 +4449,7 @@ static int rtpengine_play_media( +@@ -4652,7 +4833,7 @@ static int rtpengine_play_media( static int play_media_f(struct sip_msg *msg, char *str1, char *str2) { return rtpengine_rtpp_set_wrap_fparam( @@ -890,7 +885,7 @@ index 1c7da31..a0ae7f9 100644 } static int stop_media_f(struct sip_msg *msg, char *str1, char *str2) -@@ -4302,7 +4487,7 @@ static int rtpengine_rtpstat_wrap( +@@ -4690,7 +4871,7 @@ static int rtpengine_rtpstat_wrap( param = parms[0]; res = parms[1]; @@ -899,7 +894,7 @@ index 1c7da31..a0ae7f9 100644 if(!dict) return -1; -@@ -4471,7 +4656,7 @@ static int rtpengine_query_v_wrap( +@@ -4859,7 +5040,7 @@ static int rtpengine_query_v_wrap( fmt = parms[0]; dst = parms[1]; @@ -908,7 +903,7 @@ index 1c7da31..a0ae7f9 100644 if(!dict) { return -1; } -@@ -4603,158 +4788,267 @@ static int set_rtp_inst_pvar(struct sip_msg *msg, const str *const uri) +@@ -4991,158 +5172,267 @@ static int set_rtp_inst_pvar(struct sip_msg *msg, const str *const uri) } /** @@ -951,14 +946,14 @@ index 1c7da31..a0ae7f9 100644 static int ki_rtpengine_offer(sip_msg_t *msg, str *flags) { + void *parms[2] = {flags, NULL}; - return rtpengine_rtpp_set_wrap( -- msg, rtpengine_offer_wrap, flags->s, 1, OP_ANY); ++ return rtpengine_rtpp_set_wrap( + msg, rtpengine_offer_wrap, parms, 1, OP_ANY); +} +static int ki_rtpengine_offer2(sip_msg_t *msg, str *flags, str *viabranch) +{ + void *parms[2] = {flags, viabranch}; -+ return rtpengine_rtpp_set_wrap( + return rtpengine_rtpp_set_wrap( +- msg, rtpengine_offer_wrap, flags->s, 1, OP_ANY); + msg, rtpengine_offer_wrap, parms, 1, OP_ANY); } @@ -1100,16 +1095,16 @@ index 1c7da31..a0ae7f9 100644 static int ki_silence_media(sip_msg_t *msg, str *flags) { + void *parms[2] = {flags, NULL}; - return rtpengine_rtpp_set_wrap( -- msg, rtpengine_simple_wrap, flags->s, 1, OP_SILENCE_MEDIA); ++ return rtpengine_rtpp_set_wrap( + msg, rtpengine_simple_wrap, parms, 1, OP_SILENCE_MEDIA); - } ++} +static int ki_silence_media2(sip_msg_t *msg, str *flags, str *viabranch) +{ + void *parms[2] = {flags, viabranch}; -+ return rtpengine_rtpp_set_wrap( + return rtpengine_rtpp_set_wrap( +- msg, rtpengine_simple_wrap, flags->s, 1, OP_SILENCE_MEDIA); + msg, rtpengine_simple_wrap, parms, 1, OP_SILENCE_MEDIA); -+} + } + +/* KI - unsilence media */ static int ki_unsilence_media0(sip_msg_t *msg) @@ -1122,14 +1117,14 @@ index 1c7da31..a0ae7f9 100644 static int ki_unsilence_media(sip_msg_t *msg, str *flags) { + void *parms[2] = {flags, NULL}; - return rtpengine_rtpp_set_wrap( -- msg, rtpengine_simple_wrap, flags->s, 1, OP_UNSILENCE_MEDIA); ++ return rtpengine_rtpp_set_wrap( + msg, rtpengine_simple_wrap, parms, 1, OP_UNSILENCE_MEDIA); +} +static int ki_unsilence_media2(sip_msg_t *msg, str *flags, str *viabranch) +{ + void *parms[2] = {flags, viabranch}; -+ return rtpengine_rtpp_set_wrap( + return rtpengine_rtpp_set_wrap( +- msg, rtpengine_simple_wrap, flags->s, 1, OP_UNSILENCE_MEDIA); + msg, rtpengine_simple_wrap, parms, 1, OP_UNSILENCE_MEDIA); } @@ -1144,16 +1139,16 @@ index 1c7da31..a0ae7f9 100644 static int ki_block_dtmf(sip_msg_t *msg, str *flags) { + void *parms[2] = {flags, NULL}; - return rtpengine_rtpp_set_wrap( -- msg, rtpengine_simple_wrap, flags->s, 1, OP_BLOCK_DTMF); ++ return rtpengine_rtpp_set_wrap( + msg, rtpengine_simple_wrap, parms, 1, OP_BLOCK_DTMF); - } ++} +static int ki_block_dtmf2(sip_msg_t *msg, str *flags, str *viabranch) +{ + void *parms[2] = {flags, viabranch}; -+ return rtpengine_rtpp_set_wrap( + return rtpengine_rtpp_set_wrap( +- msg, rtpengine_simple_wrap, flags->s, 1, OP_BLOCK_DTMF); + msg, rtpengine_simple_wrap, parms, 1, OP_BLOCK_DTMF); -+} + } + +/* KI - unblock dtmf */ static int ki_unblock_dtmf0(sip_msg_t *msg) @@ -1181,16 +1176,16 @@ index 1c7da31..a0ae7f9 100644 static int ki_play_media(sip_msg_t *msg, str *flags) { + void *parms[2] = {flags, NULL}; -+ return rtpengine_rtpp_set_wrap( + return rtpengine_rtpp_set_wrap( +- msg, rtpengine_simple_wrap, flags->s, 1, OP_PLAY_MEDIA); + msg, rtpengine_simple_wrap, parms, 1, OP_PLAY_MEDIA); -+} + } +static int ki_play_media2(sip_msg_t *msg, str *flags, str *viabranch) +{ + void *parms[2] = {flags, viabranch}; - return rtpengine_rtpp_set_wrap( -- msg, rtpengine_simple_wrap, flags->s, 1, OP_PLAY_MEDIA); ++ return rtpengine_rtpp_set_wrap( + msg, rtpengine_simple_wrap, parms, 1, OP_PLAY_MEDIA); - } ++} + +/* KI - stop media */ static int ki_stop_media0(sip_msg_t *msg) @@ -1217,7 +1212,7 @@ index 1c7da31..a0ae7f9 100644 static int ki_set_rtpengine_set(sip_msg_t *msg, int r1) { -@@ -4831,6 +5125,12 @@ static sr_kemi_t sr_kemi_rtpengine_exports[] = { +@@ -5219,6 +5509,12 @@ static sr_kemi_t sr_kemi_rtpengine_exports[] = { { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } }, @@ -1230,7 +1225,7 @@ index 1c7da31..a0ae7f9 100644 { str_init("rtpengine"), str_init("rtpengine_offer0"), SR_KEMIP_INT, ki_rtpengine_offer0, { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, -@@ -4841,6 +5141,12 @@ static sr_kemi_t sr_kemi_rtpengine_exports[] = { +@@ -5229,6 +5525,12 @@ static sr_kemi_t sr_kemi_rtpengine_exports[] = { { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } }, @@ -1243,7 +1238,7 @@ index 1c7da31..a0ae7f9 100644 { str_init("rtpengine"), str_init("rtpengine_answer0"), SR_KEMIP_INT, ki_rtpengine_answer0, { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, -@@ -4851,6 +5157,12 @@ static sr_kemi_t sr_kemi_rtpengine_exports[] = { +@@ -5239,6 +5541,12 @@ static sr_kemi_t sr_kemi_rtpengine_exports[] = { { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } }, @@ -1256,7 +1251,7 @@ index 1c7da31..a0ae7f9 100644 { str_init("rtpengine"), str_init("rtpengine_delete0"), SR_KEMIP_INT, ki_rtpengine_delete0, { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, -@@ -4861,6 +5173,12 @@ static sr_kemi_t sr_kemi_rtpengine_exports[] = { +@@ -5249,6 +5557,12 @@ static sr_kemi_t sr_kemi_rtpengine_exports[] = { { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } }, @@ -1269,7 +1264,7 @@ index 1c7da31..a0ae7f9 100644 { str_init("rtpengine"), str_init("start_recording"), SR_KEMIP_INT, ki_start_recording, { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, -@@ -4872,7 +5190,7 @@ static sr_kemi_t sr_kemi_rtpengine_exports[] = { +@@ -5260,7 +5574,7 @@ static sr_kemi_t sr_kemi_rtpengine_exports[] = { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } }, @@ -1278,7 +1273,7 @@ index 1c7da31..a0ae7f9 100644 SR_KEMIP_INT, ki_block_media0, { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } -@@ -4882,6 +5200,12 @@ static sr_kemi_t sr_kemi_rtpengine_exports[] = { +@@ -5270,6 +5584,12 @@ static sr_kemi_t sr_kemi_rtpengine_exports[] = { { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } }, @@ -1291,7 +1286,7 @@ index 1c7da31..a0ae7f9 100644 { str_init("rtpengine"), str_init("unblock_media0"), SR_KEMIP_INT, ki_unblock_media0, { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, -@@ -4892,8 +5216,13 @@ static sr_kemi_t sr_kemi_rtpengine_exports[] = { +@@ -5280,8 +5600,13 @@ static sr_kemi_t sr_kemi_rtpengine_exports[] = { { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } }, @@ -1306,7 +1301,7 @@ index 1c7da31..a0ae7f9 100644 SR_KEMIP_INT, ki_silence_media0, { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } -@@ -4903,7 +5232,13 @@ static sr_kemi_t sr_kemi_rtpengine_exports[] = { +@@ -5291,7 +5616,13 @@ static sr_kemi_t sr_kemi_rtpengine_exports[] = { { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } }, @@ -1321,7 +1316,7 @@ index 1c7da31..a0ae7f9 100644 SR_KEMIP_INT, ki_unsilence_media0, { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } -@@ -4913,8 +5248,13 @@ static sr_kemi_t sr_kemi_rtpengine_exports[] = { +@@ -5301,8 +5632,13 @@ static sr_kemi_t sr_kemi_rtpengine_exports[] = { { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } }, @@ -1336,7 +1331,7 @@ index 1c7da31..a0ae7f9 100644 SR_KEMIP_INT, ki_block_dtmf0, { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } -@@ -4924,7 +5264,13 @@ static sr_kemi_t sr_kemi_rtpengine_exports[] = { +@@ -5312,7 +5648,13 @@ static sr_kemi_t sr_kemi_rtpengine_exports[] = { { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } }, @@ -1351,7 +1346,7 @@ index 1c7da31..a0ae7f9 100644 SR_KEMIP_INT, ki_unblock_dtmf0, { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } -@@ -4934,13 +5280,24 @@ static sr_kemi_t sr_kemi_rtpengine_exports[] = { +@@ -5322,13 +5664,24 @@ static sr_kemi_t sr_kemi_rtpengine_exports[] = { { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } }, @@ -1377,7 +1372,7 @@ index 1c7da31..a0ae7f9 100644 SR_KEMIP_INT, ki_stop_media0, { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } -@@ -4950,6 +5307,11 @@ static sr_kemi_t sr_kemi_rtpengine_exports[] = { +@@ -5338,6 +5691,11 @@ static sr_kemi_t sr_kemi_rtpengine_exports[] = { { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } }, @@ -1389,7 +1384,7 @@ index 1c7da31..a0ae7f9 100644 { str_init("rtpengine"), str_init("set_rtpengine_set"), SR_KEMIP_INT, ki_set_rtpengine_set, -@@ -4961,6 +5323,7 @@ static sr_kemi_t sr_kemi_rtpengine_exports[] = { +@@ -5349,6 +5707,7 @@ static sr_kemi_t sr_kemi_rtpengine_exports[] = { { SR_KEMIP_INT, SR_KEMIP_INT, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } }, @@ -1397,11 +1392,12 @@ index 1c7da31..a0ae7f9 100644 { str_init("rtpengine"), str_init("rtpengine_query0"), SR_KEMIP_INT, ki_rtpengine_query0, { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, -@@ -4971,7 +5334,13 @@ static sr_kemi_t sr_kemi_rtpengine_exports[] = { +@@ -5359,7 +5718,14 @@ static sr_kemi_t sr_kemi_rtpengine_exports[] = { { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } }, - { str_init("rtpengine"), str_init("rtpengine_query_v"), ++ + { str_init("rtpengine"), str_init("rtpengine_query2"), + SR_KEMIP_INT, ki_rtpengine_query2, + { SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE,