From dd8c323fcfb64084d04b02d916e6b3061a1313b6 Mon Sep 17 00:00:00 2001 From: Brian West Date: Sat, 1 Mar 2014 09:58:43 -0600 Subject: [PATCH] FS-6226Prevent DTMF from traversing bridged channels, but still allow me to send DTMF via API or dp app (uuid_send_dtmf or send_dtmf) --- src/switch_ivr_bridge.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/switch_ivr_bridge.c b/src/switch_ivr_bridge.c index 8280c964df..ff9db1e2b6 100644 --- a/src/switch_ivr_bridge.c +++ b/src/switch_ivr_bridge.c @@ -223,7 +223,7 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj) const char *silence_var; int silence_val = 0, bypass_media_after_bridge = 0; const char *bridge_answer_timeout = NULL; - int answer_timeout, sent_update = 0; + int bridge_filter_dtmf, answer_timeout, sent_update = 0; time_t answer_limit = 0; const char *exec_app = NULL; const char *exec_data = NULL; @@ -340,6 +340,8 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj) } } + bridge_filter_dtmf = switch_true(switch_channel_get_variable(chan_a, "bridge_filter_dtmf")); + for (;;) { switch_channel_state_t b_state; switch_status_t status; @@ -458,6 +460,11 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj) } } + if (bridge_filter_dtmf) { + send_dtmf = 0; + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session_a), SWITCH_LOG_DEBUG, "Dropping filtered DTMF received on %s\n", switch_channel_get_name(chan_a)); + } + if (send_dtmf) { switch_core_session_send_dtmf(session_b, &dtmf); switch_core_session_kill_channel(session_b, SWITCH_SIG_BREAK);