MT#62419 refresh patches

* remove already applied patches from 5.8 branch

Change-Id: I0d16e90b06448e77e5523d7099ca49570676880b
mr12.5
Victor Seva 1 year ago
parent f4201851fe
commit f1f5a1b0d9

@ -7,7 +7,7 @@ Subject: no_lib64_on_64_bits
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/src/Makefile.defs b/src/Makefile.defs
index 07fa021..e30c350 100644
index 4c8dc34..2019001 100644
--- a/src/Makefile.defs
+++ b/src/Makefile.defs
@@ -454,15 +454,7 @@ endif

@ -31,12 +31,7 @@ sipwise/sca-debug.patch
sipwise/sca-fix-notify-after-bye.patch
sipwise/sca-add-pai_avp-parameter.patch
## upstream 5.8
upstream/0001-db_mysql-switch-warn-to-dbg-for-log-messages-for-opt.patch
upstream/0002-db_mysql-switch-warn-to-dbg-for-log-messages-for-opt.patch
upstream/regex-remove-pcre2_free-warning.patch
upstream/lcr-remove-pcre2_free-warning.patch
upstream/dialplan-remove-pcre2_free-warning.patch
upstream/htable-do-not-print-item-name-before-is-computed.patch
#
## upstream master
upstream/rtpengine_rework_rtpp_flags.patch
upstream/cfgutils-expose-optional-second-string-key-for-lock.patch
@ -60,12 +55,10 @@ sipwise/dialog-support-profile_get_size-for-all-profiles.patch
sipwise/presence_vqr.patch
sipwise/dialog-dlg_get_ttag.patch
sipwise/app_lua_sr-support-second-str-for-cfgutils-lock.patch
sipwise/tls-remove-confusing-error-message-when-trying-to-pr.patch
sipwise/cfgutils-allow-lock_set_size-14.patch
sipwise/pua-get_record_puadb-add-pres_uri-to-the-query.patch
sipwise/pua_dialoginfo-use_uuid.patch
sipwise/usrloc-don-t-synchronize-on-destroy-for-DB_ONLY.patch
sipwise/db_redis-stop-searching-for-keys-if-scan_key-is-set.patch
### active development
#
### Don't just put stuff in any order

