]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
let sched_cancel operate on both task id and group id
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 25 Jul 2013 19:53:11 +0000 (14:53 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 25 Jul 2013 19:53:26 +0000 (14:53 -0500)
src/mod/applications/mod_dptools/mod_dptools.c

index 0b07a72438ea9b1a348ab5e88968272de88f7e34..61440cfbef7e0356fbfb00de97067e0994c946db 100755 (executable)
@@ -1343,7 +1343,16 @@ SWITCH_STANDARD_APP(sched_cancel_function)
        if (zstr(group)) {
                group = switch_core_session_get_uuid(session);
        }
-       switch_scheduler_del_task_group(group);
+
+       if (switch_is_digit_string(group)) {
+               int64_t tmp;
+               tmp = (uint32_t) atoi(group);
+               if (tmp > 0) {
+                       switch_scheduler_del_task_id((uint32_t) tmp);
+               }
+       } else {
+               switch_scheduler_del_task_group(group);
+       }
 }
 
 static void base_set (switch_core_session_t *session, const char *data, switch_stack_t stack)