Asterisk Voice Recognition Company Directory

Along with requests for the Asterisk Voice Recognition “Magic Button”, I have had numerous requests over the last couple days for the Asterisk Voice Recognition Company Directory (AVRCD). As promised before, I am releasing the source for the company directory. Drop to the bottom for links to a demo and all the source files for the Company Directory or keep reading for details.

This isn’t your Daddy’s company directory. My goal in this project was to not only create a voice-enabled company directory for Asterisk, but to also extend the functionality of the company directory in the process. It took over 200 hours and utilizes some of the most advanced web-based technology available for an interactive interface.

The AVRCD is tree-based with advanced web-based drag-and-drop technology that lets you drag the extensions you want in the company directory to a custom tree that you create. You can create sales, customer service, marketing, accounting, and whatever other “department” folders you want and have employees specifically in that department folder. When navigating the tree through voice commands, you could for example, say “support”, then “Ethan Schroeder” and be connected to me. You can configure each extension to playback confirmations by either pointing an extension to the user’s voicemail name recording or system recording. If there is no audio file selected as a confirmation, the system falls back on text-to-speech using Flite.

The AVRCD also has custom entries support. These could be entries for ring groups, off site IAX or SIP users that don’t have an extension on the main PBX, etc. You can then drag these custom extensions to the tree, just as the built in extensions. These custom extensions also support custom dial strings, so if you do have a remote PBX, you can have it dial that person over
the IAX trunk through the custom dial string.

The company directory, once setup, automatically configures itself to your existing PBX users. All you have to do is drag them to where you want them, and you can drag the same person to multiple directory folders. It sets up “pronunciations” for you based on their names. These pronunciations are editable by you on a per-extension and per-tree-item basis. So if you
are getting complaints that “Michael Smith” is getting calls to “Michelle Smith”, you can phonetically help the speech engine by writing custom pronunciations for each name. For example, “Mishell Smith” and “Mikall Smith”.

Now, all of this said, the company directory is definitely in beta form. It’s using cutting edge javascript/ajax/ui libraries, and I’m going to be honest with you, I hadn’t worked in client-side application development for years and never OO Javascript, though I was once a Java developer. I just squashed some of the last UI bugs I could find, but there may be more. In addition, it doesn’t support voice error handling. This basically means that it isn’t threshold aware on the voice recognition level, meaning that if the application “isn’t quite sure” what was spoken, it’s probably going to make a choice anyway. Ideally, this is handled by determining threshold acceptability levels and if a recognized pattern is below that threshold it will prompt with options. But it’s free, so you are encouraged to use it as you see fit.

I’m too busy working on material for the Open Telephony Training Seminar to setup an entire demonstration PBX for everyone to try it out, but I have posted a live demo of the interface. All the source is here, which includes PHP, Javascript, dial plans, and AGI. You’ll need to setup and install LumenVox and Flite. Lumenvox has a Linux/Asterisk developer version available for around $50, or you could attend the Training at the end of February to get a free LumenVox license and the Asterisk Voice Recognition “Magic Button”.

Lastly, as with the Asterisk Voice Recognition “Magic Button”, this project deserves to be a FreePBX modular for integration more tightly coupled with configuration of extensions. In addition, this is a voice only directory. There is no support for dtmf entry for “the first three letters of the first or last name”. This functionality is definitely on the todo list, but won’t be useful to accomplish until the FreePBX integration occurs. FreePBX needs your support to make things like this a reality, so consider attending the training at the end of the month. The training is going to reach capacity, so hurry up and register. If you miss this one, stay tuned for announcements in the coming month on subsequent training.



Thanks for the great work

Here are the few issues that I faced while using the system

  1. The directory is not confirming if that is the user if they want to reach;
  2. Is not checking the lumenvox’s Speech Score to see what it thinks about the speech input.

The voice from Flite sounded too robotic; We are currently using Cepstral’s Allison (Allison Donated the Speech to the Digium which we use everyday!!)


; The confirmation macro will be used when the application receives input
; that has a middling confidence score. It will ask the user to confirm
; what he or she said. To do this, there are three prompts:
; confirm990.gsm, confirm991.gsm, and confirm992.gsm. The macro knows
; which to play based on the CONFIRMPROMPT variable, which is a string
; with the filname in it, made by combining the word “confirm” with
; the recognized extension.
exten => s,1,SpeechLoadGrammar(yesno|/etc/asterisk/grammars/yesno.gram)
exten => s,n,Verbose(Confirm if YES or No (${ARG1}))
exten => s,n,SpeechActivateGrammar(yesno)
exten => s,n,Set(CONFIRMPROMPT=$[confirm ${ARG1}])
exten => s,n,Swift(did you say!)
exten => s,n,Swift(${ARG1})
exten => s,n(PlayConfirm),SpeechBackground(${CONFIRMPROMPT}|5)
exten => s,n,GotoIf($[ ${SPEECH(results)} > 0]?Deactivate)
exten => s,n,Playback(NI)
exten => s,n,Goto(PlayConfirm)
exten => s,n(Deactivate),SpeechDeactivateGrammar(yesno)

;Entry of directory
exten => s,1,Answer
exten => s,2,Wait(1)
exten => s,3,Goto(dial-by-name,s,1)

