[asterisk-users] How to make SpeechBackground keepplayingifutterance doesn't match our grammar

Danny Nicholas danny at debsinc.com
Mon Jan 25 16:56:25 CST 2010


Since you're "Perling" it, why not just put the $sb_retval in a while loop
like this:

- my $response_good=0;
- my $sb_retval=undef;
- while (! $response_good) {
-    my $tmp_retval = $c->agi->exec('SpeechBackground', $path);
-    if ($tmp_retval eq 'play_next') {
        $sb_retval=$tmp_retval;
        $response_good=1;
        }
     ...
     }
--
     

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Quinn Weaver
Sent: Monday, January 25, 2010 4:45 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] How to make SpeechBackground
keepplayingifutterance doesn't match our grammar

On Mon, Jan 25, 2010 at 2:07 PM, Danny Nicholas <danny at debsinc.com> wrote:
> What does your dialplan snippet to run this look like?

It's part of a Perl FastAGI, running on a separate box from Asterisk.
The Perl code is using Asterisk::AGI's exec() method to call
SpeechBackground:

my $sb_retval = $c->agi->exec('SpeechBackground', $path);

where $path specifies a .sln file on the remote (Asterisk) host.

Here's the dialplan snippet for invoking the FastAGI.  Some notes:

- 127.0.0.1:4575 is an ssh tunnel to my box, where I'm doing the
development.  I know this works; I hear sound, DTMF works, speech
recognition occurs, et cetera.

- While my dialplan does Answer() and Hangup(), my Perl program does
it as well.  Doesn't seem to cause a problem.

- The extension name, XXXXXXXXXX was my client's  actual phone number,
so I X'ed it out.

[inbound]
exten => XXXXXXXXXX,s,Answer()
exten => XXXXXXXXXX,1,Background(demo-congrats)
exten => XXXXXXXXXX,n,Hangup()
...
exten => 3,1,Goto(quinn-tunnel-test,1,1)
exten => 3,n,Hangup()

[quinn-tunnel-test]
exten => 1,1,Answer()
exten => 1,n,AGI(agi://127.0.0.1:4575/Entry/entry?)
exten => 1,n,Hangup()

-- 
Quinn Weaver Consulting, LLC
Full-stack web design and development
http://quinnweaver.com/
510-520-5217

-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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