[asterisk-users] How can I use the "GET VARIABLE variablename" in AGI

李君 lijun820311 at 163.com
Thu Mar 1 19:53:04 MST 2007


Hi,All,

 I wang to use AGI in asterisk1.4.
 AGI file / myperl.agi

 #!/usr/bin/perl
use strict;
...... 
	print STDERR "7.  Testing GET VARIABLE...";
	print "GET VARIABLE EXTEN \"\"\n";
	my $result = <STDIN>;
	&checkresult($result);

......

when the agi execute; asterisk conosle  show that : 

AGI Rx << GET VARIABLE EXTEN ""
AGI Tx >> 520-Invalid command syntax.  Proper usage follows:

AGI Tx >>  Usage: GET VARIABLE <variablename>
        Returns 0 if <variablename> is not set.  Returns 1 if <variablename>
 is set and returns the variable in parentheses.
 example return code: 200 result=1 (testvariable)

AGI Tx >> 520 End of proper usage.

------------------------------------------------------------------------------------------

I couldn't get the global variable ${EXTEN}, who can told me where is the wrong?

Thanks a lot,
Amy


	

   

        李君
        lijun820311 at 163.com
          2007-03-02


More information about the asterisk-users mailing list