In article <a92fm65o07976iomfhr1k0t3sunmogd...@4ax.com>,
Gilles <codecompl...@free.fr> wrote:
> On Thu, 24 Feb 2011 13:11:02 +0000 (UTC), t...@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:

Yes, look carefully at the line I gave you with the sleep:

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

The important parts are the ( before the sleep and the )& at the end. The
brackets create a subshell to do the sleep and move, and the & puts that
subshell in the background, so the os.execute will return immediately
without waiting for the sleep to execute. By the time the mv is executed,
the channel should have been hung up properly.

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

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to