2014-02-23

This Call Router dial plan application demonstrates one method of asking for names and routing calls to the appropriate extension based on that name. Besides Asterisk PBX, you will also need the LumenVox Speech Engine for Asterisk installed in order to run this voice application.

This voice application is developed using Visual Dialplan for Asterisk and pre-configured to be used with FreePBX or any other Asterisk GUI that includes FreePBX (AsteriskNOW, Elastix, PIAF, trixbox).

The output of the Visual Dialplan is standard Asterisk extensions.conf code and grammar files, automatically deployed and loaded to the Asterisk server. However, you will need to manually place the sound files used in this demo in the /var/lib/asterisk/sounds/ folder.

The first step is to have installed and running three pieces of software:

1. Asterisk PBX

There are several Asterisk GUIs on the market.

We recommend Elastix GUI. Download it here.

Download the Elastix PBX ISO package and follow on screen instructions to install it.

We recommend installation on virtual machine rather than dedicating complete PC for this test.

Besides Asterisk GUI, the ISO will install Linux OS, MySQL database, Asterisk core PBX etc.

2. Visual Dialplan

Visual Dialplan is intuitive and easy to use tool for the dial plan development.

It comes with several ready to use dial plan examples, including several speech enabled dial plan examples.

You can start by trying and modifying one of the samples or you can start with the example we use in this article.

Download Visual Dialplan here: Visual Dialplan download

3. LumenVox automated speech recognizer

The LumenVox automated speech recognizer is a software solution that converts spoken audio into text, providing users with a more efficient means of input. A Speech recognizer compares spoken input to a list of phrases to be recognized, called a grammar. The grammar is used to constrain the search, enabling the recognizer to return the text that represents the best match. This text is then used to drive the next steps of your speech-enabled application.

More details about this software and download options can be found at LumenVox web site.

Contexts description

Call Router context

This is the entry point for the Call Router demo dial plan. Dial plan accept calls coming to DID (extension) 789 and creates a speech port. Then the directory grammar is loaded and SpeechBackground application executed to perform the speech recognition while playing the sayname voice prompt. And last the the grammar is deactivated.

Dial plan checks SPEECH(results) to ensure there was at least one result (i.e. we actually received spoken input).

If not, we play the no input prompt and ask the caller to say something. Now that we know there was input, we save the recognized extension to the variable DIALTHIS and print some log messages to the console. Then dial plan runs a few checks on the confidence score. If it was really low (below 400), we will reject the utterance and ask the user to repeat what was said. If it was between 400 and 700, we launch the confirmation macro, passing the recognized result as the argument. If the user confirms by saying yes, or if the confidence score was above 700, we send the user to the specified extension.



Macro/Subroutine description

CallRouter-confirm macro/subroutine

The confirmation macro is used when the application receives input that has a middling confidence score. The macro will ask the user to confirm what he or she said. There are three prompts used in this case: confirm990.gsm, confirm991.gsm, and confirm992.gsm. The macro knows which one to play based on the CONFIRMPROMPT variable, made by combining the word “confirm” with the recognized extension.

Create Call Router for your own company

If you want to add more employees to Call Router list you will have to change grammar and sound prompts. Grammars are files that contain a list of words and phrases to be recognized. They consist of a list of rules. Each rule contains tokens which will match those rules. A special rule called the root rule exists. It must be matched for the grammar to be matched.

Grammar used in Call Router dial plan:

#ABNF 1.0;

language en-US;

mode voice;

tag-format <semantics/1.0.2006>;

root $company_directory;

$tom = (Tom [Smith]) {out=”990″};

$joe = ((Joe | Joseph) [Jones]) {out=”991″};

$bob = ((Bob | Robert | Bobby) [Johnson]) {out=”992″};

$company_directory = ($tom | $joe | $bob ) {out = rules.latest()};

If you want to add for example Melisa to your Call Router list you will have to change Grammar to look like this (text added in blue):

#ABNF 1.0;

language en-US;

mode voice;

tag-format <semantics/1.0.2006>;

root $company_directory;

$tom = (Tom [Smith]) {out=”990″};

$joe = ((Joe | Joseph) [Jones]) {out=”991″};

$bob = ((Bob | Robert | Bobby) [Johnson]) {out=”992″};

$melisa = ((Melisa [Mel]) {out=”994″};

$company_directory = ($tom | $joe | $bob | $melisa ) {out = rules.latest()};

You will also need to add the sound prompt confirm994.gsm to your Asterisk sound folder.

Show more