[Asterisk-Users] Re: Problem while capturing DTMF digits in AGI
somesh s
someshss at yahoo.com
Sun Jul 17 23:08:53 MST 2005
Hi,
FYI
It always returns 200 result = 0.
Please do help me in this regard.
Best regards
Somesh S. Shanbhag
--- somesh s <someshss at yahoo.com> wrote:
> Hi All,
>
> I have some problem while capturing DTMF digits in
> AGI
> script.
>
> My configuration for user is ..
>
> [9009]
> type=friend
> host=dynamic
> context=default
> dtmfmode=rfc2833
> dtmfrelax=no
> disallow=all
> allow=ulaw
> allow=h263
> canreinvite=yes
>
>
>
>
>
>
> [9010]
> type=friend
> host=dynamic
> context=default
> dtmfmode=rfc2833
> dtmfrelax=no
> disallow=all
> allow=ulaw
> allow=h263
> canreinvite=yes
>
> And the script read like ...
> use Asterisk::AGI;
>
>
>
> $AGI = new Asterisk::AGI;
>
>
>
> my %input = $AGI->ReadParse();
> my $tests = 0;
> my $pass = 0;
> my $fail = 0;
>
>
>
> #setup callback
> $AGI->setcallback(\&mycallback);
>
>
>
>
>
>
> print STDERR "AGI Environment Dump:\n";
> foreach $i (sort keys %input) {
> print STDERR " -- $i = $input{$i}\n";
> }
> my $timeout = 3000; # 3 second timeout
> my $wait = 1; # true
> my $outgoing_number;
>
>
>
> while($wait) {
> my $digit = $AGI->wait_for_digit($timeout);
> print STDERR "Digit ($digit)\n";
> if ($digit > 0) {
> $digit -= 48;
> $outgoing_number .= $digit;
> }
> else { #stop waiting for more digits
> $wait = 0;
> }
> }
>
>
>
> print STDERR "Outgoing number ($outgoing_number)\n";
>
> ------>
>
> I will get the output as Outgoing number () and
> digits(0)
>
> Am I missing something here? Please do help me in
> this
> regard.
>
> Regards
> Somesh S Shanbhag
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam
> protection around
> http://mail.yahoo.com
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the asterisk-users
mailing list