- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2018 12:27 AM
I'm newbie ... :)
I have a problem in the example below.
I offer the caller the opportunity to enter a number (length of 6 numbers). Using the get digit string method, I pick up all the numbers and then I would like the entire string to be played back to the caller. I've found various options, including Generated prompt, but the problem is that I would play it in another language (language is not included in cisco uccx), and I have a .wav prompt for every number. So, how can I play all 6 numbers after they finish the entry?
Solved! Go to Solution.
- Labels:
-
Other Contact Center
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2018 01:30 AM
This should not be too tricky.
- Record prompts files for individual digits in the language of your choice.
- Create six prompt variables prompt0 to prompt5 with blank values
- Get your digit string
- Set a counter variable to zero then start a loop
- Set a label "start loop"
- Use a substring command to to get the character in the digit string that matches the counter variable
- Use a switch string step to set the value of the prompt variable which matches the loop counter to the correct recorded file
- Increment the loop counter
- If the counter is less than 6 goto "start loop" otherwise continue
- Create a concatenated prompt using your six prompt values
- Play the concatenated prompt
Hope this makes sense. This will read out the digits entered. E.g. one two two six one one.
If you wanted to play the full number that would be harder - e.g. one hundred and twenty-two thousand six hundred and eleven.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2018 11:01 AM - edited 11-19-2018 11:03 AM
Hi Anthony,
Yes using an array would be more elegant - I have only just started using them.
I have put together a script to do what the OP asked for as shown below.
I have attached the script and files in a zip file - mike let me know if you can download it. The prompts need to sit in a subdirectory /numbers off the default directory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2018 11:50 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2018 01:30 AM
This should not be too tricky.
- Record prompts files for individual digits in the language of your choice.
- Create six prompt variables prompt0 to prompt5 with blank values
- Get your digit string
- Set a counter variable to zero then start a loop
- Set a label "start loop"
- Use a substring command to to get the character in the digit string that matches the counter variable
- Use a switch string step to set the value of the prompt variable which matches the loop counter to the correct recorded file
- Increment the loop counter
- If the counter is less than 6 goto "start loop" otherwise continue
- Create a concatenated prompt using your six prompt values
- Play the concatenated prompt
Hope this makes sense. This will read out the digits entered. E.g. one two two six one one.
If you wanted to play the full number that would be harder - e.g. one hundred and twenty-two thousand six hundred and eleven.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2018 09:46 AM
How would you feel about dropping the loop+switch, in favor of using an Array?
E.g.,
caller_entered_digits = Get Digit String Successful Set digits = caller_entered_digits.split("") Play Prompt (digits[1] + digits[2] + digits[3] + digits[4] + digits[5] + digits[6])
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2018 11:01 AM - edited 11-19-2018 11:03 AM
Hi Anthony,
Yes using an array would be more elegant - I have only just started using them.
I have put together a script to do what the OP asked for as shown below.
I have attached the script and files in a zip file - mike let me know if you can download it. The prompts need to sit in a subdirectory /numbers off the default directory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2018 11:50 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2019 06:23 AM
Good solution, but how would you solve the problem if I have an variable number entered? Once can be 2 characters, once 6 characters ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2019 10:02 AM
Then I would probably use a loop, but depending on my requirements, I might also just attempt to play the maximum prompts all the time, however, for the ones they didn't provide, it would just be blank.
Here's an option for the loop:
Variables
--------- String digits = "" Iterator digits_iterator = com.cisco.util.EmptyIterator.iterator Prompt playback = P[] Script Steps
------------ digits = Get Digit String Successful Set digits_iterator = digits.split("").iterator Label Get Next Digit: If (digits_iterator.hasNext()) True Set playback = playback + P[(String) digits_iterator.next()] Goto Get Next Digit False Play Prompt (playback) ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2019 11:20 AM - edited 08-13-2019 11:21 AM
what is meant here ?
+ P[(String) digits_iterator.next()]
To determine here where the number should be read, as in the original example above, Where are the mam numbers stored in each folder?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2019 11:40 AM
So, say for example the first iteration the number is "2", then the result of that section would be P[2]
Now, the thing you have to know is, the file extension is optional, so really what will be played is: P[2.wav]
The language it's played in, is based on the Contact language at the time you play it, and so the system will search for 2.wav in say for example Spanish, like so: es_ES -> es -> default.
So then the file it plays might actually be in /es/2.wav for example, if the Contact's language was set to es_ES and that's where I placed the file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2019 07:30 AM
Thanks, this is great.
But I have a minor problem.
I make this:
If i remove Playback, so I have only one number... Set playback = P [] then it works for me, of course, only for one number, but when I want to combine everything into one whole, I get an error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2019 07:46 AM
I found error.
It was my mistake. Digits.Iterator had the lowercase...
Newbie mistake ... :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2019 09:30 AM
