2

The sched_hangup doc doesn't mention how to do this, and sched_cancel only works for sched_transfer and sched_broadcast.

sched_cancel needs a task or group ID, and only the latter two set the ID in the session, I tested.

Or is there another way to get the task ID?

toraritte
  • 6,300
  • 3
  • 46
  • 67

1 Answers1

0

Workaround

Couldn't find a solution, but this workaround effectively solved the problem:

Set up sched_transfer to a non-existent extension, which will result in a hangup with No route, Aborting, unless aborted with sched_cancel.

Below is a Lua example, but this strategy would work in the dialplan just the same because the sched_* commands are all dialplan applications (i.e., part of mod_dptools).

session:execute("sched_transfer", "+600 9999 XML default")
-- ...
local lsi = session:getVariable("last_sched_id")
session:execute("sched_cancel", tostring(lsi))
toraritte
  • 6,300
  • 3
  • 46
  • 67