]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
yes there is, eavesdrop_enable_dtmf=false
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 25 May 2010 15:30:40 +0000 (10:30 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 25 May 2010 15:30:40 +0000 (10:30 -0500)
src/include/switch_types.h
src/mod/applications/mod_dptools/mod_dptools.c

index 0467895e8cc57ce5977ab4a3ce5d9b67a51b71a6..903b9527f2c91a875ca619dd77fd4ef8b958ea73 100644 (file)
@@ -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)
index fadb23eabca5f050a73f42f8328ec2e6cbea919c..07acd275e6649f0b40b14644cb0aea5427fa687c 100755 (executable)
@@ -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);
                }
        }
 }