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

Quinn Weaver quinn at fairpath.com
Mon Jan 25 17:33:23 CST 2010


On Mon, Jan 25, 2010 at 2:56 PM, Danny Nicholas <danny at debsinc.com> wrote:
> 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;
>        }
>     ...
>     }

If we did that, we'd be replaying $path from the beginning every time
the user said something that didn't match the grammar.  For a podcast
episode like a radio show, that's bad—you don't want to be 30 seconds
or two minutes into the content and have to start over.

Also, as I said, it's always matching one of the rules in our
grammar--even if I literally say "goobledegook."  So it's unclear how
we'd implement $response_good.

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



More information about the asterisk-users mailing list