[asterisk-speech-rec] 16 digits Card # recognition

Stephen Keller StephenKeller at LumenVox.com
Thu Jul 5 10:20:19 CDT 2007


Saud,

There are a couple of ways you could do this. You could of course just
check the length of the output in your AGI app, but if you want to do
this within a grammar you just need to add a little bit of SISR
(basically JavaScript).

If you want to see some more about working with SISR, I recommend you
watch our video series on the subject at
http://lv-intranet/support/videos/semantic/vid01_summary.aspx

Here is a version of the digits grammar I threw together that should do
what you want. If it sees fewer than 16 digits, it returns "low" as the
semantic interpretation. Likewise it returns "high" if it sees more than
16.

#ABNF 1.0 UTF-8;
language en-US;
mode voice;
tag-format <lumenvox/1.0>;

root $Digits;

{var i=0};

$Digit = (ONE:"1"        |
          TWO:"2"        |
          THREE:"3"      |
          FOUR:"4"       |
          FIVE:"5"       |
          SIX:"6"        |
          SEVEN:"7"      |
          EIGHT:"8"      |
          NINE:"9"       |
          (ZERO | O):"0" );

$count = {$=''} ($Digit {$+=$$} {i+=1})<1-> 
{!{
    if (i > 16) {$='high'}
    else if (i < 16) {$='low'}
}!};

$Digits = $count {$ = $$};



Stephen Keller
LumenVox Support
P: 877-977-0707, just say "Support"
F: 858-707-7072
Support at LumenVox.com
www.LumenVox.com



Winner "Best Innovation in Speech Recognition"
AVIOS SpeechTEK Award

 


> -----Original Message-----
> From: asterisk-speech-rec-bounces at lists.digium.com 
> [mailto:asterisk-speech-rec-bounces at lists.digium.com] On 
> Behalf Of Syed Saud Shah
> Sent: Wednesday, July 04, 2007 10:32 AM
> To: asterisk-speech-rec at lists.digium.com
> Subject: [asterisk-speech-rec] 16 digits Card # recognition
> 
> Guys,
> 
> I'm willing to develop an IVR using AGI which will recognize 
> the Voice input from our cardholders. The basic functionality 
> has been done but still need some suggestion, recommendation 
> to recognize the 16 digits card number, what I want is:
> 
> 1. Since I'm using en-US mode to make the system able to 
> recognize only digits from the caller, so my question is how 
> can stick the digit's grammar on 16 digits, like if less than 
> 16, play some invalid message and same if goes above 16?
> 
> Here is my current digits grammar:
> 
> #ABNF 1.0 UTF-8;
> language en-US;
> mode voice;
> tag-format <lumenvox/1.0>;
> 
> root $Digits;
> 
> $Digit = (ONE:"1"        |
>           TWO:"2"        |
>           THREE:"3"      |
>           FOUR:"4"       |
>           FIVE:"5"       |
>           SIX:"6"        |
>           SEVEN:"7"      |
>           EIGHT:"8"      |
>           NINE:"9"       |
>           (ZERO | O):"0" );
> 
> $Digits = {$=''} ($Digit {$+=$$})<1->;
> 
> 
> I'd appreciate if anyone gives me some examples and hints or 
> any other optimal way for what I want.
> 
> Thanks,
> Saud Shah
> www.i2cinc.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
> 



More information about the asterisk-speech-rec mailing list