exten => s,1(Enter),SpeechCreate
exten => s,n,SpeechProcessingSound(processing)
exten => s,n,Swift(Welcome to VirtueGroup Speech Recognition System!)
exten => s,n,AGI(company_directory.php)
exten => s,n,SpeechLoadGrammar(${GRAMMAR}|/etc/asterisk/grammars/${GRAMMAR}.gram)
exten => s,n,Verbose(Loaded /etc/asterisk/grammars/${GRAMMAR}.gram)
exten => s,n,SpeechActivateGrammar(${GRAMMAR})
exten => s,n,Verbose(Activated ${GRAMMAR})
exten => s,n,GotoIf($["${DESCRIPTION}" = “”]?Listen:TTSSubDirectory)
exten => s,n(TTSSubDirectory),Swift(${DESCRIPTION})
exten => s,n(Listen),Swift(After the Tone! Please Speak the Name of the Person You Would Like to Reach.)
exten => s,n,SpeechBackground(${PLAYBACK})
exten => s,n,Verbose(Waiting for speech…)
exten => s,n,Set(SPOKEN=${SPEECH_TEXT(0)})
exten => s,n,Verbose(1,The score was ${SPEECH_SCORE(0)})
exten => s,n,GotoIf($[ ${SPEECH_SCORE(0)} < 600]?BadInput)
exten => s,n,GotoIf($[ ${SPEECH_SCORE(0)} > 600]?Confirm)
exten => s,n(Confirm),AGI(company_directory.php)
exten => s,n,Macro(confirm,${DESCRIPTION})
exten => s,n,GotoIf($[ “${SPEECH_TEXT(0)}” = “yes”]?DialIn:TryAgain)
exten => s,n,Set(SPOKEN=${SPEECH_TEXT(0)})
exten => s,n,Verbose(1,The score was ${SPEECH_SCORE(0)})
exten => s,n,GotoIf($[ ${SPEECH_SCORE(0)} < 600]?BadInput)
exten => s,n,GotoIf($[ ${SPEECH_SCORE(0)} > 700]?Confirm)
exten => s,n(Confirm),AGI(company_directory.php)
exten => s,n,Macro(confirm,${DESCRIPTION})
exten => s,n,GotoIf($[ “${SPEECH_TEXT(0)}” = “yes”]?DialIn:TryAgain)
exten => s,n(TryAgain),Playback(please-try-again)
exten => s,n,Goto(Listen)
exten => s,n(BadInput),Playback(im-sorry&please-try-again)
exten => s,n,Goto(Listen)
exten => s,n(DialIn),SpeechDeactivategrammar(${GRAMMAR})
exten => s,n,SpeechDestroy
exten => s,n,GotoIf($["${DIAL}" = “”]?Enter:Playback)
exten => s,n(Playback),GotoIf($["${PLAYBACK}" = “”]?TTSAnnounce:AudioAvailble)
exten => s,n(AudioAvailable),Swift(${PLAYBACK})
exten => s,n,Goto(Announce))
exten => s,n(TTSAnnounce),Playback(auth-thankyou)
exten => s,n,Swift(${CALLERID(name)})
exten => s,n(Announce),Playback(pls-wait-connect-call)
exten => s,n,Macro(user-callerid)
exten => s,n,Dial(${DIAL})

As I said in the post, it did need speech confirmation. Thank you for your contribution. We also use Cepstral and as you said, it is quite an improvement.

After the training I’ll take a deeper look at what you have done and try to integrate it into the source. I also have some new prompts Allison recorded for us that I can integrate.

Ethan Schroeder
Schmooze Communications, LLC

Hi Ethan,

Ive just been taking a look at your work here after finding the link to your magic button on I had been thinking about trying something like this for some time after seeing microsoft’s unified communication server mention this functionality.

I would have loved to attend the conference to get a copy of it, but unfortunately it seems like i’ve found the site too late. I’d like to add to the fanfare im sure youve been hearing to ask if you would consider releasing the code to all of us? I would be more than happy to contribute back in any way I can… changes/improvements/additions, whichever.

Let me (and everyone else reading im sure!) know if we can all share in the fun!

Great work so far as well with the directory, it looks awesome and I cant wait to give it a try.

Take care,
Dayton @ Voxter Communications
Vancouver, BC, Canada

I have successfuly installed the directory… on each step is giving a message done but when i browse the link then there are following errors… i think these are java script…

Line: 120
Char: 242
Error: ‘this.el’ is null or not an object


Javascript errors usually appear in older browsers, so you may need to upgrade.

Hi, thanks for your response, i am using IE-7 with lastest updates and Asterisk 1.2.24.

I’ve installed the sources successfully, I also had lumenvox and flite installed correctly but when I try to opon http://myip/companydirectory in browser nothing shows up except the title ‘Schmooze Company Directory’. Web files are correctly installed in /var/www/html/compnaydirectory and I am using latest firefox and IE versions. Whats wrong?

you may need to edit the php file with your correct mysql password.

If not, I have a new script that does some table creation checks that applies if you have never used the system recordings module and that table therefore doesn’t exist.

Is the new Script posted? Or should I wait until I get the Magic Button working?

Good morning.

it’s ready for frensh recognition?

I really want to appreciate you and want to say you thanks for your great work.

Both the demo and source links don’t work for me.
Is there anybody who could advice me where to find the source code?

Old thread I know but does anyone know what happened with this? Links to the code don’t work. Ethan isn’t with Schmooze anymore.

I’d like to implement the AVRCD.

What ever happened with this company directory. Schmooze had some source code. Anyone still have a copy of it.
Its called Directory Pro and is buch better than the code Ethan released