[asterisk-speech-rec] Grammar Question
Adam Robins
arobins at PharmaCentra.com
Wed Apr 21 07:52:14 CDT 2010
The speech engine does not handle DTMF, Asterisk does that. The following code handles yes/no both verbally and DTMF:
Asterisk extensions.conf:
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|/opt/lumenvox/engine/Lang/BuiltinGrammars/ABNFBoolean.gram)
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)}" = "true"]?score) ; speech engine detected "yes"
exten => s,n,GotoIf($["${SPEECH_TEXT(0)}" = "1"]?score) ; caller pressed "1"
exten => s,n,GotoIf($["${SPEECH_TEXT(0)}" = "false"]?score) ; speech engine detected "no"
exten => s,n,GotoIf($["${SPEECH_TEXT(0)}" = "2"]?score) ; caller pressed "2"
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)
This should get you started.
-----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: Tuesday, April 20, 2010 4:43 PM
To: asterisk-speech-rec at lists.digium.com
Subject: [asterisk-speech-rec] Grammar Question
Hey all,
Just started working with the Lumenvox ASR on asterisk and it's very
cool. However, I'm having some trouble with grammars. I have a test app
that I can use the digits grammar to enter a number and a yes/no grammar
to confirm things. Since the digits grammar will also accept input from
dtmf and give you that number I would also like to have the yesno
grammar accept dtmf (like 1 for yes or 2 for no) and output the yes or
no from that as well. Does anyone have a yes/no grammar setup to do
that? Or can you point me to where one might be? I've looked around and
there are plenty of basic yes/no grammar examples but I can't find any
that will accept dtmf as well and still output just the yes or no. TIA
to all.
Kevin
--
_____________________________________________________________________
-- 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.
More information about the asterisk-speech-rec
mailing list