TT#71552 [rtpengine] reorder and update patches from upstream

* Let's try to keep the descriptions for patches in order to be
  able to track them easily

Change-Id: If4501c1d15a3af1ce65cdae3e494ac50cbedfb7a
changes/09/35809/3
Victor Seva 7 years ago
parent fbf34ab287
commit 4426d19c27

@ -15,7 +15,6 @@ sipwise/add_pv_headers_module.patch
## General Patches
sipwise/usrloc_dbro.patch
sipwise/usrloc_dbro_pinger.patch
sipwise/rtpengine_next_branch_parm.patch
sipwise/pv_trans_eval_uri.patch
sipwise/avpops_avp_subst_pvar.patch
sipwise/fix_dialplan_errors.patch
@ -30,20 +29,24 @@ sipwise/sca-debug.patch
sipwise/sca-fix-notify-after-bye.patch
sipwise/sca-fix-memleaks.patch
## Ongoing Patches
sipwise/rtpengine-balancing.patch
sipwise/openssl-locking.patch
## backport from kamailio trunk (5.4)
upstream/rtpengine-add-support-for-via-branch-extra-option.patch
upstream/rtpengine-add-support-for-explicit-load-balancing-op.patch
upstream/core-events-support-for-basic-void-core-callbacks.patch
upstream/core-main-executes-callbacks-on-app-ready-and-shutdo.patch
upstream/systemdops-new-module-to-facilitate-integration-with.patch
upstream/src-Makefile.groups-added-systemdops-module-to-syste.patch
upstream/systemdops-set-core-callbacks-in-mod_register.patch
upstream/systemdops-proper-check-for-null-value.patch
## backport from kamailio upstream (5.3)
upstream/rtpengine-add-support-for-trickle-ICE-SDP-fragments.patch
upstream/rtpengine-add-support-for-start_forwarding-and-stop_.patch
upstream/rtpengine-exported-rtpengine_query-variants-to-KEMI-.patch
upstream/rtpengine-add-play_media-and-stop_media.patch
upstream/rtpengine-add-play_dtmf-command.patch # (trunk)
## backport from kamailio upstream (5.2)
sipwise/tt41650.patch
sipwise/rtpengine-trickle-ice-sdp.patch
sipwise/rtpengine-tcp-forwarding.patch
sipwise/rtpengine-play-media.patch
sipwise/registrar_add_path.patch
upstream/limit_the_execution_of_dialplan_reload.patch
sipwise/db_redis_fix_scan_usage.patch
@ -56,7 +59,6 @@ sipwise/db_redis_versioning.patch
sipwise/db_redis_master_keys.patch
sipwise/db_redis_master_sets.patch
sipwise/db_redis_fixes.patch
sipwise/rtpengine_play_dtmf.patch
sipwise/db_redis_eval_fix.patch
sipwise/switch_from_python2_to_python3.patch
upstream/tm-execute-TMCB_REQUEST_FWDED-cb-as-BRANCH_ROUTE-whe.patch

