Re: [asterisk-users] Asynchronous AGI Problems (Asterisk 1.8.7.0), ubuntu-server
On Sun, Sep 25, 2011 at 8:26 AM, Mehmet Avcioglu meh...@activecom.net wrote: 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. Perhaps just start the script normally AGI(script.sh) and than inside it run your background process background-script.sh /dev/null 21 /dev/null or fork a new process, detach, run in background, etc... Hopefully somebody else can point us towards the right direction in setting up a real asterisk asynchronous AGI application. Despite being some shameless self-promotion, I want to point out this post I wrote several years ago explaining the basics: http://www.moythreads.com/wordpress/2007/12/24/asterisk-asynchronous-agi/ Moises Silva Senior Software Engineer, Software Development Manager Sangoma Technologies Inc. | 100 Renfrew Drive, Suite 100, Markham ON L3R 9R6 Canada t. 1 905 474 1990 x128 | e. m...@sangoma.com -- _ -- 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
Re: [asterisk-users] Asynchronous AGI Problems (Asterisk 1.8.7.0), ubuntu-server
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. AGI(agi:async) is the correct invocation. AsyncAGI is still an AGI and behaves as such. The primary difference between the flavors of AGI is where the commands AGI executes come from. For AsyncAGI, the commands are passed to Asterisk with AMI actions. Command responses are passed back the same way. One thing to note is that the AGI AMI actions use CommandID instead of the normal ActionID. snip Is there anyway for me to make asynchronous AGIs work? I've tried searching online to no avail. The most definitive documentation is always the source code. :) For AGI this is in the res/res_agi.c file. Richard -- _ -- 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
Re: [asterisk-users] Asynchronous AGI Problems (Asterisk 1.8.7.0), ubuntu-server
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. Perhaps just start the script normally AGI(script.sh) and than inside it run your background process background-script.sh /dev/null 21 /dev/null or fork a new process, detach, run in background, etc... Hopefully somebody else can point us towards the right direction in setting up a real asterisk asynchronous AGI application. -- Mehmet On Sep 25, 2011, at 2:00 AM, Randall Degges wrote: Hi Everyone, 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. Firstly, I discovered asynchronous AGIs via Asterisk: The Definitive Guide. The asynchronous AGI information I read can be found online, here: http://ofps.oreilly.com/titles/9780596517342/AGI.html (scroll down to the section titled Async AGI--AMI Controlled AGI). According to the book, since Asterisk 1.6.0 the AGI dialplan application has been able to execute AGI scripts asynchronously, via the syntax: exten = s,1,AGI(async:script) According to the book, using the async: prefix should have Asterisk run the AGI script in the background and instantly continue executing dialplan code. So here's my Asterisk dialplan code that's being run: [hangup] exten = s,1,AGI(async:/etc/asterisk/scripts/hangup.py) exten = s,n,Return() 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: 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. As you can see, Asterisk is ignoring the async: directive, and treating it as part of the AGI script path. Is there anyway for me to make asynchronous AGIs work? I've tried searching online to no avail. I'd greatly appreciate any responses, thanks for your time. -Randall -- Randall Degges http://rdegges.com/ -- _ -- 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 -- _ -- 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
Re: [asterisk-users] Asynchronous AGI Problems (Asterisk 1.8.7.0), ubuntu-server
Oh! I was informed that Async:AGI is an AGI that is called in from AMI. Do tell more about it. On Sun, Sep 25, 2011 at 5:26 PM, Mehmet Avcioglu meh...@activecom.netwrote: 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. Perhaps just start the script normally AGI(script.sh) and than inside it run your background process background-script.sh /dev/null 21 /dev/null or fork a new process, detach, run in background, etc... Hopefully somebody else can point us towards the right direction in setting up a real asterisk asynchronous AGI application. -- Mehmet On Sep 25, 2011, at 2:00 AM, Randall Degges wrote: Hi Everyone, 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. Firstly, I discovered asynchronous AGIs via Asterisk: The Definitive Guide. The asynchronous AGI information I read can be found online, here: http://ofps.oreilly.com/titles/9780596517342/AGI.html (scroll down to the section titled Async AGI--AMI Controlled AGI). According to the book, since Asterisk 1.6.0 the AGI dialplan application has been able to execute AGI scripts asynchronously, via the syntax: exten = s,1,AGI(async:script) According to the book, using the async: prefix should have Asterisk run the AGI script in the background and instantly continue executing dialplan code. So here's my Asterisk dialplan code that's being run: [hangup] exten = s,1,AGI(async:/etc/asterisk/scripts/hangup.py) exten = s,n,Return() 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: 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. As you can see, Asterisk is ignoring the async: directive, and treating it as part of the AGI script path. Is there anyway for me to make asynchronous AGIs work? I've tried searching online to no avail. I'd greatly appreciate any responses, thanks for your time. -Randall -- Randall Degges http://rdegges.com/ -- _ -- 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 -- _ -- 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 -- _ -- 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
Re: [asterisk-users] Asynchronous AGI Problems (Asterisk 1.8.7.0), ubuntu-server
Hi Do this script run without async option. On Sun, Sep 25, 2011 at 18:19, Sam Govind govoi...@gmail.com wrote: Oh! I was informed that Async:AGI is an AGI that is called in from AMI. Do tell more about it. On Sun, Sep 25, 2011 at 5:26 PM, Mehmet Avcioglu meh...@activecom.netwrote: 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. Perhaps just start the script normally AGI(script.sh) and than inside it run your background process background-script.sh /dev/null 21 /dev/null or fork a new process, detach, run in background, etc... Hopefully somebody else can point us towards the right direction in setting up a real asterisk asynchronous AGI application. -- Mehmet On Sep 25, 2011, at 2:00 AM, Randall Degges wrote: Hi Everyone, 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. Firstly, I discovered asynchronous AGIs via Asterisk: The Definitive Guide. The asynchronous AGI information I read can be found online, here: http://ofps.oreilly.com/titles/9780596517342/AGI.html (scroll down to the section titled Async AGI--AMI Controlled AGI). According to the book, since Asterisk 1.6.0 the AGI dialplan application has been able to execute AGI scripts asynchronously, via the syntax: exten = s,1,AGI(async:script) According to the book, using the async: prefix should have Asterisk run the AGI script in the background and instantly continue executing dialplan code. So here's my Asterisk dialplan code that's being run: [hangup] exten = s,1,AGI(async:/etc/asterisk/scripts/hangup.py) exten = s,n,Return() 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: 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. As you can see, Asterisk is ignoring the async: directive, and treating it as part of the AGI script path. Is there anyway for me to make asynchronous AGIs work? I've tried searching online to no avail. I'd greatly appreciate any responses, thanks for your time. -Randall -- Randall Degges http://rdegges.com/ -- _ -- 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 -- _ -- 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 -- _ -- 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 -- Amit Anand +91 9818559898 -- _ -- 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
[asterisk-users] Asynchronous AGI Problems (Asterisk 1.8.7.0), ubuntu-server
Hi Everyone, 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. Firstly, I discovered asynchronous AGIs via Asterisk: The Definitive Guide. The asynchronous AGI information I read can be found online, here: http://ofps.oreilly.com/titles/9780596517342/AGI.html (scroll down to the section titled Async AGI--AMI Controlled AGI). According to the book, since Asterisk 1.6.0 the AGI dialplan application has been able to execute AGI scripts asynchronously, via the syntax: exten = s,1,AGI(async:script) According to the book, using the async: prefix should have Asterisk run the AGI script in the background and instantly continue executing dialplan code. So here's my Asterisk dialplan code that's being run: [hangup] exten = s,1,AGI(async:/etc/asterisk/scripts/hangup.py) exten = s,n,Return() 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: 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. As you can see, Asterisk is ignoring the async: directive, and treating it as part of the AGI script path. Is there anyway for me to make asynchronous AGIs work? I've tried searching online to no avail. I'd greatly appreciate any responses, thanks for your time. -Randall -- Randall Degges *http://rdegges.com/* -- _ -- 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