[Asterisk-Users] AGI (IF/ELSE)

PBX pbx at tuxnetworking.com
Thu Nov 27 19:19:04 MST 2003


I need some help with some statements.....

#!/usr/bin/perl

use Asterisk::AGI;

$AGI = new Asterisk::AGI;

my %input = $AGI->ReadParse();
my $callerid = $input{'callerid'};

if ($optemp != 1) {

my $empid = $AGI->get_data('employee',-1,5);
                $AGI->stream_file(entered);
                $AGI->say_digits($empid);

my $optemp = $AGI->get_data('correct',-1,1);

}else{

my $strid = $AGI->get_data('store',-1,5);
                $AGI->stream_file(entered);
                $AGI->say_digits($strid);

        my $optstr = $AGI->get_data('correct',-1,1);
}

exit;

I can't seem to figure out what I am doing wrong.  When the script is
run. The user puts in there employee ID and then hears it back to them.
Then they are asked if this is correct press 1 for yes or 9 for no.  If
they press 1, it should go onto the next piece of the script????

But if I press 1 the script ends.... Any ideas 

Thanks, 

-gcc



More information about the asterisk-users mailing list