UCCX Script Editor Get Digits
The Cisco UCCX Script Editor offers many configurable steps for controlling call flow, including IVR functionality that uses ASR and TTS. Some of the predefined scripting steps do not work well with Capacity Private Cloud (or with some other ASR providers). This article describes an alternate approach that delivers the same Get Digits functionality and works reliably with the platform's ASR.
Create the Grammars
To collect a digit string using either DTMF or voice recognition in the Script Editor, use the Generic Recognition step. First, you need two grammars — one for DTMF and one for voice.
DTMF Grammar
Create the following grammar and save it to a convenient temporary location as 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
Create the following grammar and save it as 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
Upload both grammars to UCCX, into the en_US folder. For other languages, modify the xml:lang tag in the grammars and upload to the corresponding language folder.
- Go to the UCCX Administrator.
- Open Applications > Grammar Management.
- Open the en_US folder (or other language as needed).
- Click Upload Grammars.
- Click Browse in the grammar upload pop-up.
- Find the grammar file on your computer.
- Click Upload.
- Repeat for the second grammar.
Build the Script
Create a new script in the UCCX Script Editor, or modify an existing one.
Add the Grammar Parameter Variables
Add two Grammar variables, named DigitsGrammarDTMF and DigitsGrammarVoice, making sure they are defined as Parameter variables:
Add a Generic Recognition Step
On the General tab, enter a string in Result Name. This can be anything, but you will reference it in a later step. This example uses ASRResult.
On the Prompt tab, enter a prompt variable — the audio played to the caller to request the digits. The exact wording depends on your application.
On the Filter tab, enter both grammar variables with a || (logical OR) between them, to activate both grammars simultaneously:
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 want the digits placed in — this example uses Digits.
Set the Application Grammar Parameters
Finally, when setting up the application in UCCX, fill in the two grammar parameters so the script associates them with the grammar files uploaded earlier.
Example
The attachment below contains an example Get Digits implementation in .aef script format that can be loaded directly into your Cisco UCCX Script Editor, along with both the voice and DTMF grammars to upload to UCCX.
For an example of how to install and run scripts in UCCX, see UCCX Simple Integration Test.
| File | Size | Download |
|---|---|---|
| GetDigitsCodeSample.zip | 5.8 KB | Download file |
Related Articles
- Cisco UCCX — ASR/TTS integration setup for UCCX.
- UCCX Script Editor: Confirmation
- UCCX Simple Integration Test
