]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-7025 %FEATURE #comment please test
authorAnthony Minessale <anthm@freeswitch.org>
Sun, 30 Nov 2014 22:55:01 +0000 (16:55 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Sun, 30 Nov 2014 22:55:08 +0000 (16:55 -0600)
src/switch_core_io.c

index 1cd902473e8c20e79187d2d3d3b6eecfc02c2f4b..69e98e84f58e33a1c94251fa4ab8084d2b39a781 100644 (file)
@@ -1838,10 +1838,26 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_send_dtmf(switch_core_sessio
 
        if (switch_channel_test_flag(session->channel, CF_DROP_DTMF)) {
                const char *file = switch_channel_get_variable_dup(session->channel, "drop_dtmf_masking_file", SWITCH_FALSE, -1);
+               const char *digits;
 
                if (!zstr(file)) {
                        switch_ivr_broadcast(switch_core_session_get_uuid(session), file, SMF_ECHO_ALEG);
                }
+
+               if ((digits = switch_channel_get_variable_dup(session->channel, "drop_dtmf_masking_digits", SWITCH_FALSE, -1)) && !zstr(digits)) {
+                       char *p;
+                       switch_dtmf_t x_dtmf = { 0, switch_core_default_dtmf_duration(0), DTMF_FLAG_SKIP_PROCESS, 0};
+
+                       switch_channel_clear_flag(session->channel, CF_DROP_DTMF);
+                       for(p = digits; p && *p; p++) {
+                               if (is_dtmf(*p)) {
+                                       x_dtmf.digit = *p;
+                                       switch_core_session_send_dtmf(session, &x_dtmf);
+                               }
+                       }
+                       switch_channel_set_flag(session->channel, CF_DROP_DTMF);
+               }
+
                return SWITCH_STATUS_SUCCESS;
        }