[asterisk-users] Forking in Dialplan

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Thu Apr 24 09:20:26 CDT 2008


On Thursday 24 April 2008 03:51, Tobias Ahlander wrote:
> Is it possible to somehow fork in the dialplan? Say a call comes in. Then I
> want to wait 30 seconds and then write in a database, but at the same time
> while I wait I want to go on with other commands too.

There isn't a fork, but there is a method built in that is rather similar to
the alarm(2) interface in the kernel, which is called Absolute Timeout.  The
method of using this is Set(TIMEOUT(absolute)=30), which sets a timer that
will fire in 30 seconds.  When that timer fires, any application that is
currently executing will terminate, and you will be redirected to the "T"
extension in the current context.  Note that you can also cancel this timer
by using setting the timeout to 0, i.e. Set(TIMEOUT(absolute)=0).

Also note that there can only be a single absolute timeout per channel (i.e.
setting a new timeout resets any timer currently in effect).

-- 
Tilghman



More information about the asterisk-users mailing list