From 362b101edec3f64f24c1d04389040122df678897 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 21 Feb 2013 11:44:18 -0600 Subject: [PATCH] FS-5024 please use the new application from this patch media_reset in place of setting bypass_media=false --- .../applications/mod_dptools/mod_dptools.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/mod/applications/mod_dptools/mod_dptools.c b/src/mod/applications/mod_dptools/mod_dptools.c index d1bd034143..3f6bc9339b 100755 --- a/src/mod/applications/mod_dptools/mod_dptools.c +++ b/src/mod/applications/mod_dptools/mod_dptools.c @@ -609,6 +609,24 @@ SWITCH_STANDARD_APP(dtmf_unblock_function) switch_ivr_unblock_dtmf_session(session); } +SWITCH_STANDARD_APP(media_reset_function) +{ + switch_channel_t *channel = switch_core_session_get_channel(session); + const char *name = switch_channel_get_name(channel); + + if (switch_channel_media_ready(channel)) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "%s This function does not work once media has been established.\n", name); + return; + } + + switch_channel_clear_flag(channel, CF_PROXY_MODE); + switch_channel_clear_flag(channel, CF_PROXY_MEDIA); + switch_channel_set_variable(channel, "bypass_media", NULL); + switch_channel_set_variable(channel, "proxy_media", NULL); + + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "%sReset MEDIA flags.\n", name); +} + SWITCH_STANDARD_APP(dtmf_block_function) { switch_ivr_block_dtmf_session(session); @@ -5615,6 +5633,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load) sched_heartbeat_function, SCHED_HEARTBEAT_SYNTAX, SAF_SUPPORT_NOMEDIA); SWITCH_ADD_APP(app_interface, "enable_heartbeat", "Enable Media Heartbeat", "Enable Media Heartbeat", heartbeat_function, HEARTBEAT_SYNTAX, SAF_SUPPORT_NOMEDIA); + SWITCH_ADD_APP(app_interface, "media_reset", "Reset all bypass/proxy media flags", "Reset all bypass/proxy media flags", media_reset_function, "", SAF_SUPPORT_NOMEDIA); SWITCH_ADD_APP(app_interface, "mkdir", "Create a directory", "Create a directory", mkdir_function, MKDIR_SYNTAX, SAF_SUPPORT_NOMEDIA); SWITCH_ADD_APP(app_interface, "rename", "Rename file", "Rename file", rename_function, RENAME_SYNTAX, SAF_SUPPORT_NOMEDIA | SAF_ZOMBIE_EXEC); SWITCH_ADD_APP(app_interface, "soft_hold", "Put a bridged channel on hold", "Put a bridged channel on hold", soft_hold_function, SOFT_HOLD_SYNTAX,