UCCX script editor get digits

Working with the UCCX Script Editor

When working with the Cisco UCCX Script Editor tool, there are several configurable steps available to users, allowing scripts to be configured to control overall call flow, including IVR functionality with ASR and TTS resources.

We have discovered that some of these predefined scripting steps do not work well with LumenVox and some other ASR providers, so this article is aimed at users attempting to implement this type of functionality within their scripts.

Specifically, what is described in this article are alternate steps that can be used to provide you with the same functionality intended when performing the "Get Digits" steps. This method works well with the LumenVox ASR and should be very easy to utilize.



Get Digits

To get a digit string using either DTMF or voice recognition when using the Script Editor, you can use the "Generic Recognition" Step as shown below.

First, you will need two grammars (one for DTMF and another for voice).

DTMF Grammar

The DTMF grammar containing the following text should be created and saved to some convenient temporary location with the filename “SimpleDigitsDTMF.grxml

<?xml version="1.0" encoding="UTF-8" ?>
<grammar xml:lang="en-US"
root="rootrule"
mode="dtmf"
tag-format="semantics/1.0.2006">

<rule id="rootrule">
<one-of>
<item><ruleref uri="builtin:dtmf/digits"/></item>
</one-of>
<tag>out.digits = rules.latest();out.dtmf = 0;</tag>
</rule>
</grammar>

Voice Grammar

The voice grammar containing the following text should be created and saved to some convenient temporary location with the filename “SimpleDigitsVoice.grxml

<?xml version="1.0" encoding="UTF-8" ?>
<grammar xml:lang="en-US"
root="rootrule"
mode="voice"
tag-format="semantics/1.0.2006">

<rule id="rootrule">
<one-of>
<item><ruleref uri="builtin:grammar/digits"/></item>
</one-of>
<tag>out.digits = rules.latest();out.dtmf = 0;</tag>
</rule>
</grammar>

Upload the Grammars

These two grammars should be uploaded to UCCX, into the en_US folder.  For other languages, modify the xml:lang tag in the grammars and upload to corresponding language folder.

To upload the grammars, 

  • Go to to the UCCX Administrator.
  • Go to Applications->Grammar Management
  • Go to the en_US folder (or other language as needed)
  • Click Upload Grammars
  • Click Browse in the grammar upload pop-up.
  • Find the grammar files on your computer.
  • Click Upload
  • Repeat for second grammar.









UCCX Script Editor

Create a new script in the Editor, or modify an existing.

Add Grammar Parameter Variables


In your script, add two Grammar variables (named DigitsGrammarDTMFand DigitsGrammarVoice) as shown here, making sure theyare defined as Parameter variables:



Add a Generic Recognition Step

On the General tab, enter a string into the Result Name. This can be anything, but you’ll need to use that value for a later step. In this example, we've used ASRResult, which you will see referenced later

On the Prompt tab, enter a prompt variable. This is the audio that will be played to a caller to request they enter digits. The exact phrasing of this prompt will be dependent on the nature of your application


On the Filter tab, you need to enter both grammar variableswith a || (logic OR) between them (to activate both grammars simultaneously), as shown here:

In the “Successful” branch of the Generic Recognition step,add a "Get Recognition Interpretation" step.

In the "Get Recognition Interpretation" step, add a Slot with the slot name "digits" (case sensitive).   For the variable, choose the string variable you would like the digits to be placed in. In the example here, we've used the variable name Digits.

Finally, when setting up the application in UCCX, make sure to fill in the two grammar parameters for the application script to associate them with the grammar files that were uploaded above.


Example

The attachment below contains an example of the Get Digits implementation, as described above in (*.aef) script format that can be loaded directly into your Cisco UCCE Script Editor, along with both voice and DTMF grammars that can be uploaded to your UCCX.

See here for an example of how to install and run scripts in UCCX.  Install UCCX HelloWorld Script

Attachments


GetDigitsCodeSample.zip5.8 KbDownload File

Was this article helpful?
Copyright (C) 2001-2024, Ai Software, LLC d/b/a LumenVox