]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add sched_cancel function to cancel any impending sched_X funcs
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 2 Jul 2010 19:06:53 +0000 (14:06 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 2 Jul 2010 19:06:53 +0000 (14:06 -0500)
src/mod/applications/mod_dptools/mod_dptools.c

index aba73df20c2cfbc0954c5ccef4fddb75373b9b50..ffffeefe6cd8ab69ab5b825e4b15f41281f7cb23 100755 (executable)
@@ -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,