Oh! I was informed that Async:AGI is an AGI that is called in from AMI. Do tell more about it.<br><br><div class="gmail_quote">On Sun, Sep 25, 2011 at 5:26 PM, Mehmet Avcioglu <span dir="ltr"><<a href="mailto:mehmet@activecom.net">mehmet@activecom.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
Actually it doesn't say "AGI(async:script)" it says "AGI(async:agi)" and than continues further to setting up an AMI user so the script is executed through the manager interface?? Than it says "AGI(agi:async)".?? Well most importantly it says "Cons of async AGI: It is the most complex method of using AGI to implement." ..:) I have been interested in Async AGI as well and after reading your post looked into the link you provided, seems different than what we immediately think, a background process.<br>
<br>
Perhaps just start the script normally "AGI(script.sh)" and than inside it run your background process "background-script.sh > /dev/null 2>&1 < /dev/null &" or fork a new process, detach, run in background, etc...<br>
<br>
Hopefully somebody else can point us towards the right direction in setting up a real asterisk asynchronous AGI application.<br>
<br>
--<br>
Mehmet<br>
<div><div></div><div class="h5"><br>
On Sep 25, 2011, at 2:00 AM, Randall Degges wrote:<br>
<br>
> Hi Everyone,<br>
><br>
> I've been trying to get asynchronous AGIs working in some Asterisk code I have. I'm using Asterisk 1.8.7.0, and I'm very familiar with dialplan and AGI scripting overall. Here's my problem: I can't get Asterisk to execute *any* AGIs asynchronously.<br>
><br>
> Firstly, I discovered asynchronous AGIs via "Asterisk: The Definitive Guide". The asynchronous AGI information I read can be found online, here: <a href="http://ofps.oreilly.com/titles/9780596517342/AGI.html" target="_blank">http://ofps.oreilly.com/titles/9780596517342/AGI.html</a> (scroll down to the section titled "Async AGI--AMI Controlled AGI").<br>
><br>
> According to the book, since Asterisk 1.6.0 the AGI dialplan application has been able to execute AGI scripts asynchronously, via the syntax:<br>
><br>
> exten => s,1,AGI(async:script)<br>
><br>
> According to the book, using the "async:" prefix should have Asterisk run the AGI script in the background and instantly continue executing dialplan code.<br>
><br>
> So here's my Asterisk dialplan code that's being run:<br>
><br>
> [hangup]<br>
> exten => s,1,AGI(async:/etc/asterisk/scripts/hangup.py)<br>
> exten => s,n,Return()<br>
><br>
> Pretty simple context--essentially my AGI script just does some call clean up logic before a caller hangs up, talking to a few web servers and generating statistics for later usage. What happens when Asterisk executes this context, is:<br>
><br>
> WARNING[7911]: res_agi.c:1622 launch_script: Failed to execute '/var/lib/asterisk/agi-bin/async:/etc/asterisk/scripts/hangup.py': File does not exist.<br>
><br>
> As you can see, Asterisk is ignoring the async: directive, and treating it as part of the AGI script path.<br>
><br>
> Is there anyway for me to make asynchronous AGIs work? I've tried searching online to no avail.<br>
><br>
> I'd greatly appreciate any responses, thanks for your time.<br>
><br>
> -Randall<br>
><br>
> --<br>
> Randall Degges<br>
> <a href="http://rdegges.com/" target="_blank">http://rdegges.com/</a><br>
><br>
</div></div>> --<br>
> _____________________________________________________________________<br>
> -- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
> New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
> <a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
><br>
> asterisk-users mailing list<br>
> To UNSUBSCRIBE or update options visit:<br>
> <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
<br>
<br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
<a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
</blockquote></div><br>