[Asterisk-Users] AGI (IF/ELSE)

PBX pbx at tuxnetworking.com
Thu Nov 27 21:37:25 MST 2003


Ok.. I was thinking about this.. It is not a very wise decsion to put
the user input in a loop.. So how could I do some error checking outside
of the loop?

-gcc

-----Original Message-----
From: asterisk-users-admin at lists.digium.com
[mailto:asterisk-users-admin at lists.digium.com] On Behalf Of PBX
Posted At: Thursday, November 27, 2003 9:19 PM
Posted To: Asterisk User Group
Conversation: AGI (IF/ELSE)
Subject: [Asterisk-Users] AGI (IF/ELSE)


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
_______________________________________________
Asterisk-Users mailing list
Asterisk-Users at lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users



More information about the asterisk-users mailing list