somesh s
2005-Jul-17 21:38 UTC
[Asterisk-Users] Problem while capturing DTMF digits in AGI
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
Madhawa Jayanath
2005-Jul-17 22:11 UTC
[Asterisk-Users] Problem while capturing DTMF digits in AGI
Hello,
You must answer the channel
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";
}
$AGI->answer();#<---------------------------------------Answer the channel
Cheers,
Madhawa
somesh s 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
>_______________________________________________
>Asterisk-Users mailing list
>Asterisk-Users@lists.digium.com
>http://lists.digium.com/mailman/listinfo/asterisk-users
>To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
>
>
somesh s
2005-Jul-17 23:08 UTC
[Asterisk-Users] Re: Problem while capturing DTMF digits in AGI
Hi, FYI It always returns 200 result = 0. Please do help me in this regard. Best regards Somesh S. Shanbhag --- somesh s <someshss@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