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

Tony Mountifield tony at mountifield.org
Thu Feb 24 07:11:02 CST 2011


In article <jg9cm6pqkit0q3oi5aacabi7dfql7stlue at 4ax.com>,
Gilles <codecomplete at free.fr> wrote:
> Hello
> 
> 	No matter what I try, Asterisk still fails dialing back through a
> callfile built through an AGI script.
> 
> The whole thing works fine when the original call that triggers
> Asterisk is from an internal extension (Xlite), but it fails when it's
> from my cellphone ringing through the FXO/Zaptel port and I want to
> wait a few seconds and call back through the FXO/Zaptel.
> 
> Could it that even though the Zap channel is dead when calling the
> script in the "h" extension, for some reason, the channel is still in
> use at that point, so even an AGI script won't be able to make an
> outgoing call through the FXO?

Yes, that is the reason. The easiest thing is probably to put in a delay
if os.execute allows full shell syntax:

> os.execute("mv /var/tmp/callback.call /var/tmp/asterisk/outgoing")

os.execute("(sleep 2;mv /var/tmp/callback.call /var/tmp/asterisk/outgoing)&")

Alternatively, you can set the mtime of the file you created in /var/tmp
to two or three seconds in the future - does lua have something like
file.utime or os.utime? The pbx spooler in Asterisk will not execute call
files with an mtime still in the future.

Cheers
Tony
-- 
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org



More information about the asterisk-users mailing list