[asterisk-users] AGI: blocking script until playback complete

Danny Nicholas danny at debsinc.com
Wed Feb 22 09:38:16 CST 2012


I work with the 1.4 and 10.0 branches and do mainly PERL AGI's.  In my
testing the GET DATA hasn't worked very reliably.  Just for grins, I copied
test-agi.agi to get-dig.agi and made these changes on my 10.0.1 box
49,50c49,50
< my $result = <STDIN>;
< &checkresult($result);
---
> my $result2 = <STDIN>;
> &checkresult($result2);
52,55c52,56
< print STDERR "3.  Testing 'sendimage'...";
< print "SEND IMAGE asterisk-image\n";
< my $result = <STDIN>;
< &checkresult($result);
---
> print STDERR "3.  Testing 'get digit'...";
> print "GET DATA vm-password 5000 6\n";
> my $result3 = <STDIN>;
> my $result3a=$result3;
> &checkresult($result3);
58,60c59,61
< print "SAY NUMBER 192837465 \"\"\n";
< my $result = <STDIN>;
< &checkresult($result);
---
> print "SAY NUMBER $result3a \"\"\n";
> my $result4 = <STDIN>;
> &checkresult($result4);
64,65c65,66
< my $result = <STDIN>;
< &checkresult($result);
---
> my $result5 = <STDIN>;
> &checkresult($result5);
69,70c70,71
< my $result = <STDIN>;
< &checkresult($result);
---
> my $result6 = <STDIN>;
> &checkresult($result6);
72c73
< print STDERR "6a.  Testing 'record' playback...";
---
> print STDERR "7.  Testing 'record' playback...";
74,75c75,76
< my $result = <STDIN>;
< &checkresult($result);
---
> my $result7 = <STDIN>;
> &checkresult($result7);

And added this dialplan snippet
exten => 1300,1,answer()
exten => 1300,n,AGI(get-dig.agi)
exten => 1300,n,playback(vm-goodbye,noanswer)
exten => 1300,n,hangup()

The result - vm-password is played and it waits 5 seconds as you might
expect.  BUT - whether or not I enter anything, the playback is always 200.
So, in my opinion, you would be better off using the dialplan and two agi's
if you need DTMF input between.

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Chris Bagnall
Sent: Wednesday, February 22, 2012 9:14 AM
To: asterisk-users at lists.digium.com
Subject: Re: [asterisk-users] AGI: blocking script until playback complete

On 22/2/12 2:55 pm, Danny Nicholas wrote:
> You don't state the Asterisk version you are running, but personal 
> experience tells me you'd better invest in some Rogaine if you're 
> depending on the built-in stuff from AGI for DTMF input.  I have 
> personally wasted weeks trying it.

Sorry, should have said, latest 1.4 release.

Care to elaborate a little on the issues you found when you tried it?

Kind regards,

Chris
--
This email is made from 100% recycled electrons

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to
Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users




More information about the asterisk-users mailing list