[Asterisk-Users] More than one param to AGI

Steven Critchfield critch at basesys.com
Fri Jun 20 22:32:12 MST 2003


Just a timtowtdi comment, use setvar and get the args from that. You
will get the added benifit of having the args named and not be position
sensitive.

As of late I have been very happy with the idea of passing hashes in
perl to get away from postitional variables. 

I'm not sure if the call to agi will split the variables for you, or if
you have to do it once it is inside the app. Either way, the option
above should do you fine. 

On Sat, 2003-06-21 at 00:04, Eric Wieling wrote:
> I'm starting to write an AGI script.  I want to pass more than one
> parameter to the script, but seem to be unable to.
> 
> extensions.conf:
>    exten => 85,1,AGI(/etc/asterisk/agi/args.agi,myarg1,myarg2)
> 
> args.agi:
>    #!/usr/bin/perl
>    print STDERR "FNORD prog = $0\n";
>    print STDERR "FNORD arg 1 = $ARGV[0]\n";
>    print STDERR "FNORD arg 2 = $ARGV[1]\n";
>    print STDERR "FNORD arg 3 = $ARGV[2]\n";
>    print STDERR "FNORD arg 4 = $ARGV[3]\n";
> 
> What I get at the console:
>    FNORD prog = /etc/asterisk/agi/args.agi
>    FNORD arg 1 = myarg1
>    FNORD arg 2 =
>    FNORD arg 3 =
>    FNORD arg 4 =
> 
> Is this just a limitation of AGI or am I horribly confuzzled?
> 
> --Eric
-- 
Steven Critchfield <critch at basesys.com>




More information about the asterisk-users mailing list