allow specific removal of media bugs by function name

This commit is contained in:
Anthony Minessale 2013-03-22 11:20:34 -05:00
parent 818f8521e0
commit 9c255aff76
1 changed files with 8 additions and 2 deletions

View File

@ -940,7 +940,13 @@ SWITCH_STANDARD_APP(ring_ready_function)
SWITCH_STANDARD_APP(remove_bugs_function)
{
switch_core_media_bug_remove_all(session);
const char *function = NULL;
if (!zstr((char *)data)) {
function = data;
}
switch_core_media_bug_remove_all_function(session, function);
}
SWITCH_STANDARD_APP(break_function)
@ -5605,7 +5611,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load)
SWITCH_ADD_APP(app_interface, "unset", "Unset a channel variable", UNSET_LONG_DESC, unset_function, "<varname>",
SAF_SUPPORT_NOMEDIA | SAF_ROUTING_EXEC | SAF_ZOMBIE_EXEC);
SWITCH_ADD_APP(app_interface, "ring_ready", "Indicate Ring_Ready", "Indicate Ring_Ready on a channel.", ring_ready_function, "", SAF_SUPPORT_NOMEDIA);
SWITCH_ADD_APP(app_interface, "remove_bugs", "Remove media bugs", "Remove all media bugs from a channel.", remove_bugs_function, "", SAF_NONE);
SWITCH_ADD_APP(app_interface, "remove_bugs", "Remove media bugs", "Remove all media bugs from a channel.", remove_bugs_function, "[<function>]", SAF_NONE);
SWITCH_ADD_APP(app_interface, "break", "Break", "Set the break flag.", break_function, "", SAF_SUPPORT_NOMEDIA);
SWITCH_ADD_APP(app_interface, "detect_speech", "Detect speech", "Detect speech on a channel.", detect_speech_function, DETECT_SPEECH_SYNTAX, SAF_NONE);
SWITCH_ADD_APP(app_interface, "play_and_detect_speech", "Play and do speech recognition", "Play and do speech recognition", play_and_detect_speech_function, PLAY_AND_DETECT_SPEECH_SYNTAX, SAF_NONE);