mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-31 10:42:17 +00:00
yes there is, eavesdrop_enable_dtmf=false
This commit is contained in:
parent
b073e82b5f
commit
596c001231
@ -230,6 +230,7 @@ typedef enum {
|
|||||||
typedef uint32_t switch_port_flag_t;
|
typedef uint32_t switch_port_flag_t;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
ED_NONE = 0,
|
||||||
ED_MUX_READ = (1 << 0),
|
ED_MUX_READ = (1 << 0),
|
||||||
ED_MUX_WRITE = (1 << 1),
|
ED_MUX_WRITE = (1 << 1),
|
||||||
ED_DTMF = (1 << 2)
|
ED_DTMF = (1 << 2)
|
||||||
|
@ -344,8 +344,15 @@ SWITCH_STANDARD_APP(eavesdrop_function)
|
|||||||
if (zstr(data)) {
|
if (zstr(data)) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Usage: %s\n", eavesdrop_SYNTAX);
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Usage: %s\n", eavesdrop_SYNTAX);
|
||||||
} else {
|
} else {
|
||||||
|
switch_eavesdrop_flag_t flags = ED_DTMF;
|
||||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||||
const char *require_group = switch_channel_get_variable(channel, "eavesdrop_require_group");
|
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")) {
|
if (!strcasecmp((char *) data, "all")) {
|
||||||
switch_cache_db_handle_t *db = NULL;
|
switch_cache_db_handle_t *db = NULL;
|
||||||
char *errmsg = NULL;
|
char *errmsg = NULL;
|
||||||
@ -387,7 +394,7 @@ SWITCH_STANDARD_APP(eavesdrop_function)
|
|||||||
if ((file = switch_channel_get_variable(channel, "eavesdrop_indicate_new"))) {
|
if ((file = switch_channel_get_variable(channel, "eavesdrop_indicate_new"))) {
|
||||||
switch_ivr_play_file(session, NULL, file, NULL);
|
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) {
|
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]);
|
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"))) {
|
if ((file = switch_channel_get_variable(channel, "eavesdrop_indicate_failed"))) {
|
||||||
@ -412,7 +419,7 @@ SWITCH_STANDARD_APP(eavesdrop_function)
|
|||||||
free(sql);
|
free(sql);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
switch_ivr_eavesdrop_session(session, data, require_group, ED_DTMF);
|
switch_ivr_eavesdrop_session(session, data, require_group, flags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user