[A*UG] passing args to AGI scripts
Gil Kloepfer
aaug at kloepfer.org
Sun Jun 11 21:00:30 CDT 2006
On Sun, Jun 11, 2006 at 06:51:56PM -0500, Jim Freeze wrote:
> I can't seem to find out how to get arguments into an agi script.
[...]
> AGI scripts *always* receive two arguments. The first argument is
> the full path to the script itself. The second argument is the stuff
> passed in from the "exten" line.
[...]
> Where does one get this argument list at?
It depends on which language you're writing the AGI script in.
In perl, it's @ARGV. In C, it's the *argv[] you typically use
as an argument list for "main".
Note that in reality, the "path to the script itself" being
given by Asterisk isn't really true. It happens that argv[0] in C
does give the line it was invoked with, but in perl that isn't
the case.
Refer to your favorite computer language's reference for a discussion
of UNIX command-line argument handling.
---
Gil Kloepfer
aaug at kloepfer.org
More information about the Austin-Asterisk-Users-Group
mailing list