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.
11-18-2018 01:30 AM
This should not be too tricky.
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.
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
11-19-2018 11:50 AM
11-18-2018 01:30 AM
This should not be too tricky.
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.
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])
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
11-19-2018 11:50 AM
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 ...
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) ...
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?
08-13-2019 11:40 AM
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.
08-14-2019 07:46 AM
I found error.
It was my mistake. Digits.Iterator had the lowercase...
Newbie mistake ... :)
08-14-2019 09:30 AM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide