Skip to main content

Need Help Using Spok Knowledge? 

Spok

Adding Phrases to the Smart Suite VOCAB Table

Overview

Adding phrases to the Smart Suite atms.vocab table.

Resolution/Topic

If you have not read the article on the VOCAB table or are not familiar with the VOCAB table, it is suggested you read that first.

Basic Overview

Since the Smart Suite VRU can PLAY or SPEAK based on however its initialization files are configured, some items are regular files on the server (~amcom/vru/prompts) which are "played" and some are "spoken" out of the amcom.vox file based on the phrase defined.  There are certain menu sections in the VRU for status, for example, where one menu might PLAY the .prp file on the server and the other will SPEAK it out of the amcom.vox file (play from the amcom.vox file the section defined as the given PHRASE).

All PHRASEs have to be inserted one by one with a defined file loaded on to the server.  A status of "In Hospital On Page" would originally come from a file such as STATUS_2.PRP.  If the value of the STATUS_TEXT is changed in the Smart Suite ATMS.STATUS_CODE table to "In Hospital Available On Pager", one menu will PLAY the STATUS_2.PRP (which was probably only recorded as "In Hospital On Pager" and doesn't match the new value of STATUS_TEXT) while the other menu will SPEAK the value given and find its closest match in the ATMS.VOCAB table.  If there is no "On Pager" PHRASE in the VOCAB table but there is an "On Page" PHRASE in the VOCAB table, then this would try to SPEAK four different PHRASEs from the VOCAB table (the same way SmartSpeech will try to play whatever wav files it can to match what the defined text is): "In Hospital", "Available", "On Page", and "R" (for this reason, "On Pager" was added as a VOCAB item around version 3.8).  Because there is an "On Pager" PHRASE, it would actually speak the three sections "In Hospital", "Available", and "On Pager".  Since these are different "sentences", it will also sound like it's three different sentences!  If the speaking of this PHRASE is to be seamless, a new recording would have to be made and loaded into the VOCAB table with the PHRASE matching the value of the STATUS_CODE.STATUS_TEXT column.

Inserting Values

The way to add the new prompts you've been given (.prp files) into the amcom.vox file (and the corresponding name and location in the VOCAB table) is with the vocbuild executable in ~amcom/bin on the VRU server (vocbuild is a compiled binary, not a script).

First make a copy of the ~amcom/vru/speak/amcom.vox file in case something goes wrong.  It would also not be a bad idea to create a copy of the ATMS.VOCAB table.  If the site has more than one VRU server, you only have to do changes once (since there's only one database) and then copy the amcom.vox file to the second server once you're done.

Next, as amcom, go to the ~amcom/vru/speak folder.  The "vocbuild" program needs to be run in whatever folder the vox file is in or else it won't load the data.  The syntax for the vocbuild executable is vocbuild -u <database login> -v <explicit file path> -s "<phrase>" [-f <0 or 1> -X <debug level>] (the default value for "f" is 0, and this refers to the amcom.vox file, while 1 is site.vox.  Neither the f nor X flags need to be defined for this to work).  Since vocbuild is in /home/amcom/bin, it should be executable from the command line, as /home/amcom/bin should be in your $PATH.

If you were to load a new STATUS_2.PRP with the recorded text of "In Hospital Available On Pager", and the value of STATUS_CODE.STATUS_TEXT for status 2 was "IN HOSPITAL, AVAILABLE - ON PAGER" you would do:

vocbuild -u $(get_connect atms vru.set) -v ~amcom/vru/prompts/STATUS_2.PRP -s "IN HOSPITAL, AVAILABLE - ON PAGER"

so that the value of ATMS.VOCAB.PHRASE matches the value of ATMS.STATUS_CODE.STATUS_TEXT (otherwise it will try to find the closest word-by-phrase match).  If you had 10 prompts to re-load for a customer's statuses you could easily script it or write it out in a text file for copy and paste.

user=$(get_connect atms vru.set)

vrdir=/home/amcom/vru/prompts

cd /home/amcom/vru/speak

file=STATUS_4.PRP

text="IN HOSPITAL MESSAGES BEING STORED"

vocbuild -u $user -v $vrdir/$file -s "$text"

Wrap Up

Since this can be time consuming both in recording the prompts, loading the prompts, inserting the prompts into VOCAB, and testing the new changes via VRU (which can be done through any number of ways to access menus), the changing of STATUS_TEXT values that are not already in the VOCAB table for customers with VRU is typically a billable request.  Changing the default text for status 2 from "In Hospital On Page" to "On Pager" is ok, since "On Pager" already exists in VOCAB.  This is another reason it is very important to save prompts (most files, really, but prompts in the case of this article) when upgrading a customer.  If the new server has the default amcom.vox and the old server is shut down without these files, the above steps have to be taken to re-add the prompts (in this case, that would be free, although it should have been caught during the upgrade process and before the sign-off).

Once you're done with the VOCAB changes, if you forget to copy the amcom.vox to the other servers running VRU (if a site has four servers running VRU), it's easy to see how one VRU line might "speak" different values than another VRU line on a different server.

The above example is simply for statuses (which is the bulk of VOCAB changes), but other PHRASEs can be added / changed the same way.

Related Defects:

N/A

 


KB28084