AGI( )


AGI( ) Executes an AGI-compliant application

 [E]AGI(   program   [,   arguments   ]) 

Executes an Asterisk Gateway Interface-compliant program on the current channel. AGI programs allow external programs (written in almost any language) to control the telephony channel by playing audio, reading DTMF digits, and so on. Asterisk communicates with the AGI program on STDIN and STDOUT . The specified arguments are passed to the AGI program.

The program must be set as executable in the underlying filesystem. The program path is relative to the Asterisk AGI directory, which by default is /var/lib/asterisk/agi-bin/ .

If you want to run an AGI when no channel exists (such as in an h extension), use the DeadAGI( ) application instead. You may want to use the FastAGI( ) application if you want to do AGI processing across the network.

If you want access to the inbound audio stream from within your AGI program, use EAGI( ) instead of AGI( ) . Inbound audio can then be read in on file descriptor number three.

Returns -1 on hangup or if the program requested a hangup, or on non-hangup exit.

 ; call the demo AGI program  exten => 123,1,AGI(agi-test)  exten => 123,2,EAGI(eagi-test) 

See Also

DeadAGI( ) , FastAGI( ) , Chapter 9



Asterisk. The Future of Telephony
Asterisk: The Future of Telephony: The Future of Telephony
ISBN: B0026OR3OO
EAN: N/A
Year: 2001
Pages: 380

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net