Pass parameters to AGI app?

Can someone tell me how I can pass / collect parameters from Dialpad to an AGI program? I’ve seen some examples through the STDIN, but supposedly in the initial AGI call you can pass startup parameters to the code.


vinod-asteriskCLI> show application AGI
-= Info about application ‘AGI’ =-

Executes an AGI compliant application

[E|Dead]AGI(command|args): Executes an Asterisk Gateway Interface compliant
program on a channel. AGI allows Asterisk to launch external programs
written in any language to control a telephony channel, play audio,
read DTMF digits, etc. by communicating with the AGI protocol on stdin
and stdout.
Returns -1 on hangup (except for DeadAGI) or if application requested
hangup, or 0 on non-hangup exit.
Using ‘EAGI’ provides enhanced AGI, with incoming audio available out of band
on file descriptor 3

Use the CLI command ‘show agi’ to list available agi commands

Thanks, but calling the app isn’t the problem, it’s passing parameters on execution. For example, I’ve got:

exten => 44,2,AGI(agi-test2.agi|“Parameters”)

Which I read was supposed to pass the string “Parameters” to the app, but it doesn’t appear to show up. Ideally I’d like to do something like:

exten => 44,2,AGI(agi-test2.agi|${EXTEN})

Any ideas?

exten => 44,2,AGI(agi-test2.agi,${EXTEN},“hi”)

gives you the value of EXTEN in $ARGV[0] and “hi” in $ARGV[1]


Hamster --> Perfect! Worked great, Thanks!!