@ -1,20 +0,0 @@
From: Victor Seva <vseva@sipwise.com>
Date: Thu, 19 Dec 2024 20:43:50 +0100
Subject: db_redis: stop searching for keys if scan_key is set
---
src/modules/db_redis/redis_dbase.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/modules/db_redis/redis_dbase.c b/src/modules/db_redis/redis_dbase.c
index 84c0c3a..f7bace1 100644
--- a/src/modules/db_redis/redis_dbase.c
+++ b/src/modules/db_redis/redis_dbase.c
@@ -794,6 +794,7 @@ static int db_redis_build_query_keys(km_redis_con_t *con, const str *table_name,
type->type.s);
}
keyname.s = NULL;
+ break;
} else if(keyname.s) {
pkg_free(keyname.s);
keyname.s = NULL;

@ -9,7 +9,7 @@ Subject: dialog: dlg_get_ttag()
3 files changed, 211 insertions(+)
diff --git a/src/modules/dialog/dialog.c b/src/modules/dialog/dialog.c
index 152fd9c..8e76506 100644
index f4eb18e..5dfdec1 100644
--- a/src/modules/dialog/dialog.c
+++ b/src/modules/dialog/dialog.c
@@ -54,6 +54,7 @@
@ -39,7 +39,7 @@ index 152fd9c..8e76506 100644
{"dlg_set_timeout", (cmd_function)w_dlg_set_timeout, 1,fixup_igp_null,
0, ANY_ROUTE },
{"dlg_set_timeout", (cmd_function)w_dlg_set_timeout, 3,fixup_igp_all,
@@ -1973,6 +1979,121 @@ static int fixup_dlg_set_var_free(void **param, int param_no)
@@ -1974,6 +1980,121 @@ static int fixup_dlg_set_var_free(void **param, int param_no)
return -1;
}
@ -161,7 +161,7 @@ index 152fd9c..8e76506 100644
static int ki_dlg_get(sip_msg_t *msg, str *sc, str *sf, str *st)
{
dlg_cell_t *dlg = NULL;
@@ -2548,6 +2669,11 @@ static sr_kemi_t sr_kemi_dialog_exports[] = {
@@ -2555,6 +2676,11 @@ static sr_kemi_t sr_kemi_dialog_exports[] = {
{ SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_STR,
SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
},
@ -264,7 +264,7 @@ index c5c5042..22346f3 100644
/*!
* \brief Search dialog that corresponds to CallId, From Tag and To Tag
diff --git a/src/modules/dialog/dlg_hash.h b/src/modules/dialog/dlg_hash.h
index e4b583f..bfafde1 100644
index 513ca58..0eb9d1d 100644
--- a/src/modules/dialog/dlg_hash.h
+++ b/src/modules/dialog/dlg_hash.h
@@ -394,6 +394,19 @@ dlg_cell_t *dlg_get_by_iuid(dlg_iuid_t *diuid);

@ -10,10 +10,10 @@ Subject: dialog: support profile_get_size for all profiles
4 files changed, 69 insertions(+)
diff --git a/src/modules/dialog/dialog.c b/src/modules/dialog/dialog.c
index 338f7f6..152fd9c 100644
index f27cdf2..f4eb18e 100644
--- a/src/modules/dialog/dialog.c
+++ b/src/modules/dialog/dialog.c
@@ -3018,6 +3018,31 @@ static void internal_rpc_profile_get_size(
@@ -3025,6 +3025,31 @@ static void internal_rpc_profile_get_size(
return;
}
@ -45,7 +45,7 @@ index 338f7f6..152fd9c 100644
/*!
* \brief Helper function that outputs the dialogs belonging to a given profile via the RPC interface
* \see rpc_profile_print_dlgs
@@ -3102,6 +3127,8 @@ static const char *rpc_dlg_set_state_doc[3] = {
@@ -3109,6 +3134,8 @@ static const char *rpc_dlg_set_state_doc[3] = {
0};
static const char *rpc_profile_get_size_doc[2] = {
"Returns the number of dialogs belonging to a profile", 0};
@ -54,7 +54,7 @@ index 338f7f6..152fd9c 100644
static const char *rpc_profile_print_dlgs_doc[2] = {
"Lists all the dialogs belonging to a profile", 0};
static const char *rpc_dlg_bridge_doc[2] = {
@@ -3318,6 +3345,11 @@ static void rpc_profile_get_size(rpc_t *rpc, void *c)
@@ -3325,6 +3352,11 @@ static void rpc_profile_get_size(rpc_t *rpc, void *c)
}
return;
}
@ -66,7 +66,7 @@ index 338f7f6..152fd9c 100644
static void rpc_profile_print_dlgs(rpc_t *rpc, void *c)
{
str profile_name = {NULL, 0};
@@ -3735,6 +3767,8 @@ static rpc_export_t rpc_methods[] = {
@@ -3742,6 +3774,8 @@ static rpc_export_t rpc_methods[] = {
{"dlg.end_dlg", rpc_end_dlg_entry_id, rpc_end_dlg_entry_id_doc, 0},
{"dlg.profile_get_size", rpc_profile_get_size, rpc_profile_get_size_doc,
0},

@ -7,7 +7,7 @@ Subject: pua_dialoginfo: use_uuid
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/src/modules/pua_dialoginfo/pua_dialoginfo.c b/src/modules/pua_dialoginfo/pua_dialoginfo.c
index c8a8a6f..9d3c0f9 100644
index d1e704f..cbb406a 100644
--- a/src/modules/pua_dialoginfo/pua_dialoginfo.c
+++ b/src/modules/pua_dialoginfo/pua_dialoginfo.c
@@ -51,6 +51,7 @@
@ -26,15 +26,15 @@ index c8a8a6f..9d3c0f9 100644
int include_callid = DEF_INCLUDE_CALLID;
int include_localremote = DEF_INCLUDE_LOCALREMOTE;
int include_tags = DEF_INCLUDE_TAGS;
@@ -120,6 +122,7 @@ static int child_init(int rank);
static cmd_export_t cmds[] = {{0, 0, 0, 0, 0, 0}};
@@ -123,6 +125,7 @@ static cmd_export_t cmds[] = {
};
static param_export_t params[] = {
+ {"use_uuid", INT_PARAM, &use_uuid},
{"include_callid", INT_PARAM, &include_callid},
{"include_localremote", INT_PARAM, &include_localremote},
{"include_tags", INT_PARAM, &include_tags},
@@ -732,8 +735,16 @@ struct dlginfo_cell *get_dialog_data(struct dlg_cell *dlg, int type,
+ {"use_uuid", INT_PARAM, &use_uuid},
{"include_callid", INT_PARAM, &include_callid},
{"include_localremote", INT_PARAM, &include_localremote},
{"include_tags", INT_PARAM, &include_tags},
@@ -733,8 +736,16 @@ struct dlginfo_cell *get_dialog_data(struct dlg_cell *dlg, int type,
int len;
// generate new random uuid

@ -1,6 +1,16 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Tue, 7 Jan 2025 19:10:06 +0100
Subject: rtpengine_always_add_totag_to_ng_message_when_rtpp_flags
---
src/modules/rtpengine/rtpengine.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c
index e26d533..97eff5b 100644
--- a/src/modules/rtpengine/rtpengine.c
+++ b/src/modules/rtpengine/rtpengine.c
@@ -3179,7 +3179,7 @@ static bencode_item_t *rtpp_function_cal
@@ -3179,7 +3179,7 @@ static bencode_item_t *rtpp_function_call(bencode_buffer_t *bencbuf,
*/
/* affects to-tag parsing */

@ -97,7 +97,7 @@ 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 dde6e1b..1e97a2f 100644
index a2d378a..878bf05 100644
--- a/src/modules/sca/sca_call_info.c
+++ b/src/modules/sca/sca_call_info.c
@@ -1144,20 +1144,32 @@ static int sca_call_info_insert_asserted_identity(

@ -7,7 +7,7 @@ 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 3a7d46f..b5f473b 100644
index 7d68867..2a55039 100644
--- a/src/modules/sca/sca_subscribe.c
+++ b/src/modules/sca/sca_subscribe.c
@@ -1171,6 +1171,8 @@ int ki_sca_handle_subscribe(sip_msg_t *msg, str *uri_to, str *uri_from)
@ -39,9 +39,9 @@ index 3a7d46f..b5f473b 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,
@@ -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",
@@ -1324,10 +1331,25 @@ int ki_sca_handle_subscribe(sip_msg_t *msg, str *uri_to, str *uri_from)
if(released) {
LM_INFO("released %d appearances for subscriber %.*s\n",
released, STR_FMT(&req_sub.subscriber));
+ } else {
+ LM_DBG("sca_handle_subscribe: subscriber[%.*s] doesn't "
@ -65,7 +65,7 @@ index 3a7d46f..b5f473b 100644
// in-dialog request, but we didn't find it.
if(!SCA_STR_EMPTY(to_tag)) {
SCA_SUB_REPLY_ERROR(
@@ -1367,6 +1389,8 @@ int ki_sca_handle_subscribe(sip_msg_t *msg, str *uri_to, str *uri_from)
@@ -1366,6 +1388,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.

@ -47,7 +47,7 @@ index fcc94c4..79f56ba 100644
}
}
diff --git a/src/modules/sca/sca_call_info.c b/src/modules/sca/sca_call_info.c
index b2aa8bb..ef481a5 100644
index c7d2cb0..f3918e2 100644
--- a/src/modules/sca/sca_call_info.c
+++ b/src/modules/sca/sca_call_info.c
@@ -981,6 +981,8 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg,

@ -7,7 +7,7 @@ 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 08a3ecf..a78d3c6 100644
index 162054d..987ebe7 100644
--- a/src/modules/sca/sca_call_info.c
+++ b/src/modules/sca/sca_call_info.c
@@ -1984,9 +1984,6 @@ int sca_call_info_update(

@ -7,7 +7,7 @@ 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 ef481a5..dde6e1b 100644
index f3918e2..a2d378a 100644
--- a/src/modules/sca/sca_call_info.c
+++ b/src/modules/sca/sca_call_info.c
@@ -720,7 +720,7 @@ static int sca_call_info_uri_update(str *aor, sca_call_info *call_info,

@ -7,7 +7,7 @@ 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 e28bfed..b2aa8bb 100644
index 6e8a408..c7d2cb0 100644
--- a/src/modules/sca/sca_call_info.c
+++ b/src/modules/sca/sca_call_info.c
@@ -954,11 +954,13 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg,

@ -7,7 +7,7 @@ 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 78cfc35..e28bfed 100644
index 1462f10..6e8a408 100644
--- a/src/modules/sca/sca_call_info.c
+++ b/src/modules/sca/sca_call_info.c
@@ -953,6 +953,13 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg,

@ -3,17 +3,17 @@ Date: Thu, 26 Mar 2020 10:06:46 +0100
Subject: sca-line-seize
---
src/modules/sca/sca.c | 107 +++++++++++++++++++++-
src/modules/sca/sca.c | 107 ++++++++++++++++++++-
src/modules/sca/sca.h | 6 ++
src/modules/sca/sca_appearance.h | 2 +-
src/modules/sca/sca_call_info.c | 188 ++++++++++++++++++++++-----------------
src/modules/sca/sca_call_info.c | 188 +++++++++++++++++++++----------------
src/modules/sca/sca_call_info.h | 6 +-
src/modules/sca/sca_dialog.h | 2 +-
src/modules/sca/sca_subscribe.c | 96 ++++++++++++--------
src/modules/sca/sca_subscribe.c | 96 +++++++++++--------
src/modules/sca/sca_subscribe.h | 6 +-
src/modules/sca/sca_util.c | 180 +++++++++++++++++++++++--------------
src/modules/sca/sca_util.c | 194 ++++++++++++++++++++++++---------------
src/modules/sca/sca_util.h | 18 +++-
10 files changed, 410 insertions(+), 201 deletions(-)
10 files changed, 417 insertions(+), 208 deletions(-)
diff --git a/src/modules/sca/sca.c b/src/modules/sca/sca.c
index c856a2a..0298610 100644
@ -211,7 +211,7 @@ index bd94e14..6ce3112 100644
enum
{
diff --git a/src/modules/sca/sca_call_info.c b/src/modules/sca/sca_call_info.c
index 2694239..08a3ecf 100644
index ed1a47d..162054d 100644
--- a/src/modules/sca/sca_call_info.c
+++ b/src/modules/sca/sca_call_info.c
@@ -848,44 +848,46 @@ static int sca_call_info_is_line_seize_reinvite(sip_msg_t *msg,
@ -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 895141e..3a7d46f 100644
index 9e212f0..7d68867 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,
@ -867,7 +867,7 @@ index 895141e..3a7d46f 100644
// XXX should lock starting here and use unsafe methods below?
@@ -1398,13 +1414,15 @@ done:
@@ -1397,13 +1413,15 @@ done:
if(req_sub.rr.s != NULL) {
pkg_free(req_sub.rr.s);
}
@ -942,59 +942,32 @@ index e61fb74..1c1f66c 100644
- if(parse_from_header(msg) < 0) {
- LM_ERR("Bad From header\n");
- return (-1);
+ if(avp.s.len > 0) {
+ _avp = search_first_avp(avp_type, avp, &val, 0);
+ if(_avp) {
+ result->s = val.s.s;
+ result->len = val.s.len;
+ return 0;
+ }
}
- }
- f = get_from(msg);
- if(SCA_STR_EMPTY(&f->tag_value)) {
- LM_ERR("Bad From header: no tag parameter\n");
+ return -1;
+}
+
+/*
+ * caller needs to call free_to for *body
+ */
+int sca_parse_uri(struct to_body *body, str *uri)
+{
+ assert(body != NULL);
+ assert(uri != NULL);
+
+ parse_to(uri->s, uri->s + uri->len + 1, body);
+ if(body->error != PARSE_OK) {
+ LM_ERR("Bad uri value[%.*s]\n", STR_FMT(uri));
return (-1);
}
- return (-1);
- }
-
- // ensure the URI is parsed for future use
- if(parse_uri(f->uri.s, f->uri.len, GET_FROM_PURI(msg)) < 0) {
- LM_ERR("Failed to parse From URI %.*s\n", STR_FMT(&f->uri));
+ /* ensure the URI is parsed for future use */
+ if(parse_uri(body->uri.s, body->uri.len, &body->parsed_uri) < 0) {
+ LM_ERR("Failed to parse URI %.*s", STR_FMT(&body->uri));
return (-1);
}
- return (-1);
- }
-
- *from = f;
-
return (0);
}
- return (0);
-}
-
-int sca_get_msg_to_header(sip_msg_t *msg, struct to_body **to)
+int sca_get_msg_from_header(sip_msg_t *msg, sca_to_body_t *from)
{
-{
- struct to_body parsed_to;
- struct to_body *t = NULL;
-
- assert(msg != NULL);
- assert(to != NULL);
+ struct to_body *f;
+ str uri = STR_NULL;
-
- if(SCA_HEADER_EMPTY(msg->to)) {
- LM_ERR("Empty To header\n");
- return (-1);
@ -1006,6 +979,60 @@ index e61fb74..1c1f66c 100644
- &parsed_to);
- if(parsed_to.error != PARSE_OK) {
- LM_ERR("Bad To header\n");
- return (-1);
+ if(avp.s.len > 0) {
+ _avp = search_first_avp(avp_type, avp, &val, 0);
+ if(_avp) {
+ result->s = val.s.s;
+ result->len = val.s.len;
+ return 0;
}
- t = &parsed_to;
}
-
- // ensure the URI is parsed for future use
- if(parse_uri(t->uri.s, t->uri.len, GET_TO_PURI(msg)) < 0) {
- LM_ERR("Failed to parse To URI %.*s\n", STR_FMT(&t->uri));
- return (-1);
- }
-
- *to = t;
-
- return (0);
+ return -1;
}
/*
* caller needs to call free_to for *body
*/
-int sca_build_to_body_from_uri(sip_msg_t *msg, struct to_body **body, str *uri)
+int sca_parse_uri(struct to_body *body, str *uri)
{
- assert(msg != NULL);
assert(body != NULL);
assert(uri != NULL);
- *body = pkg_malloc(sizeof(struct to_body));
- if(*body == NULL) {
- LM_ERR("cannot allocate pkg memory\n");
+ parse_to(uri->s, uri->s + uri->len + 1, body);
+ if(body->error != PARSE_OK) {
+ LM_ERR("Bad uri value[%.*s]\n", STR_FMT(uri));
return (-1);
}
+ /* ensure the URI is parsed for future use */
+ if(parse_uri(body->uri.s, body->uri.len, &body->parsed_uri) < 0) {
+ LM_ERR("Failed to parse URI %.*s", STR_FMT(&body->uri));
+ return (-1);
+ }
+ return (0);
+}
+
+int sca_get_msg_from_header(sip_msg_t *msg, sca_to_body_t *from)
+{
+ struct to_body *f;
+ str uri = STR_NULL;
+
+ assert(from != NULL);
+ memset(from, 0, sizeof(sca_to_body_t));
+ if(sca_get_avp_value(from_uri_avp_type, from_uri_avp, &uri) < 0) {
@ -1022,15 +1049,9 @@ index e61fb74..1c1f66c 100644
+ f = get_from(msg);
+ if(SCA_STR_EMPTY(&f->tag_value)) {
+ LM_ERR("Bad From header: no tag parameter\n");
return (-1);
}
- t = &parsed_to;
- }
- // ensure the URI is parsed for future use
- if(parse_uri(t->uri.s, t->uri.len, GET_TO_PURI(msg)) < 0) {
- LM_ERR("Failed to parse To URI %.*s\n", STR_FMT(&t->uri));
- return (-1);
+ return (-1);
+ }
+
+ // ensure the URI is parsed for future use
+ if(parse_uri(f->uri.s, f->uri.len, GET_FROM_PURI(msg)) < 0) {
+ LM_ERR("Failed to parse From URI %.*s\n", STR_FMT(&f->uri));
@ -1048,39 +1069,25 @@ index e61fb74..1c1f66c 100644
+ }
+ if(sca_parse_uri(from->hdr, &uri) < 0)
+ return -1;
}
- *to = t;
-
return (0);
}
+ }
-/*
- * caller needs to call free_to for *body
- */
-int sca_build_to_body_from_uri(sip_msg_t *msg, struct to_body **body, str *uri)
- parse_to(uri->s, uri->s + uri->len + 1, *body);
- if((*body)->error != PARSE_OK) {
- LM_ERR("Bad uri value[%.*s]\n", STR_FMT(uri));
- free_to(*body);
- return (-1);
+ return (0);
+}
+
+int sca_get_msg_to_header(sip_msg_t *msg, sca_to_body_t *to)
{
- assert(msg != NULL);
- assert(body != NULL);
- assert(uri != NULL);
+{
+ str uri = STR_NULL;
- *body = pkg_malloc(sizeof(struct to_body));
- if(*body == NULL) {
- LM_ERR("cannot allocate pkg memory\n");
- return (-1);
- }
+
+ assert(to != NULL);
+ memset(to, 0, sizeof(sca_to_body_t));
+ if(sca_get_avp_value(to_uri_avp_type, to_uri_avp, &uri) < 0) {
+ assert(msg != NULL);
- parse_to(uri->s, uri->s + uri->len + 1, *body);
- if((*body)->error != PARSE_OK) {
- LM_ERR("Bad uri value[%.*s]\n", STR_FMT(uri));
- free_to(*body);
- return (-1);
+
+ if(SCA_HEADER_EMPTY(msg->to)) {
+ LM_ERR("Empty To header\n");
+ return (-1);

@ -47,7 +47,7 @@ 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 a78d3c6..78cfc35 100644
index 987ebe7..1462f10 100644
--- a/src/modules/sca/sca_call_info.c
+++ b/src/modules/sca/sca_call_info.c
@@ -1368,6 +1368,7 @@ void sca_call_info_ack_from_handler(sip_msg_t *msg, str *from_aor, str *to_aor)

@ -1,41 +0,0 @@
From: Victor Seva <linuxmaniac@torreviejawireless.org>
Date: Wed, 12 Jun 2024 10:13:56 +0200
Subject: tls: remove confusing error message when trying to print socket for
<default> server
> CRITICAL: <core> [core/ip_addr.c:232]: ip_addr2sbuf(): unknown address family 0
> NOTICE: tls [tls_domain.c:1176]: ksr_tls_fix_domain(): registered server_name callback handler for socket [:0], server_name='<default>' ...
---
src/modules/tls/tls_domain.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/modules/tls/tls_domain.c b/src/modules/tls/tls_domain.c
index e056a70..810a7e9 100644
--- a/src/modules/tls/tls_domain.c
+++ b/src/modules/tls/tls_domain.c
@@ -1155,14 +1155,14 @@ static int ksr_tls_fix_domain(tls_domain_t *d, tls_domain_t *def)
d->ctx[i], tls_server_name_cb)) {
LM_ERR("register server_name callback handler for socket "
"[%s:%d], server_name='%s' failed for proc %d\n",
- ip_addr2a(&d->ip), d->port,
+ (d->ip.af > 0) ? ip_addr2a(&d->ip) : "0.0.0.0", d->port,
(d->server_name.s) ? d->server_name.s : "<default>", i);
return -1;
}
if(!SSL_CTX_set_tlsext_servername_arg(d->ctx[i], d)) {
LM_ERR("register server_name callback handler data for socket "
"[%s:%d], server_name='%s' failed for proc %d\n",
- ip_addr2a(&d->ip), d->port,
+ (d->ip.af > 0) ? ip_addr2a(&d->ip) : "0.0.0.0", d->port,
(d->server_name.s) ? d->server_name.s : "<default>", i);
return -1;
}
@@ -1175,7 +1175,7 @@ static int ksr_tls_fix_domain(tls_domain_t *d, tls_domain_t *def)
&& (d->server_name.len > 0 || (d->type & TLS_DOMAIN_DEF))) {
LM_NOTICE("registered server_name callback handler for socket "
"[%s:%d], server_name='%s' ...\n",
- ip_addr2a(&d->ip), d->port,
+ (d->ip.af > 0) ? ip_addr2a(&d->ip) : "0.0.0.0", d->port,
(d->server_name.s) ? d->server_name.s : "<default>");
}
#endif

@ -1,33 +0,0 @@
From: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Wed, 19 Jun 2024 10:43:12 +0200
Subject: db_mysql: switch warn to dbg for log messages for opt_ssl_mode
- GH #3884
(cherry picked from commit 8f98317e92da61160a1c416e0da45938a205d358)
---
src/modules/db_mysql/km_my_con.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/modules/db_mysql/km_my_con.c b/src/modules/db_mysql/km_my_con.c
index 561a003..50e3375 100644
--- a/src/modules/db_mysql/km_my_con.c
+++ b/src/modules/db_mysql/km_my_con.c
@@ -143,7 +143,7 @@ struct my_con *db_mysql_new_connection(const struct db_id *id)
#if MYSQL_VERSION_ID >= 100339
mysql_options(ptr->con, MYSQL_OPT_SSL_ENFORCE, (void *)&(int){1});
#else
- LM_WARN("ssl mode not supported by %s\n", MARIADB_BASE_VERSION);
+ LM_DBG("ssl mode not supported by %s\n", MARIADB_BASE_VERSION);
#endif
break;
case 5: /* SSL_MODE_VERIFY_IDENTITY */
@@ -151,7 +151,7 @@ struct my_con *db_mysql_new_connection(const struct db_id *id)
(void *)&(int){1});
break;
default:
- LM_WARN("opt_ssl_mode = %d not supported by MariaDB Connector/C\n",
+ LM_DBG("opt_ssl_mode = %d not supported by MariaDB Connector/C\n",
db_mysql_opt_ssl_mode);
break;
}

@ -1,26 +0,0 @@
From: Victor Seva <linuxmaniac@torreviejawireless.org>
Date: Wed, 19 Jun 2024 15:00:12 +0200
Subject: db_mysql: switch warn to dbg for log messages for opt_ssl_ca option
fixes #3884
(cherry picked from commit be5172a84b02a1ab4fc7e97e7dc0813056302bdd)
---
src/modules/db_mysql/km_my_con.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/modules/db_mysql/km_my_con.c b/src/modules/db_mysql/km_my_con.c
index 50e3375..240d3f5 100644
--- a/src/modules/db_mysql/km_my_con.c
+++ b/src/modules/db_mysql/km_my_con.c
@@ -184,8 +184,8 @@ struct my_con *db_mysql_new_connection(const struct db_id *id)
mysql_options(
ptr->con, MYSQL_OPT_SSL_CA, (const void *)db_mysql_opt_ssl_ca);
#else
- LM_WARN("opt_ssl_ca option not supported by mysql version (value %s) - "
- "ignoring\n",
+ LM_DBG("opt_ssl_ca option not supported by mysql version (value %s) - "
+ "ignoring\n",
db_mysql_opt_ssl_ca);
#endif /* MYSQL_OPT_SSL_CA */

@ -8,10 +8,10 @@ Change-Id: I75f9bddd7a58fea63176e63eb075d8c5379162df
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/modules/dialog/dialog.c b/src/modules/dialog/dialog.c
index 79221a1..43752da 100644
index 75d7833..f7511f7 100644
--- a/src/modules/dialog/dialog.c
+++ b/src/modules/dialog/dialog.c
@@ -1863,7 +1863,7 @@ static int w_dlg_get_var(
@@ -1864,7 +1864,7 @@ static int w_dlg_get_var(
} else {
pv_get_null(msg, NULL, &dst_val);
}

@ -10,7 +10,7 @@ Subject: dialog: remove destroy of internal structures on mod-destroy
1 file changed, 8 deletions(-)
diff --git a/src/modules/dialog/dialog.c b/src/modules/dialog/dialog.c
index 43752da..338f7f6 100644
index f7511f7..f27cdf2 100644
--- a/src/modules/dialog/dialog.c
+++ b/src/modules/dialog/dialog.c
@@ -865,14 +865,6 @@ static void mod_destroy(void)

@ -1,28 +0,0 @@
From: Victor Seva <linuxmaniac@torreviejawireless.org>
Date: Thu, 18 Jul 2024 13:40:24 +0200
Subject: dialplan: remove pcre2_free() warning
related to #3851
(cherry picked from commit 70563ca0629a8de5aa5427b003f441e6c3a40c6a)
---
src/modules/dialplan/dp_db.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/modules/dialplan/dp_db.c b/src/modules/dialplan/dp_db.c
index 857a2e4..64d2a4f 100644
--- a/src/modules/dialplan/dp_db.c
+++ b/src/modules/dialplan/dp_db.c
@@ -203,8 +203,10 @@ static void *pcre2_malloc(size_t size, void *ext)
static void pcre2_free(void *ptr, void *ext)
{
- shm_free(ptr);
- ptr = NULL;
+ if(ptr) {
+ shm_free(ptr);
+ ptr = NULL;
+ }
}
int init_data(void)

@ -1,35 +0,0 @@
From: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Thu, 11 Jul 2024 19:38:24 +0200
Subject: [PATCH] htable: do not print item name before is computed
(cherry picked from commit e2193b9cd7f59377c54e0424c0d4a1628a5a60de)
---
src/modules/htable/ht_var.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/modules/htable/ht_var.c b/src/modules/htable/ht_var.c
index e79c786..4d7707f 100644
--- a/src/modules/htable/ht_var.c
+++ b/src/modules/htable/ht_var.c
@@ -38,8 +38,8 @@ int pv_get_ht_cell(struct sip_msg *msg, pv_param_t *param, pv_value_t *res)
if(hpv->ht == NULL) {
hpv->ht = ht_get_table(&hpv->htname);
if(hpv->ht == NULL) {
- LM_ERR("htable not found for getting $sht(%.*s=>%.*s)\n",
- hpv->htname.len, hpv->htname.s, htname.len, htname.s);
+ LM_ERR("htable not found for getting $sht(%.*s=>...)\n",
+ hpv->htname.len, hpv->htname.s);
return pv_get_null(msg, param, res);
}
}
@@ -77,8 +77,8 @@ int pv_set_ht_cell(
if(hpv->ht == NULL)
hpv->ht = ht_get_table(&hpv->htname);
if(hpv->ht == NULL) {
- LM_ERR("htable not found for setting $sht(%.*s=>%.*s)\n",
- hpv->htname.len, hpv->htname.s, htname.len, htname.s);
+ LM_ERR("htable not found for setting $sht(%.*s=>...)\n",
+ hpv->htname.len, hpv->htname.s);
return -1;
}

@ -1,28 +0,0 @@
From: Victor Seva <linuxmaniac@torreviejawireless.org>
Date: Thu, 18 Jul 2024 13:38:10 +0200
Subject: lcr: remove pcre2_free() warning
related to #3851
(cherry picked from commit 310b631007082f553117d126b6b9bd915be596ac)
---
src/modules/lcr/lcr_mod.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/modules/lcr/lcr_mod.c b/src/modules/lcr/lcr_mod.c
index dac215a..bbd397d 100644
--- a/src/modules/lcr/lcr_mod.c
+++ b/src/modules/lcr/lcr_mod.c
@@ -433,8 +433,10 @@ static void *pcre2_malloc(size_t size, void *ext)
static void pcre2_free(void *ptr, void *ext)
{
- shm_free(ptr);
- ptr = NULL;
+ if(ptr) {
+ shm_free(ptr);
+ ptr = NULL;
+ }
}
/*

@ -3,65 +3,64 @@ Date: Thu, 13 Jun 2024 09:18:18 +0200
Subject: multipart-sdp
---
src/modules/rtpengine/rtpengine.c | 38 +++++++++++++++++++-------------------
1 file changed, 19 insertions(+), 19 deletions(-)
src/modules/rtpengine/rtpengine.c | 40 +++++++++++++++++++--------------------
1 file changed, 20 insertions(+), 20 deletions(-)
diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c
index 84df238..e26d533 100644
--- a/src/modules/rtpengine/rtpengine.c
+++ b/src/modules/rtpengine/rtpengine.c
@@ -4696,28 +4696,13 @@ static int rtpengine_offer_answer(struct sip_msg *msg, void *d,
@@ -4696,6 +4696,26 @@ static int rtpengine_offer_answer(struct sip_msg *msg, void *d,
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 */
- cur_body.len = 0;
- cur_body.s = get_body(msg);
- cur_body.len = msg->buf + msg->len - cur_body.s;
-
+ if(read_sdp_pvar_str.len > 0) {
+ /* get the body from the message as body ptr may have changed
+ * when using read_sdp_pv */
+ if(extract_body(msg, &cur_body, &cl_field) == -1) {
+ LM_ERR("failed to extract body from message");
+ goto error_free;
+ }
anchor = del_lump(msg, cur_body.s - msg->buf, cur_body.len, 0);
} else {
anchor = del_lump(msg, body.s - msg->buf, body.len, 0);
@@ -4730,6 +4715,21 @@ static int rtpengine_offer_answer(struct sip_msg *msg, void *d,
LM_ERR("insert_new_lump_after failed\n");
goto error_free;
}
+
+ 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;
+ anchor = del_lump(msg, cur_body.s - msg->buf, cur_body.len, 0);
+ } else {
+ anchor = del_lump(msg, body.s - msg->buf, body.len, 0);
+ }
+ if(!anchor) {
+ LM_ERR("del_lump failed\n");
+ goto error_free;
+ }
+ if(!insert_new_lump_after(anchor, newbody.s, newbody.len, 0)) {
+ LM_ERR("insert_new_lump_after failed\n");
+ goto error_free;
+ }
+
if(cl_field.len) {
anchor = del_lump(msg, cl_field.s - msg->buf, cl_field.len, 0);
cl_repl.s = pkg_malloc(10);
@@ -4710,26 +4730,6 @@ static int rtpengine_offer_answer(struct sip_msg *msg, void *d,
}
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 */
- cur_body.len = 0;
- cur_body.s = get_body(msg);
- cur_body.len = msg->buf + msg->len - cur_body.s;
-
- anchor = del_lump(msg, cur_body.s - msg->buf, cur_body.len, 0);
- } else {
- anchor = del_lump(msg, body.s - msg->buf, body.len, 0);
- }
- if(!anchor) {
- LM_ERR("del_lump failed\n");
- goto error_free;
- }
- if(!insert_new_lump_after(anchor, newbody.s, newbody.len, 0)) {
- LM_ERR("insert_new_lump_after failed\n");
- goto error_free;
- }
}
}

@ -9,7 +9,7 @@ Subject: pua: remove destroy of internal structures on mod-destroy callback
1 file changed, 8 deletions(-)
diff --git a/src/modules/pua/pua.c b/src/modules/pua/pua.c
index e571834..5cf774e 100644
index a53bfd8..d69578c 100644
--- a/src/modules/pua/pua.c
+++ b/src/modules/pua/pua.c
@@ -296,21 +296,13 @@ static int child_init(int rank)

@ -1,28 +0,0 @@
From: Victor Seva <linuxmaniac@torreviejawireless.org>
Date: Thu, 18 Jul 2024 13:36:09 +0200
Subject: regex: remove pcre2_free() warning
related to #3851
(cherry picked from commit b86030cfbd66ba95f33f312595edae29e2b5cde0)
---
src/modules/regex/regex_mod.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/modules/regex/regex_mod.c b/src/modules/regex/regex_mod.c
index 52ed60b..f4e93e4 100644
--- a/src/modules/regex/regex_mod.c
+++ b/src/modules/regex/regex_mod.c
@@ -170,8 +170,10 @@ static void *pcre2_malloc(size_t size, void *ext)
static void pcre2_free(void *ptr, void *ext)
{
- shm_free(ptr);
- ptr = NULL;
+ if(ptr) {
+ shm_free(ptr);
+ ptr = NULL;
+ }
}
/*! \brief

@ -29,8 +29,8 @@ This brings a list of benifits, such as:
bencode dictionary like format, when providing flags from
the kamailio script
---
src/modules/rtpengine/rtpengine.c | 834 +++++++++++++++++++++++++++-----------
1 file changed, 600 insertions(+), 234 deletions(-)
src/modules/rtpengine/rtpengine.c | 838 +++++++++++++++++++++++++++-----------
1 file changed, 602 insertions(+), 236 deletions(-)
diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c
index 561384d..84df238 100644
@ -52,15 +52,14 @@ index 561384d..84df238 100644
static int parse_flags(struct ng_flags_parse *, struct sip_msg *,
enum rtpe_operation *, const char *);
-
-static int rtpengine_offer_answer(struct sip_msg *msg, const char *flags,
+static int parse_viabranch_with_param(struct ng_flags_parse * ng_flags, struct sip_msg *msg,
+ char * branch_buf, str * p_viabranch, str * dst_viabranch);
+static int parse_viabranch(struct ng_flags_parse * ng_flags, struct sip_msg *msg,
+ str *viabranch, char * branch_buf);
+static int parse_from_to_tags(struct ng_flags_parse * ng_flags, enum rtpe_operation op,
+ struct sip_msg *msg);
+
-static int rtpengine_offer_answer(struct sip_msg *msg, const char *flags,
+static int rtpengine_offer_answer(struct sip_msg *msg, void *d,
enum rtpe_operation op, int more);
static int fixup_set_id(void **param, int param_no);
@ -311,12 +310,19 @@ index 561384d..84df238 100644
- ng_flags.sdes = bencode_list(bencbuf);
- ng_flags.t38 = bencode_list(bencbuf);
- ng_flags.codec = bencode_dictionary(bencbuf);
-
- if(read_sdp_pvar != NULL) {
- if(read_sdp_pvar->getf(msg, &read_sdp_pvar->pvp, &pv_val) < 0) {
- LM_ERR("error getting pvar value <%.*s>\n",
- read_sdp_pvar_str.len, read_sdp_pvar_str.s);
+
- goto error;
- } else {
- body = pv_val.rs;
- }
-
- } else if((cont_type = extract_body(msg, &body, cl_field)) == -1) {
- LM_ERR("can't extract body from the message\n");
- goto error;
+ /* create these bencode items only if parsing is local */
+ if (parse_by_module && flags) {
+ ng_flags.direction = bencode_list(bencbuf);
@ -340,14 +346,8 @@ index 561384d..84df238 100644
+
+ } else if((cont_type = extract_body(msg, &body, cl_field)) == -1) {
+ LM_ERR("can't extract body from the message\n");
goto error;
- } else {
- body = pv_val.rs;
}
-
- } else if((cont_type = extract_body(msg, &body, cl_field)) == -1) {
- LM_ERR("can't extract body from the message\n");
- goto error;
+ goto error;
+ }
+ if(body_intermediate.s)
+ bencode_dictionary_add_str(ng_flags.dict, "sdp", &body_intermediate);
+ else
@ -458,8 +458,7 @@ index 561384d..84df238 100644
+ : ((msg->rcv.src_ip.af == AF_INET6) ? "IP6" : "?"));
+ bencode_list_add_string(ng_flags.received_from, ip_addr2a(&msg->rcv.src_ip));
}
+ }
-
- ret = -1;
- switch(ng_flags.via) {
- case 1:
@ -487,43 +486,14 @@ index 561384d..84df238 100644
- branch_buf, &viabranch.len))
- ret = 0;
- break;
+ /* bencode items which are to be added always */
+ {
+ /* trickle ice sdp fragment */
+ if(cont_type == 3)
+ bencode_list_add_string(ng_flags.flags, "fragment");
+
+ /* call-id */
+ bencode_dictionary_add_str(ng_flags.dict, "call-id", &ng_flags.call_id);
+
+ /* viabranch */
+ if(parse_by_module && ng_flags.via) {
+ LM_DBG("parsing viabranch using rtpp flags\n");
+ ret = parse_viabranch(&ng_flags, msg, &viabranch, branch_buf);
+ if(ret == -1 || viabranch.len == 0) {
+ LM_ERR("can't get Via branch/extra ID\n");
+ goto error;
+ }
+ } else if (p_viabranch && !str_eq(p_viabranch, "none")) {
+ LM_DBG("parsing viabranch using function parameter\n");
+ ret = parse_viabranch_with_param(&ng_flags, msg, branch_buf, p_viabranch, &viabranch);
+ if(ret == -1 || viabranch.len == 0) {
+ LM_ERR("can't get Via branch/extra ID\n");
+ goto error;
+ }
+ }
+ if (viabranch.s && viabranch.len) {
+ bencode_dictionary_add_str(ng_flags.dict, "via-branch", &viabranch);
}
- }
-
- if(ret == -1 || viabranch.len == 0) {
- LM_ERR("can't get Via branch/extra ID\n");
+ /* from/to tags */
+ if (parse_from_to_tags(&ng_flags, op, msg))
goto error;
- goto error;
- }
- bencode_dictionary_add_str(ng_flags.dict, "via-branch", &viabranch);
- }
}
- if(ng_flags.received_from && ng_flags.received_from->child) {
- bencode_dictionary_add(
@ -539,9 +509,7 @@ index 561384d..84df238 100644
- bencode_list_add_string(
- ng_flags.received_from, ip_addr2a(&msg->rcv.src_ip));
- }
+ /* rtpengine command */
+ bencode_dictionary_add_string(ng_flags.dict, "command", command_strings[op]);
-
- if(op == OP_BLOCK_DTMF || op == OP_BLOCK_MEDIA || op == OP_UNBLOCK_DTMF
- || op == OP_UNBLOCK_MEDIA || op == OP_START_FORWARDING
- || op == OP_STOP_FORWARDING || op == OP_SILENCE_MEDIA
@ -557,7 +525,8 @@ index 561384d..84df238 100644
- || (msg->first_line.type == SIP_REPLY && op == OP_DELETE)
- || (msg->first_line.type == SIP_REPLY && op == OP_ANSWER)
- || ng_flags.directional) /* set if from-tag was set manually */
- {
+ /* bencode items which are to be added always */
{
- bencode_dictionary_add_str(
- ng_flags.dict, "from-tag", &ng_flags.from_tag);
- if(ng_flags.to && ng_flags.to_tag.s && ng_flags.to_tag.len)
@ -567,9 +536,42 @@ index 561384d..84df238 100644
- if(!ng_flags.to_tag.s || !ng_flags.to_tag.len) {
- LM_ERR("No to-tag present\n");
- goto error;
- }
+ /* trickle ice sdp fragment */
+ if(cont_type == 3)
+ bencode_list_add_string(ng_flags.flags, "fragment");
+
+ /* call-id */
+ bencode_dictionary_add_str(ng_flags.dict, "call-id", &ng_flags.call_id);
+
+ /* viabranch */
+ if(parse_by_module && ng_flags.via) {
+ LM_DBG("parsing viabranch using rtpp flags\n");
+ ret = parse_viabranch(&ng_flags, msg, &viabranch, branch_buf);
+ if(ret == -1 || viabranch.len == 0) {
+ LM_ERR("can't get Via branch/extra ID\n");
+ goto error;
+ }
+ } else if (p_viabranch && !str_eq(p_viabranch, "none")) {
+ LM_DBG("parsing viabranch using function parameter\n");
+ ret = parse_viabranch_with_param(&ng_flags, msg, branch_buf, p_viabranch, &viabranch);
+ if(ret == -1 || viabranch.len == 0) {
+ LM_ERR("can't get Via branch/extra ID\n");
+ goto error;
+ }
}
- bencode_dictionary_add_str(ng_flags.dict, "from-tag", &ng_flags.to_tag);
- bencode_dictionary_add_str(ng_flags.dict, "to-tag", &ng_flags.from_tag);
+ if (viabranch.s && viabranch.len) {
+ bencode_dictionary_add_str(ng_flags.dict, "via-branch", &viabranch);
+ }
+
+ /* from/to tags */
+ if (parse_from_to_tags(&ng_flags, op, msg))
+ goto error;
+
+ /* rtpengine command */
+ bencode_dictionary_add_string(ng_flags.dict, "command", command_strings[op]);
+
+ /* sip message type */
+ bencode_dictionary_add_string(ng_flags.dict, "sip-message-type", sip_type_strings[msg->first_line.type]);
}
@ -946,14 +948,14 @@ index 561384d..84df238 100644
static int ki_rtpengine_offer(sip_msg_t *msg, str *flags)
{
+ void *parms[2] = {flags, NULL};
+ 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);
+}
+static int ki_rtpengine_offer2(sip_msg_t *msg, str *flags, str *viabranch)
+{
+ void *parms[2] = {flags, viabranch};
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);
}
@ -968,14 +970,14 @@ index 561384d..84df238 100644
static int ki_rtpengine_answer(sip_msg_t *msg, str *flags)
{
+ void *parms[2] = {flags, NULL};
+ return rtpengine_rtpp_set_wrap(
return rtpengine_rtpp_set_wrap(
- msg, rtpengine_answer_wrap, flags->s, 2, OP_ANY);
+ msg, rtpengine_answer_wrap, parms, 2, OP_ANY);
+}
+static int ki_rtpengine_answer2(sip_msg_t *msg, str *flags, str *viabranch)
+{
+ void *parms[2] = {flags, viabranch};
return rtpengine_rtpp_set_wrap(
- msg, rtpengine_answer_wrap, flags->s, 2, OP_ANY);
+ return rtpengine_rtpp_set_wrap(
+ msg, rtpengine_answer_wrap, parms, 2, OP_ANY);
}
@ -1073,14 +1075,14 @@ index 561384d..84df238 100644
static int ki_unblock_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_UNBLOCK_MEDIA);
+ msg, rtpengine_simple_wrap, parms, 1, OP_UNBLOCK_MEDIA);
+}
+static int ki_unblock_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_UNBLOCK_MEDIA);
+ return rtpengine_rtpp_set_wrap(
+ msg, rtpengine_simple_wrap, parms, 1, OP_UNBLOCK_MEDIA);
}
@ -1095,16 +1097,16 @@ index 561384d..84df238 100644
static int ki_silence_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_SILENCE_MEDIA);
+ 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(
- msg, rtpengine_simple_wrap, flags->s, 1, OP_SILENCE_MEDIA);
+ return rtpengine_rtpp_set_wrap(
+ msg, rtpengine_simple_wrap, parms, 1, OP_SILENCE_MEDIA);
}
+}
+
+/* KI - unsilence media */
static int ki_unsilence_media0(sip_msg_t *msg)
@ -1117,14 +1119,14 @@ index 561384d..84df238 100644
static int ki_unsilence_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_UNSILENCE_MEDIA);
+ 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(
- msg, rtpengine_simple_wrap, flags->s, 1, OP_UNSILENCE_MEDIA);
+ return rtpengine_rtpp_set_wrap(
+ msg, rtpengine_simple_wrap, parms, 1, OP_UNSILENCE_MEDIA);
}
@ -1139,16 +1141,16 @@ index 561384d..84df238 100644
static int ki_block_dtmf(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_BLOCK_DTMF);
+ 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(
- msg, rtpengine_simple_wrap, flags->s, 1, OP_BLOCK_DTMF);
+ return rtpengine_rtpp_set_wrap(
+ msg, rtpengine_simple_wrap, parms, 1, OP_BLOCK_DTMF);
}
+}
+
+/* KI - unblock dtmf */
static int ki_unblock_dtmf0(sip_msg_t *msg)
@ -1161,14 +1163,14 @@ index 561384d..84df238 100644
static int ki_unblock_dtmf(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_UNBLOCK_DTMF);
+ msg, rtpengine_simple_wrap, parms, 1, OP_UNBLOCK_DTMF);
+}
+static int ki_unblock_dtmf2(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_UNBLOCK_DTMF);
+ return rtpengine_rtpp_set_wrap(
+ msg, rtpengine_simple_wrap, parms, 1, OP_UNBLOCK_DTMF);
}

Loading…
Cancel
Save