here’s my code
$stream_file: says following
press 1 to create a Peer Asterisk account
press 2 to create a Friend Asterisk account
press 3 to create an User Asterisk account
press # to know abt Peer, Friend, User
press * to Repeat this menu again
for($a=0;$a=2;a++ ) {
$opts = $agi->get_data($stream_file, 10000, 1);
if(($a==2) && ($opts ==NULL){
$agi->hangup($channel)
}
elsif(($a!=2) && ($opts !=NULL)) {
$a == 2;
while( ! (($opts == 1) || ($opts == 2) || ($opts == 3) || ($opts == ‘#’) || ($opts == ‘*’)) ) {
$AGI->exec(‘Playback’,‘invalid’);
$opts = $agi->get_data($stream_file, 10000, 1);
}
if ($opts == 1) {
create a peer
}
elsif ($opts == 2) {
create a friend
}
elsif ($opts == 3) {
create a user
}
elsif ($opts == *) {
#repeate menu
}
else {
$AGI->stream_file($about,“0”);
}
}
}
Now the problem comes when user presses pound ‘#’ the scalar variable $opts store NULL value in it and that becomes similar for the timeout because the $opts value is initially NULL and that is due to repeat the menu on timeout and hangup after 3 timeouts. So two different actions could not be performed with one value.
on timeout CLI shows following line
AGI TX >> 200 result= (timeout)
is it possible to store “200 result” value some how
hope U get my point …Thankx