]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-6226Prevent DTMF from traversing bridged channels, but still allow me to send...
authorBrian West <brian@freeswitch.org>
Sat, 1 Mar 2014 15:58:43 +0000 (09:58 -0600)
committerBrian West <brian@freeswitch.org>
Sat, 1 Mar 2014 16:06:47 +0000 (10:06 -0600)
src/switch_ivr_bridge.c

index f087092e6996a92659ff41bf7ff86c4e9609d356..92b03e1086c3c225be358bee26a8d1e9b8e8abd0 100644 (file)
@@ -214,7 +214,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;
@@ -331,6 +331,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;
@@ -449,6 +451,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);