[Asterisk-Dev] AGI.pm wait_for_digit() not working for me!!!
Atif
atif at convergence.com.pk
Mon May 10 23:20:45 MST 2004
Hello everybody!!!
I really need your help guys, I am using the AGI mode in meetme application,
and I want that AGI should wait for an input from the client/user i.e. a
digit and then proceed, but I have used that AGI function
agi->wait_for_digit(), but no use....my agi just passes, or ignores this
function,
where AGI should stop here and wait for the input....
.....my extension in my dialplan.....
exten => 21,1,answer
exten => 21,2,meetme(21|pb)
..........and here is my AGI...........
#!/usr/bin/perl -w
#use strict;
$aginame="conf-background.agi";
use File::Copy cp;
use Asterisk::AGI;
$AGI = new Asterisk::AGI;
my %input = $AGI->ReadParse();
$char=0;
#while(1)
{
#$AGI->exec('WaitExten','25000');
#$char = $AGI->receive_char('600');
$char=chr($AGI->wait_for_digit('600'));
#####also tried this one $char=$AGI->wait_for_digit('600');
print STDERR "input form rec char : $char\n";
if($char eq "*")
{
print STDERR "Dialing your number\n";
$srcfile="/tmp/mycall";
$dstfile="/var/spool/asterisk/outgoing/mycall";
open(MYCALL,">$srcfile") || die "Cant't open file :$srcfile
$!\n";
print MYCALL "Channel:IAX2/bali:bali\@nain/25\@atif\n";
print MYCALL "MaxRetries:2\n";
print MYCALL "RetryTime:60\n";
print MYCALL "WaitTime:30\n";
print MYCALL "Context:atif\n";
print MYCALL "Extension:22\n";
print MYCALL "Priority:1\n";
close MYCALL;
# cp($srcfile,$dstfile);
print STDERR "dialing complete...\n";
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20040511/ea46a70e/attachment.htm
More information about the asterisk-dev
mailing list