[Asterisk-Dev] perl-asterisk problems

Eric Wieling eric at fnords.org
Fri Jun 27 06:42:30 MST 2003


I'm having problems with get_variable  I can get_variable("MACRO_EXTEN")
but I can't seem to access many of the other variables.  Am I doing
something wrong, is there a bug in asterisk-perl, or a bug in Asterisk?

And help would be appreciated.

I'm using the following script as a test:

#!/usr/bin/perl
use Asterisk::AGI;
$AGI = new Asterisk::AGI;

my %input = $AGI->ReadParse();

my $gvcallerid = $AGI->get_variable("CALLERID");
$AGI->verbose("get_variable \"CALLERID\" = $gvcallerid", 1);

my $gvcalleridnum = $AGI->get_variable("CALLERIDNUM");
$AGI->verbose("get_variable \"CALLERIDNUM\" = $gvcalleridnum", 1);

my $gvcalleridname = $AGI->get_variable("CALLERIDNAME");
$AGI->verbose("get_variable \"CALLERIDNAME\" = $gvcalleridname", 1);

my $incallerid = $input{callerid};
$AGI->verbose("\$input\{callerid\} = $incallerid", 1);

my $incalleridnum = $input{calleridnum};
$AGI->verbose("\$input\{calleridnum\}= $incalleridnum", 1);

my $incalleridname = $input{calleridname};
$AGI->verbose("\$input\{calleridname\} = $incalleridname", 1);


And I get the following output:

  /etc/asterisk/agi/test.agi: get_variable CALLERID =
  /etc/asterisk/agi/test.agi: get_variable CALLERIDNUM =
  /etc/asterisk/agi/test.agi: get_variable CALLERIDNAME =
  /etc/asterisk/agi/test.agi: $input{callerid} = God <2010>
  /etc/asterisk/agi/test.agi: $input{calleridnum}=
  /etc/asterisk/agi/test.agi: $input{calleridname} =

-- 
BTEL Consulting
850-484-4535 x2111 (Office)
504-595-3916 x2111 (Experimental)
877-552-0838 (Backup Phone)




More information about the asterisk-dev mailing list