[Asterisk-Users] AGI: getting the return code from an exec()'d application?

Ing. Angel Gomez angom at telnor.net
Thu Sep 25 18:16:12 MST 2003


SET VARIABLE  var value ?
Inside the AGI

Steven J. Sobol wrote:

>So I hacked up the Dial app to return a numeric return code instead of
>changing contexts based on a number being busy or unanswered. The purpose
>for this modified dial app, which I call AGIDial, is to help me concoct a
>"follow-me" type of application. The app returns -1 for a completed call,
>0 for unanswered, or 1 for busy.
>
>Well, I hooked the thing up to an AGI script that uses perl and AGI.pm, 
>and ran some tests.
>
>The AGIDial app is definitely returning the right status codes and is able
>to differentiate between the three types of call termination.
>
>But the AGI script always reports a status code of 0.
>
>And I figured out why. $AGI->exec() seems to grab the return code of a 
>Perl print() command which outputs the command to the server - but the 
>return code of the print() is not what I want - the return code of the
>application is what I want.
>
>How do I exec an app through AGI and get *its* return code? 
>
>  
>





More information about the asterisk-users mailing list