add sched_cancel function to cancel any impending sched_X funcs

This commit is contained in:
Anthony Minessale 2010-07-02 14:06:53 -05:00
parent 23fd8ebb3e
commit 0c826b1fc8
1 changed files with 13 additions and 0 deletions

View File

@ -816,6 +816,17 @@ SWITCH_STANDARD_APP(deflect_function)
switch_core_session_receive_message(session, &msg);
}
SWITCH_STANDARD_APP(sched_cancel_function)
{
const char *group = data;
if (zstr(group)) {
group = switch_core_session_get_uuid(session);
}
switch_scheduler_del_task_group(group);
}
SWITCH_STANDARD_APP(set_function)
{
char *var, *val = NULL;
@ -3300,6 +3311,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load)
SAF_SUPPORT_NOMEDIA);
SWITCH_ADD_APP(app_interface, "send_dtmf", "Send dtmf to be sent", "Send dtmf to be sent from a session", send_dtmf_function, "<dtmf_data>",
SAF_SUPPORT_NOMEDIA);
SWITCH_ADD_APP(app_interface, "sched_cencel", "cancel scheduled tasks", "cancel scheduled tasks", sched_cancel_function, "[group]",
SAF_SUPPORT_NOMEDIA);
SWITCH_ADD_APP(app_interface, "sched_hangup", SCHED_HANGUP_DESCR, SCHED_HANGUP_DESCR, sched_hangup_function, "[+]<time> [<cause>]",
SAF_SUPPORT_NOMEDIA);
SWITCH_ADD_APP(app_interface, "sched_broadcast", SCHED_BROADCAST_DESCR, SCHED_BROADCAST_DESCR, sched_broadcast_function,