Modifying prompt table for IVR applications

Introduction

When creating an IVR system using Dialogic® Natural Access (NA), the prompt builder tool uses the rules contained in american.tbl, the compiled rules table for standard US English, to build a list of message numbers that can be sent directly to the vcePlayList to say dates, times, numbers, and dollar amounts. 

The default setting for dates uses MM/DD, MM/DD/YY, or MM/DD/YYYY format. However, many countries use different formats to represent a date. For example, the Canadian official format for date is yyyy/mm/dd. In order to use a date format other than the US standard, you will need to change the SAYDATE function in the american.ptx file, the source rule file, to reflect the appropriate date format. 

You will then need to recompile the edited american.ptx file into the american.tbl rules file, as shown in the example below.

Example: Changing the date format to read dates as YYYY/MM/DD

The american.ptx file defines the date format as MM/DD/YYYY in the SAYDATE function as follows:

;find the slash character, pass prev 2 chars to month decode
FIND FORWARD 1 "/" LEFT 2 EXCLUDE FOUND CALL MONTH

;find the slash character, pass following 2 chars to day decode
FIND FORWARD 1 "/" RIGHT 2 EXCLUDE FOUND CALL DAY

;find a second slash, if found, pass next to digits for year
FIND FORWARD 2 "/" RIGHT 4 EXCLUDE FOUND GOTO YEAR ELSE EXIT
;all done

To change the date format to YYYY/MM/DD, you need to change SAYDATE as follows:

;find the slash character, pass prev 4 chars to digits for year
FIND FORWARD 1 "/" LEFT 4 EXCLUDE FOUND CALL YEAR

;find the slash character, pass following 2 chars to month decode
FIND FORWARD 1 "/" RIGHT 2 EXCLUDE FOUND CALL MONTH

;find the slash character, pass following 2 chars to day decode
FIND FORWARD 2 "/" RIGHT 2 EXCLUDE FOUND GOTO DAY ELSE EXIT
; all done

 

Once the modifications are made to the .ptx file, you will need to use the utility mkprompt to compile the rule text file (.ptx) into prompt rules table (.tbl) as follows:
mkprompt source[.ptx] [dest[.tbl]]

where:

  • source[.ptx] is the source text file to be compiled. If no extension is specified, .ptx is assumed

  • [dest[.tbl]] is the optional output file name. If no output file is specified, the source file name is used with the .tbl extension. If no extension is specified, .tbl is assumed.

For example, you can compile your modified american.ptx into prompt rule table (american.ptx) as follows:

mkprompt american.ptx

 

and it will generate the compiled rule table, american.tbl.

You may also re-record the american.vox file, which is the default voice message library for the standard American prompts, to change the voice that speaks the prompts. This file is opened and specified in vcePlayList in conjunction with the message list output of vceBuildPromptList. 

Note that you need to have american.vox and american.tbl in the same folder for the voice file to use the newly generated .tbl file. 

Testing Your Edited Prompt Rules

You can test your modified prompt rules table with the utility testpmpt . This utility allows you to test new prompt rules without having to pre-record the actual voice messages. When this utility is executed, the rules table (i.e., america.tbl) and the voice file (i.e., american.vox) are loaded. Then, you are prompted to enter a text string that the prompt builder will process. For example, if you use the date format for Canada and entered 2008/3/11, the prompt builder would return the following:

c:>\testpmpt -p american Natural Access Test Prompt Utility V 1.2 (Dec 11 1997) Prompt table = american.tbl Prompt text from american.vox Enter text: 2008/3/11 two thousand eight March eleventh

 

Return to Documentation Home I Return to Sangoma Support