I am trying to pass a variable from the Asterisk Dialplan to a perl script using the AGI. I am now to this and am very confused at to how exactly this works. Right now in my dialplan I have this:
exten=>1122,1,Answer
exten=>1122,n,Read(digit)
exten=>1122,n,agi(/home/steve/Desktop/testperlping.pl,${digit})
exten=>1122,n,Hangup()
I want a user to dial the extension 1122, then enter a number from 1-10, and have the number they entered passed into perl using the AGI.
My perl script is as follows:
#!/usr/bin/perl -w
$|=1;
use Net::Ping;
use Asterisk::AGI;
$AGI = new Asterisk::AGI;
my %input = $AGI->ReadParse();
***I think I need something here***
$AGI->verbose("$numbertheytypedintophone"); #This will display the entered number back to the CLI.
Any help would be greatly appreciated.
my ($digit) = @ARGV;
? – ikegami