[Asterisk-Users] Please help in writing AGI script

Ryan Pagquil rpagquil at philonline.com
Mon Dec 5 21:26:12 MST 2005


Hi,
	I'm new in writing AGI script and actually newbie in Asterisk. I'm 
writing a small script that will read the number inputed by the 
caller of the extension 123. First he will dial number 123 then a 
voice prompt will be played (welcome) then he should press number on 
the softphone and the script will echo the number to the caller. Here 
is my script:

#!/usr/bin/perl

use Asterisk::AGI;

$|=1;

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

$AGI->stream_file('welcome');
while(length($num) != 3) {
         $num = $AGI->get_data("sayme", "10000", "3");
         $saythis = $num;
         }
$AGI->say_number($saythis);

please correct my script if there is something wrong. but i think there is.


thanks,
ryan




More information about the asterisk-users mailing list