@ -1,6 +1,18 @@
From 120a71bec0ee7a07f5f39262a038977f27bc7073 Mon Sep 17 00:00:00 2001
From: Richard Fuchs <rfuchs@sipwise.com>
Date: Fri, 22 Nov 2019 09:37:02 -0500
Subject: [PATCH] rtpengine: add play_dtmf() command
---
src/modules/rtpengine/rtpengine.c | 11 +++++++++++
src/modules/rtpengine/rtpengine.h | 1 +
2 files changed, 12 insertions(+)
diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c
index 6e436083e..9ccf8c4a7 100644
--- a/src/modules/rtpengine/rtpengine.c
+++ b/src/modules/rtpengine/rtpengine.c
@@ -137,6 +137,7 @@
@@ -138,6 +138,7 @@ static const char *command_strings[] = {
[OP_STOP_FORWARDING] = "stop forwarding",
[OP_PLAY_MEDIA] = "play media",
[OP_STOP_MEDIA] = "stop media",
@ -8,7 +20,7 @@
};
struct minmax_mos_stats {
@@ -196,6 +197,7 @@
@@ -197,6 +198,7 @@ static int start_forwarding_f(struct sip_msg *, char *, char *);
static int stop_forwarding_f(struct sip_msg *, char *, char *);
static int play_media_f(struct sip_msg *, char *, char *);
static int stop_media_f(struct sip_msg *, char *, char *);
@ -16,7 +28,7 @@
static int rtpengine_answer1_f(struct sip_msg *, char *, char *);
static int rtpengine_offer1_f(struct sip_msg *, char *, char *);
static int rtpengine_delete1_f(struct sip_msg *, char *, char *);
@@ -370,6 +372,9 @@
@@ -376,6 +378,9 @@ static cmd_export_t cmds[] = {
{"stop_media", (cmd_function)stop_media_f, 0,
0, 0,
ANY_ROUTE},
@ -26,26 +38,31 @@
{"rtpengine_offer", (cmd_function)rtpengine_offer1_f, 0,
0, 0,
ANY_ROUTE},
@@ -3797,6 +3802,12 @@
@@ -3839,6 +3844,12 @@ stop_media_f(struct sip_msg* msg, char *str1, char *str2)
return rtpengine_generic_f(msg, str1, OP_STOP_MEDIA);
}
static int
+static int
+play_dtmf_f(struct sip_msg* msg, char *str1, char *str2)
+{
+ return rtpengine_generic_f(msg, str1, OP_PLAY_DTMF);
+}
+
+static int
static int
start_forwarding_f(struct sip_msg* msg, char *str1, char *str2)
{
return rtpengine_generic_f(msg, str1, OP_START_FORWARDING);
diff --git a/src/modules/rtpengine/rtpengine.h b/src/modules/rtpengine/rtpengine.h
index b5314c2c3..1e55cf244 100644
--- a/src/modules/rtpengine/rtpengine.h
+++ b/src/modules/rtpengine/rtpengine.h
@@ -46,6 +46,7 @@
@@ -46,6 +46,7 @@ enum rtpe_operation {
OP_STOP_FORWARDING,
OP_PLAY_MEDIA,
OP_STOP_MEDIA,
+ OP_PLAY_DTMF,
+ OP_PLAY_DTMF,
OP_ANY,
};
--
2.20.1

@ -1,6 +1,20 @@
From 639c29f224309ae960eb78f35e00a658d6f57a47 Mon Sep 17 00:00:00 2001
From: Richard Fuchs <rfuchs@sipwise.com>
Date: Fri, 8 Mar 2019 16:05:44 -0500
Subject: [PATCH] rtpengine: add play_media() and stop_media()
Also includes addition of the media_duration pvar, as well as several
code cleanups and simplifications.
---
src/modules/rtpengine/rtpengine.c | 319 ++++++++++++------------------
src/modules/rtpengine/rtpengine.h | 4 +
2 files changed, 133 insertions(+), 190 deletions(-)
diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c
index 08dcfd949..21f03775d 100644
--- a/src/modules/rtpengine/rtpengine.c
+++ b/src/modules/rtpengine/rtpengine.c
@@ -135,6 +135,8 @@
@@ -135,6 +135,8 @@ static const char *command_strings[] = {
[OP_UNBLOCK_MEDIA] = "unblock media",
[OP_START_FORWARDING] = "start forwarding",
[OP_STOP_FORWARDING] = "stop forwarding",
@ -9,7 +23,7 @@
};
struct minmax_mos_stats {
@@ -192,6 +194,8 @@
@@ -192,6 +194,8 @@ static int block_media_f(struct sip_msg *, char *, char *);
static int unblock_media_f(struct sip_msg *, char *, char *);
static int start_forwarding_f(struct sip_msg *, char *, char *);
static int stop_forwarding_f(struct sip_msg *, char *, char *);
@ -18,7 +32,7 @@
static int rtpengine_answer1_f(struct sip_msg *, char *, char *);
static int rtpengine_offer1_f(struct sip_msg *, char *, char *);
static int rtpengine_delete1_f(struct sip_msg *, char *, char *);
@@ -276,6 +280,9 @@
@@ -276,6 +280,9 @@ static pv_spec_t *write_sdp_pvar = NULL;
static str read_sdp_pvar_str = {NULL, 0};
static pv_spec_t *read_sdp_pvar = NULL;
@ -28,7 +42,7 @@
#define RTPENGINE_SESS_LIMIT_MSG "Parallel session limit reached"
#define RTPENGINE_SESS_LIMIT_MSG_LEN (sizeof(RTPENGINE_SESS_LIMIT_MSG)-1)
@@ -354,6 +361,15 @@
@@ -354,6 +361,15 @@ static cmd_export_t cmds[] = {
{"stop_forwarding", (cmd_function)stop_forwarding_f, 1,
fixup_spve_null, 0,
ANY_ROUTE},
@ -44,7 +58,7 @@
{"rtpengine_offer", (cmd_function)rtpengine_offer1_f, 0,
0, 0,
ANY_ROUTE},
@@ -424,6 +440,7 @@
@@ -424,6 +440,7 @@ static param_export_t params[] = {
{"hash_table_tout", INT_PARAM, &hash_table_tout },
{"hash_table_size", INT_PARAM, &hash_table_size },
{"setid_default", INT_PARAM, &setid_default },
@ -52,7 +66,7 @@
/* MOS stats output */
/* global averages */
@@ -1656,6 +1673,16 @@
@@ -1656,6 +1673,16 @@ mod_init(void)
}
}
@ -69,7 +83,7 @@
if (rtpp_strings)
pkg_free(rtpp_strings);
@@ -2455,7 +2482,8 @@
@@ -2454,7 +2481,8 @@ static bencode_item_t *rtpp_function_call(bencode_buffer_t *bencbuf, struct sip_
}
else if ((msg->first_line.type == SIP_REQUEST && op != OP_ANSWER)
|| (msg->first_line.type == SIP_REPLY && op == OP_DELETE)
@ -79,7 +93,7 @@
{
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)
@@ -2623,14 +2641,27 @@
@@ -2622,14 +2650,27 @@ error:
static int rtpp_function_call_simple(struct sip_msg *msg, enum rtpe_operation op, const char *flags_str)
{
bencode_buffer_t bencbuf;
@ -108,7 +122,7 @@
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)
{
@@ -3349,8 +3390,9 @@
@@ -3334,8 +3375,9 @@ static int rtpengine_query(struct sip_msg *msg, const char *flags) {
return 1;
}
@ -120,7 +134,7 @@
{
int ret, more;
@@ -3363,7 +3405,7 @@
@@ -3348,7 +3390,7 @@ static int rtpengine_rtpp_set_wrap(struct sip_msg *msg, int (*func)(struct sip_m
if (!selected_rtpp_set_2 || selected_rtpp_set_2 == selected_rtpp_set_1)
more = 0;
@ -129,7 +143,7 @@
if (ret < 0)
return ret;
@@ -3374,17 +3416,18 @@
@@ -3359,17 +3401,18 @@ static int rtpengine_rtpp_set_wrap(struct sip_msg *msg, int (*func)(struct sip_m
if (set_rtpengine_set_from_avp(msg, direction) == -1)
return -1;
@ -152,7 +166,7 @@
{
str flags;
@@ -3396,27 +3439,23 @@
@@ -3381,27 +3424,23 @@ rtpengine_delete1_f(struct sip_msg* msg, char* str1, char* str2)
}
}
@ -189,7 +203,7 @@
}
@@ -3562,88 +3601,45 @@
@@ -3547,88 +3586,45 @@ rtpengine_manage(struct sip_msg *msg, const char *flags)
return -1;
}
@ -285,7 +299,7 @@
}
static int
@@ -3717,160 +3713,102 @@
@@ -3702,160 +3698,102 @@ error:
}
@ -493,7 +507,7 @@
void **parms;
pv_param_t *param;
pv_value_t *res;
@@ -3924,7 +3862,7 @@
@@ -3909,7 +3847,7 @@ pv_get_rtpstat_f(struct sip_msg *msg, pv_param_t *param, pv_value_t *res)
parms[0] = param;
parms[1] = res;
@ -502,7 +516,7 @@
}
static int
@@ -3949,54 +3887,55 @@
@@ -3934,64 +3872,65 @@ set_rtp_inst_pvar(struct sip_msg *msg, const str * const uri) {
*
*/
static int ki_rtpengine_manage0(sip_msg_t *msg) {
@ -555,6 +569,18 @@
+ return rtpengine_rtpp_set_wrap(msg, rtpengine_delete_wrap, flags->s, 1, OP_ANY);
}
static int ki_rtpengine_query0(sip_msg_t *msg)
{
- return rtpengine_rtpp_set_wrap(msg, rtpengine_query_wrap, NULL, 1);
+ return rtpengine_rtpp_set_wrap(msg, rtpengine_query_wrap, NULL, 1, OP_ANY);
}
static int ki_rtpengine_query(sip_msg_t *msg, str *flags)
{
- return rtpengine_rtpp_set_wrap(msg, rtpengine_query_wrap, flags->s, 1);
+ return rtpengine_rtpp_set_wrap(msg, rtpengine_query_wrap, flags->s, 1, OP_ANY);
}
static int ki_start_recording(sip_msg_t *msg)
{
- return rtpengine_rtpp_set_wrap(msg, rtpengine_start_recording_wrap, NULL, 1);
@ -568,9 +594,11 @@
}
static int ki_set_rtpengine_set(sip_msg_t *msg, int r1)
diff --git a/src/modules/rtpengine/rtpengine.h b/src/modules/rtpengine/rtpengine.h
index 904b9a81e..8ec033fc1 100644
--- a/src/modules/rtpengine/rtpengine.h
+++ b/src/modules/rtpengine/rtpengine.h
@@ -44,6 +44,10 @@
@@ -44,6 +44,10 @@ enum rtpe_operation {
OP_UNBLOCK_MEDIA,
OP_START_FORWARDING,
OP_STOP_FORWARDING,
@ -581,3 +609,6 @@
};
struct rtpp_node {
--
2.20.1

@ -1,6 +1,17 @@
From 9178da02494d3fbb689db331535a31b75b28b614 Mon Sep 17 00:00:00 2001
From: Richard Fuchs <rfuchs@sipwise.com>
Date: Mon, 4 Mar 2019 12:07:30 -0500
Subject: [PATCH] rtpengine: add support for explicit load balancing options
---
src/modules/rtpengine/rtpengine.c | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c
index f27503c6c..23e06a88a 100644
--- a/src/modules/rtpengine/rtpengine.c
+++ b/src/modules/rtpengine/rtpengine.c
@@ -2294,6 +2294,7 @@
@@ -2309,6 +2309,7 @@ static bencode_item_t *rtpp_function_call(bencode_buffer_t *bencbuf, struct sip_
pv_value_t pv_val;
char md5[MD5_LEN];
char branch_buf[MAX_BRANCH_PARAM_LEN];
@ -8,7 +19,7 @@
/*** get & init basic stuff needed ***/
@@ -2317,6 +2318,9 @@
@@ -2332,6 +2333,9 @@ static bencode_item_t *rtpp_function_call(bencode_buffer_t *bencbuf, struct sip_
}
ng_flags.dict = bencode_dictionary(bencbuf);
@ -18,7 +29,7 @@
body.s = NULL;
if (op == OP_OFFER || op == OP_ANSWER) {
ng_flags.flags = bencode_list(bencbuf);
@@ -2484,7 +2488,26 @@
@@ -2499,7 +2503,26 @@ select_node:
goto error;
}
@ -46,3 +57,6 @@
if (!bencode_dictionary_get_str(resp, "error-reason", &error)) {
LM_ERR("proxy return error but didn't give an error reason: %.*s\n", ret, cp);
} else {
--
2.20.1

@ -1,6 +1,19 @@
From 558780f74338cff2e2fc6cb0076bfeded6a48084 Mon Sep 17 00:00:00 2001
From: Richard Fuchs <rfuchs@sipwise.com>
Date: Mon, 25 Feb 2019 10:45:02 -0500
Subject: [PATCH] rtpengine: add support for start_forwarding and
stop_forwarding
---
src/modules/rtpengine/rtpengine.c | 58 +++++++++++++++++++++++++++++--
src/modules/rtpengine/rtpengine.h | 2 ++
2 files changed, 58 insertions(+), 2 deletions(-)
diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c
index 6269a8c78..54f448e22 100644
--- a/src/modules/rtpengine/rtpengine.c
+++ b/src/modules/rtpengine/rtpengine.c
@@ -133,6 +133,8 @@
@@ -132,6 +132,8 @@ static const char *command_strings[] = {
[OP_UNBLOCK_DTMF] = "unblock DTMF",
[OP_BLOCK_MEDIA] = "block media",
[OP_UNBLOCK_MEDIA] = "unblock media",
@ -9,7 +22,7 @@
};
struct minmax_mos_stats {
@@ -188,6 +190,8 @@
@@ -187,6 +189,8 @@ static int block_dtmf_f(struct sip_msg *, char *, char *);
static int unblock_dtmf_f(struct sip_msg *, char *, char *);
static int block_media_f(struct sip_msg *, char *, char *);
static int unblock_media_f(struct sip_msg *, char *, char *);
@ -18,7 +31,7 @@
static int rtpengine_answer1_f(struct sip_msg *, char *, char *);
static int rtpengine_offer1_f(struct sip_msg *, char *, char *);
static int rtpengine_delete1_f(struct sip_msg *, char *, char *);
@@ -338,6 +342,18 @@
@@ -336,6 +340,18 @@ static cmd_export_t cmds[] = {
{"unblock_media", (cmd_function)unblock_media_f, 1,
fixup_spve_null, 0,
ANY_ROUTE},
@ -37,7 +50,7 @@
{"rtpengine_offer", (cmd_function)rtpengine_offer1_f, 0,
0, 0,
ANY_ROUTE},
@@ -2356,7 +2372,7 @@
@@ -2339,7 +2355,7 @@ static bencode_item_t *rtpp_function_call(bencode_buffer_t *bencbuf, struct sip_
bencode_dictionary_add_str(ng_flags.dict, "sdp", &body);
}
else if (op == OP_BLOCK_DTMF || op == OP_BLOCK_MEDIA || op == OP_UNBLOCK_DTMF
@ -46,7 +59,7 @@
{
ng_flags.flags = bencode_list(bencbuf);
}
@@ -2432,7 +2448,7 @@
@@ -2393,7 +2409,7 @@ static bencode_item_t *rtpp_function_call(bencode_buffer_t *bencbuf, struct sip_
bencode_list_add_string(item, ip_addr2a(&msg->rcv.src_ip));
if (op == OP_BLOCK_DTMF || op == OP_BLOCK_MEDIA || op == OP_UNBLOCK_DTMF
@ -55,7 +68,7 @@
{
if (ng_flags.directional)
bencode_dictionary_add_str(ng_flags.dict, "from-tag", &ng_flags.from_tag);
@@ -3816,6 +3832,44 @@
@@ -3724,6 +3740,44 @@ unblock_media_f(struct sip_msg* msg, char *str1, char *str2)
return rtpengine_rtpp_set_wrap(msg, rtpengine_unblock_media_wrap, flags.s, 1);
}
@ -100,9 +113,11 @@
static int rtpengine_rtpstat_wrap(struct sip_msg *msg, void *d, int more) {
void **parms;
pv_param_t *param;
diff --git a/src/modules/rtpengine/rtpengine.h b/src/modules/rtpengine/rtpengine.h
index a8266dfd4..904b9a81e 100644
--- a/src/modules/rtpengine/rtpengine.h
+++ b/src/modules/rtpengine/rtpengine.h
@@ -42,6 +42,8 @@
@@ -42,6 +42,8 @@ enum rtpe_operation {
OP_UNBLOCK_DTMF,
OP_BLOCK_MEDIA,
OP_UNBLOCK_MEDIA,
@ -111,3 +126,6 @@
};
struct rtpp_node {
--
2.20.1

@ -1,38 +1,18 @@
--- a/src/modules/rtpengine/rtpengine_funcs.c
+++ b/src/modules/rtpengine/rtpengine_funcs.c
@@ -64,6 +64,7 @@
* -1: error
* 1: text or sdp
* 2: multipart
+ * 3: trickle ice sdp fragment
*/
int check_content_type(struct sip_msg *msg)
{
@@ -133,8 +134,11 @@
advance(p,3,str_type,error_1);
x = READ(p-3) & 0x00ffffff;
- if (!one_of_8(x,sdp_))
+ if (!one_of_8(x,sdp_)) {
+ if (strncasecmp(p-3, "trickle-ice-sdpfrag", 19) == 0)
+ return 3;
goto other;
+ }
if (*p==';'||*p==' '||*p=='\t'||*p=='\n'||*p=='\r'||*p==0) {
LM_DBG("type <%.*s> found valid\n", (int)(p-str_type.s), str_type.s);
@@ -264,7 +268,7 @@
done:
/*LM_DBG("DEBUG:extract_body:=|%.*s|\n",body->len,body->s);*/
- return 1;
+ return ret; /* mirrors return type of check_content_type */
}
/*
From ffee45da0a302e2cc70612ec9e53195b3cfe6989 Mon Sep 17 00:00:00 2001
From: Richard Fuchs <rfuchs@sipwise.com>
Date: Mon, 4 Mar 2019 12:08:19 -0500
Subject: [PATCH] rtpengine: add support for trickle ICE SDP fragments
---
src/modules/rtpengine/rtpengine.c | 37 +++++++++++++++++++++++--
src/modules/rtpengine/rtpengine_funcs.c | 8 ++++--
2 files changed, 40 insertions(+), 5 deletions(-)
diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c
index 23e06a88a..08dcfd949 100644
--- a/src/modules/rtpengine/rtpengine.c
+++ b/src/modules/rtpengine/rtpengine.c
@@ -193,6 +193,7 @@
@@ -197,6 +197,7 @@ static int rtpengine_offer1_f(struct sip_msg *, char *, char *);
static int rtpengine_delete1_f(struct sip_msg *, char *, char *);
static int rtpengine_manage1_f(struct sip_msg *, char *, char *);
static int rtpengine_query1_f(struct sip_msg *, char *, char *);
@ -40,7 +20,7 @@
static int parse_flags(struct ng_flags_parse *, struct sip_msg *, enum rtpe_operation *, const char *);
@@ -349,6 +350,12 @@
@@ -365,6 +366,12 @@ static cmd_export_t cmds[] = {
{"rtpengine_answer", (cmd_function)rtpengine_answer1_f, 1,
fixup_spve_null, 0,
ANY_ROUTE},
@ -53,7 +33,7 @@
{"rtpengine_manage", (cmd_function)rtpengine_manage1_f, 0,
0, 0,
ANY_ROUTE},
@@ -2288,7 +2295,7 @@
@@ -2303,7 +2310,7 @@ static bencode_item_t *rtpp_function_call(bencode_buffer_t *bencbuf, struct sip_
bencode_item_t *item, *resp;
str viabranch = STR_NULL;
str body = STR_NULL, error = STR_NULL;
@ -62,7 +42,7 @@
struct rtpp_node *node;
char *cp;
pv_value_t pv_val;
@@ -2339,7 +2346,7 @@
@@ -2354,7 +2361,7 @@ static bencode_item_t *rtpp_function_call(bencode_buffer_t *bencbuf, struct sip_
body = pv_val.rs;
}
@ -71,7 +51,7 @@
LM_ERR("can't extract body from the message\n");
goto error;
}
@@ -2361,6 +2368,10 @@
@@ -2376,6 +2383,10 @@ static bencode_item_t *rtpp_function_call(bencode_buffer_t *bencbuf, struct sip_
if (parse_flags(&ng_flags, msg, &op, flags_str))
goto error;
@ -82,7 +62,7 @@
/* only add those if any flags were given at all */
if (ng_flags.direction && ng_flags.direction->child)
bencode_dictionary_add(ng_flags.dict, "direction", ng_flags.direction);
@@ -2503,7 +2514,7 @@
@@ -2518,7 +2529,7 @@ select_node:
else
LM_INFO("proxy %.*s has reached its load limit (%.*s) - trying next one",
node->rn_url.len, node->rn_url.s,
@ -91,7 +71,7 @@
goto select_node;
}
@@ -3555,6 +3566,26 @@
@@ -3556,6 +3567,26 @@ rtpengine_manage1_f(struct sip_msg *msg, char *str1, char *str2)
return rtpengine_rtpp_set_wrap(msg, rtpengine_manage_wrap, flags.s, 1);
}
@ -118,3 +98,40 @@
static int rtpengine_offer_wrap(struct sip_msg *msg, void *d, int more) {
return rtpengine_offer_answer(msg, d, OP_OFFER, more);
}
diff --git a/src/modules/rtpengine/rtpengine_funcs.c b/src/modules/rtpengine/rtpengine_funcs.c
index 2220da729..b99153a06 100644
--- a/src/modules/rtpengine/rtpengine_funcs.c
+++ b/src/modules/rtpengine/rtpengine_funcs.c
@@ -64,6 +64,7 @@
* -1: error
* 1: text or sdp
* 2: multipart
+ * 3: trickle ice sdp fragment
*/
int check_content_type(struct sip_msg *msg)
{
@@ -133,8 +134,11 @@ int check_content_type(struct sip_msg *msg)
advance(p,3,str_type,error_1);
x = READ(p-3) & 0x00ffffff;
- if (!one_of_8(x,sdp_))
+ if (!one_of_8(x,sdp_)) {
+ if (strncasecmp(p-3, "trickle-ice-sdpfrag", 19) == 0)
+ return 3;
goto other;
+ }
if (*p==';'||*p==' '||*p=='\t'||*p=='\n'||*p=='\r'||*p==0) {
LM_DBG("type <%.*s> found valid\n", (int)(p-str_type.s), str_type.s);
@@ -264,7 +268,7 @@ error:
done:
/*LM_DBG("DEBUG:extract_body:=|%.*s|\n",body->len,body->s);*/
- return 1;
+ return ret; /* mirrors return type of check_content_type */
}
/*
--
2.20.1

@ -1,3 +1,14 @@
From 2baa05ad2336f5e1286218b6516b7b8ef16037a2 Mon Sep 17 00:00:00 2001
From: Richard Fuchs <rfuchs@sipwise.com>
Date: Mon, 4 Mar 2019 12:06:38 -0500
Subject: [PATCH] rtpengine: add support for via-branch=extra option
---
src/modules/rtpengine/rtpengine.c | 39 ++++++++++++++++++++++++-------
1 file changed, 31 insertions(+), 8 deletions(-)
diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c
index 54f448e22..f27503c6c 100644
--- a/src/modules/rtpengine/rtpengine.c
+++ b/src/modules/rtpengine/rtpengine.c
@@ -77,6 +77,7 @@
@ -8,7 +19,7 @@
#include "../../modules/tm/tm_load.h"
#include "rtpengine.h"
#include "rtpengine_funcs.h"
@@ -195,7 +196,7 @@ static int rtpengine_query1_f(struct sip
@@ -199,7 +200,7 @@ static int rtpengine_query1_f(struct sip_msg *, char *, char *);
static int parse_flags(struct ng_flags_parse *, struct sip_msg *, enum rtpe_operation *, const char *);
@ -17,7 +28,7 @@
static int fixup_set_id(void ** param, int param_no);
static int set_rtpengine_set_f(struct sip_msg * msg, char * str1, char * str2);
static struct rtpp_set * select_rtpp_set(unsigned int id_set);
@@ -2197,6 +2198,8 @@ static int parse_flags(struct ng_flags_p
@@ -2212,6 +2213,8 @@ static int parse_flags(struct ng_flags_parse *ng_flags, struct sip_msg *msg, enu
ng_flags->via = 3;
else if (str_eq(&val, "extra"))
ng_flags->via = -1;
@ -26,7 +37,7 @@
else
goto error;
goto next;
@@ -2289,6 +2292,8 @@ static bencode_item_t *rtpp_function_cal
@@ -2304,6 +2307,8 @@ static bencode_item_t *rtpp_function_call(bencode_buffer_t *bencbuf, struct sip_
struct rtpp_node *node;
char *cp;
pv_value_t pv_val;
@ -35,7 +46,7 @@
/*** get & init basic stuff needed ***/
@@ -2372,12 +2377,30 @@ static bencode_item_t *rtpp_function_cal
@@ -2387,12 +2392,30 @@ static bencode_item_t *rtpp_function_call(bencode_buffer_t *bencbuf, struct sip_
bencode_dictionary_add_str(ng_flags.dict, "call-id", &ng_flags.call_id);
if (ng_flags.via) {
@ -72,7 +83,7 @@
if (ret == -1 || viabranch.len == 0) {
LM_ERR("can't get Via branch/extra ID\n");
goto error;
@@ -3554,7 +3577,7 @@ rtpengine_answer1_f(struct sip_msg *msg,
@@ -3555,7 +3578,7 @@ rtpengine_answer1_f(struct sip_msg *msg, char *str1, char *str2)
}
static int
@ -81,3 +92,6 @@
{
bencode_buffer_t bencbuf;
bencode_item_t *dict;
--
2.20.1

@ -0,0 +1,52 @@
From 026475aa9d43307442d0e57acf8e11544d00dbed Mon Sep 17 00:00:00 2001
From: Surendra Tiwari <surendratiwari3@gmail.com>
Date: Wed, 9 Jan 2019 08:57:12 +0100
Subject: [PATCH] rtpengine: exported rtpengine_query() variants to KEMI
framework
- GH #1792
---
src/modules/rtpengine/rtpengine.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c
index 484ce05f3..6269a8c78 100644
--- a/src/modules/rtpengine/rtpengine.c
+++ b/src/modules/rtpengine/rtpengine.c
@@ -3843,6 +3843,16 @@ static int ki_rtpengine_delete(sip_msg_t *msg, str *flags)
return rtpengine_rtpp_set_wrap(msg, rtpengine_delete_wrap, flags->s, 1);
}
+static int ki_rtpengine_query0(sip_msg_t *msg)
+{
+ return rtpengine_rtpp_set_wrap(msg, rtpengine_query_wrap, NULL, 1);
+}
+
+static int ki_rtpengine_query(sip_msg_t *msg, str *flags)
+{
+ return rtpengine_rtpp_set_wrap(msg, rtpengine_query_wrap, flags->s, 1);
+}
+
static int ki_start_recording(sip_msg_t *msg)
{
return rtpengine_rtpp_set_wrap(msg, rtpengine_start_recording_wrap, NULL, 1);
@@ -3977,6 +3987,16 @@ 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 }
},
+ { str_init("rtpengine"), str_init("rtpengine_query0"),
+ SR_KEMIP_INT, ki_rtpengine_query0,
+ { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
+ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+ },
+ { str_init("rtpengine"), str_init("rtpengine_query"),
+ SR_KEMIP_INT, ki_rtpengine_query,
+ { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,
+ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+ },
{ {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } }
};
--
2.20.1
Loading…
Cancel
Save