From b068c128276ad22a7db0da8089af19184dcac86c Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Mon, 3 Sep 2018 11:02:39 -0400 Subject: [PATCH] TT#43556 support rtpengine DTMF blocking commands Change-Id: Ic95960114aa0e5654bfd052256b3f0a123fc2640 --- debian/patches/series | 1 + debian/patches/sipwise/dtmf-blocking.patch | 72 ++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 debian/patches/sipwise/dtmf-blocking.patch diff --git a/debian/patches/series b/debian/patches/series index 406e9c941..0f8e86649 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -44,3 +44,4 @@ upstream/0005-topos_redis-execute-end-dialog-function-only-for-BYE.patch sipwise/extend_stats.patch sipwise/avpops_avp_subst_pvar.patch sipwise/tt37692.patch +sipwise/dtmf-blocking.patch diff --git a/debian/patches/sipwise/dtmf-blocking.patch b/debian/patches/sipwise/dtmf-blocking.patch new file mode 100644 index 000000000..a4faece6e --- /dev/null +++ b/debian/patches/sipwise/dtmf-blocking.patch @@ -0,0 +1,72 @@ +--- a/src/modules/rtpengine/rtpengine.c ++++ b/src/modules/rtpengine/rtpengine.c +@@ -128,6 +128,8 @@ + [OP_QUERY] = "query", + [OP_PING] = "ping", + [OP_STOP_RECORDING] = "stop recording", ++ [OP_BLOCK_DTMF] = "block DTMF", ++ [OP_UNBLOCK_DTMF] = "unblock DTMF", + }; + + struct minmax_mos_stats { +@@ -169,6 +171,8 @@ + static int rtpp_test(struct rtpp_node*, int, int); + static int start_recording_f(struct sip_msg *, char *, char *); + static int stop_recording_f(struct sip_msg *, char *, char *); ++static int block_dtmf_f(struct sip_msg *, char *, char *); ++static int unblock_dtmf_f(struct sip_msg *, char *, char *); + 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 *); +@@ -294,6 +298,12 @@ + {"stop_recording", (cmd_function)stop_recording_f, 1, + fixup_spve_null, 0, + ANY_ROUTE}, ++ {"block_dtmf", (cmd_function)block_dtmf_f, 0, ++ 0, 0, ++ ANY_ROUTE }, ++ {"unblock_dtmf", (cmd_function)unblock_dtmf_f, 0, ++ 0, 0, ++ ANY_ROUTE}, + {"rtpengine_offer", (cmd_function)rtpengine_offer1_f, 0, + 0, 0, + ANY_ROUTE}, +@@ -3484,6 +3494,27 @@ + return rtpengine_rtpp_set_wrap(msg, rtpengine_stop_recording_wrap, flags.s, 1); + } + ++ ++static int rtpengine_block_dtmf_wrap(struct sip_msg *msg, void *d, int more) { ++ return rtpp_function_call_simple(msg, OP_BLOCK_DTMF, d); ++} ++ ++static int rtpengine_unblock_dtmf_wrap(struct sip_msg *msg, void *d, int more) { ++ return rtpp_function_call_simple(msg, OP_UNBLOCK_DTMF, d); ++} ++ ++static int ++block_dtmf_f(struct sip_msg* msg, char *str1, char *str2) ++{ ++ return rtpengine_rtpp_set_wrap(msg, rtpengine_start_recording_wrap, NULL, 1); ++} ++ ++static int ++unblock_dtmf_f(struct sip_msg* msg, char *str1, char *str2) ++{ ++ return rtpengine_rtpp_set_wrap(msg, rtpengine_stop_recording_wrap, NULL, 1); ++} ++ + static int rtpengine_rtpstat_wrap(struct sip_msg *msg, void *d, int more) { + void **parms; + pv_param_t *param; +--- a/src/modules/rtpengine/rtpengine.h ++++ b/src/modules/rtpengine/rtpengine.h +@@ -38,6 +38,8 @@ + OP_STOP_RECORDING, + OP_QUERY, + OP_PING, ++ OP_BLOCK_DTMF, ++ OP_UNBLOCK_DTMF, + }; + + struct rtpp_node {