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

Steven J. Sobol sjsobol at JustThe.net
Thu Sep 25 17:48:35 MST 2003


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? 

-- 
JustThe.net Internet & Multimedia Services
22674 Motnocab Road * Apple Valley, CA 92307-1950 
Steve Sobol, Proprietor 
888.480.4NET (4638) * 248.724.4NET * sjsobol at JustThe.net




More information about the asterisk-users mailing list