[asterisk-speech-rec] Grammar Question CRM:00176290
Stephen Keller
StephenKeller at LumenVox.com
Thu Apr 22 11:33:01 CDT 2010
Adam nailed it.
I should also be very clear that there is no way (as far as I know) to use DTMF grammars with Asterisk. You can certainly load them but they will not be used. Asterisk processes DTMF itself and doesn't send anything about DTMF input to the speech recognizer, which is what uses the grammars. Asterisk itself has no real knowledge of grammars, and applications like SpeechLoadGrammar are basically just straight passthroughs to the recognizer.
As an aside, I am not getting any of Kevin Bednar's messages (and have so am always replying to Adam's replies). I will have to check with our network admins to see if our spam filter is killing some of these messages, but if anyone has something they really want me personally to see please feel free to e-mail it directly to me (stephen at lumenvox).
Thanks,
Stephen Keller
Project Manager
LumenVox
P: 1-877-977-0707 - just say, "Support"
P: +1-858-707-7700
F: +1-858-707-7072
support at LumenVox.com
www.LumenVox.com
-----Original Message-----
From: asterisk-speech-rec-bounces at lists.digium.com [mailto:asterisk-speech-rec-bounces at lists.digium.com] On Behalf Of Adam Robins
Sent: Thursday, April 22, 2010 5:55 AM
To: Use of speech recognition in Asterisk
Subject: Re: [asterisk-speech-rec] Grammar Question
That is what the
exten => s,1,Set(SPEECH_DTMF_MAXLEN=1)
is for. It will proceed after the specified maximum input length.
-----Original Message-----
From: asterisk-speech-rec-bounces at lists.digium.com [mailto:asterisk-speech-rec-bounces at lists.digium.com] On Behalf Of Kevin Bednar
Sent: Wednesday, April 21, 2010 7:37 PM
To: Use of speech recognition in Asterisk
Subject: Re: [asterisk-speech-rec] Grammar Question
Stephen,
Is there a way to have a grammar stop accepting further input and
return immediately after X number of characters? Like using the digits
grammar and making it return right away after 4 digits instead of
waiting for the timeout value? Thanks.
Kevin
Stephen Keller wrote:
>> The speech engine does not handle DTMF, Asterisk does that. The following code handles yes/no both verbally and DTMF:
>>
>
> Actually, a better way to do this is to just build your grammar such that it returns a number, that way you can handle both cases with the same logic in the dialplan.
>
> So let's say you used the following yes/no grammar:
>
> root $yesno;
> $yesno = ($yes | $no) {out=rules.latest()};
> $yes = (yes [please] | yeah | yup) {out="1"};
> $no = (no [thanks] | nope) {out="2"};
>
> Assuming your prompt says "Say 'yes' or press 1, or say 'no' and press 2" then the dialplan can be:
>
> exten => s,1,Set(SPEECH_DTMF_MAXLEN=1) ; Set max # DTMF digits to accept per transaction
> exten => s,n,SpeechCreate
> exten => s,n,SpeechLoadGrammar(yesno,pathtoyesnogrammar)
> exten => s,n,SpeechActivateGrammar(yesno)
> exten => s,n,SpeechBackground(is-this-john-smith|5) ; Ask your question and wait 5 sec for reply
> exten => s,n,SpeechDeactivateGrammar(yesno)
> exten => s,n,GotoIf($["${SPEECH_TEXT(0)}" = "0"]?oper) ; caller pressed "0" - go to Operator handler (not shown)
> exten => s,n,GotoIf($["${SPEECH_TEXT(0)}" = "1"]?score) ; caller pressed "1" or said "yes"
> exten => s,n,GotoIf($["${SPEECH_TEXT(0)}" = "2"]?score) ; caller pressed "2" or said "no"
> exten => s,n,Goto(invalid) ; unexpected response - go to retry logic (not shown)
> exten => s,n(score),GotoIf($[${SPEECH_SCORE(0)} > 650]?proceed) ; if speech engine was 65+% confident then accept response (not shown)
> exten => s,n,Goto(nocomp) ; confidence too low - go to "didn't understand" logic (not shown)
>
> Obviously both cases will work, but it can be a good idea to always get in the habit of normalizing your speech and DTMF outputs, such that you don't need to know which was used.
>
> Thanks,
>
> Stephen Keller
> Project Manager
> LumenVox
> P: 1-877-977-0707 - just say, "Support"
> P: +1-858-707-7700
> F: +1-858-707-7072
> support at LumenVox.com
> www.LumenVox.com
>
>
>
>
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
asterisk-speech-rec mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-speech-rec
The information contained in this transmission may contain privileged and confidential information. It is intended only for the use of the person(s) named above. If you are not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
asterisk-speech-rec mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-speech-rec
More information about the asterisk-speech-rec
mailing list