[VoIP] Speech recognition demo
John R. Covert
john_reads_cnet_via_archives at covert.org
Tue Oct 17 13:45:44 CDT 2006
I'm currently running the following demo on a lab machine at the
Asterisk Boot Camp, and may or may not continue to run it on my
own machine when I get home.
Dial CNET 1 263-1111.
You should hear "Number please".
Distinctly speak a CNET number, including country code.
If you hear "What number are you wanting, please", try again.
If you hear your digits read back, it will attempt a CNET ENUM lookup
and if possible, connect you.
The way someone might use this to support an antique phone with no
dial would be to put the phone on an ATA set to off-hook dial a fixed
number in the local asterisk instance that does what this demo does.
Please play with it a little bit over the next few days. I may have
the machine down briefly a few times to install hardware as part of
the boot camp, but I'll try to keep it running most of the time and
all night until noon Friday. I might bring it up again at home next
week, or some of you may want to try it yourselves.
Here's the code:
[cnetdemo]
exten => s,1,Wait(1)
exten => s,n,Answer()
exten => s,n,Wait(1)
exten => s,n(num),Playback(numplse)
exten => s,n(asr),ASR(l2d6-)
exten => s,n,Playback(numwant)
exten => s,n,Goto(asr)
;
exten => _digits.,1,SayDigits(${EXTEN:6})
exten => _digits.,n,Goto(cnetgatelookup,${EXTEN:6},1)
[cnetgatelookup]
exten => _X.,1,Set(result=${ENUMLOOKUP(+${EXTEN},iax2,,std.ckts.info)})
exten => _X.,n,GotoIf($["${result}"!=""]?dialiax)
exten => _X.,n,Set(result=${ENUMLOOKUP(+${EXTEN},sip,,std.ckts.info)})
exten => _X.,n,GotoIf($["${result}"!=""]?dialsip)
exten => _X.,n,Playback(enum-lookup-failed)
exten => _X.,n,Goto(cnetdemo,s,num)
exten => _X.,n(dialsip),Dial(SIP/${result},120)
exten => _X.,n,Macro(fastbusy)
exten => _X.,n(dialiax),Dial(IAX2/${result},120)
exten => _X.,n,Macro(fastbusy)
For the ASR function, Google for "asterisk cmd ASR" (no quotes).
Use is free until the end of 2006, and then the guy thinks he's
going to charge 5 Euro cents (currently about 6 cents US) for
each successful recognition. Hah!
There's another speech recognition package coming for Asterisk
1.4, but it also requires purchase of a license. I don't have
the details at the moment.
/john
More information about the VoIP
mailing list