[asterisk-users] [1.4] Still can't get it to call back

Gilles codecomplete at free.fr
Fri Feb 25 04:54:58 CST 2011


On Thu, 24 Feb 2011 13:11:02 +0000 (UTC), tony at mountifield.org (Tony
Mountifield) wrote:
>Yes, that is the reason. The easiest thing is probably to put in a delay
>if os.execute allows full shell syntax:

Thanks for the idea.

While reading samples, I happened upon the "system()" application,
which means I can call a script directly from extensions.conf instead
of through AGI.

However, system() seems to launch script synchronously, which means
that using "sleep 10" in the script doesn't solve the issue: Upon
return, the channel is still not available:

===== extensions.conf
exten => h,1,system(/var/tmp/callback.lua)
exten => h,n,NoOp(after running script)
===== callback.lua
os.execute("/bin/sleep 10")
os.execute("mv /var/tmp/callback.call /var/tmp/asterisk/outgoing")
=====

Is there a way to launch a script asynchronously, so that Asterisk
proceeds to the next step immediately, and the script will then wait
10 seconds so that the channel is available again?

Thank you.




More information about the asterisk-users mailing list