diff --git a/src/include/switch_types.h b/src/include/switch_types.h index 0467895e8c..903b9527f2 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -230,6 +230,7 @@ typedef enum { typedef uint32_t switch_port_flag_t; typedef enum { + ED_NONE = 0, ED_MUX_READ = (1 << 0), ED_MUX_WRITE = (1 << 1), ED_DTMF = (1 << 2) diff --git a/src/mod/applications/mod_dptools/mod_dptools.c b/src/mod/applications/mod_dptools/mod_dptools.c index fadb23eabc..07acd275e6 100755 --- a/src/mod/applications/mod_dptools/mod_dptools.c +++ b/src/mod/applications/mod_dptools/mod_dptools.c @@ -344,8 +344,15 @@ SWITCH_STANDARD_APP(eavesdrop_function) if (zstr(data)) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Usage: %s\n", eavesdrop_SYNTAX); } else { + switch_eavesdrop_flag_t flags = ED_DTMF; switch_channel_t *channel = switch_core_session_get_channel(session); const char *require_group = switch_channel_get_variable(channel, "eavesdrop_require_group"); + const char *enable_dtmf = switch_channel_get_variable(channel, "eavesdrop_enable_dtmf"); + + if (enable_dtmf) { + flags = switch_true(enable_dtmf) ? ED_DTMF : ED_NONE; + } + if (!strcasecmp((char *) data, "all")) { switch_cache_db_handle_t *db = NULL; char *errmsg = NULL; @@ -387,7 +394,7 @@ SWITCH_STANDARD_APP(eavesdrop_function) if ((file = switch_channel_get_variable(channel, "eavesdrop_indicate_new"))) { switch_ivr_play_file(session, NULL, file, NULL); } - if ((status = switch_ivr_eavesdrop_session(session, e_data.uuid_list[x], require_group, ED_DTMF)) != SWITCH_STATUS_SUCCESS) { + if ((status = switch_ivr_eavesdrop_session(session, e_data.uuid_list[x], require_group, flags)) != SWITCH_STATUS_SUCCESS) { if (status != SWITCH_STATUS_BREAK) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Spy: %s Failed\n", e_data.uuid_list[x]); if ((file = switch_channel_get_variable(channel, "eavesdrop_indicate_failed"))) { @@ -412,7 +419,7 @@ SWITCH_STANDARD_APP(eavesdrop_function) free(sql); } else { - switch_ivr_eavesdrop_session(session, data, require_group, ED_DTMF); + switch_ivr_eavesdrop_session(session, data, require_group, flags); } } }