cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4418
Views
15
Helpful
11
Replies

UCCX Get Digit String played prompt in diffirent language

MikeHoliday
Level 1
Level 1

 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?

3 Accepted Solutions

Accepted Solutions

James Hawkins
Level 8
Level 8

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.

 

 

View solution in original post

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.

script.PNG

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

 

View solution in original post

That's pretty cool. You could make it smaller, by having this be a subflow, and just pass the digits from the caller as input mapping data. Or if you really want to get advanced, you could use something called prompt templates. This is a topic I have written about in the past. https://community.cisco.com/t5/collaboration-voice-and-video/uccx-enhancing-the-prompt-substitution-operator/ta-p/3133385

View solution in original post

11 Replies 11

James Hawkins
Level 8
Level 8

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.

 

 

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])

 

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.

script.PNG

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

 

That's pretty cool. You could make it smaller, by having this be a subflow, and just pass the digits from the caller as input mapping data. Or if you really want to get advanced, you could use something called prompt templates. This is a topic I have written about in the past. https://community.cisco.com/t5/collaboration-voice-and-video/uccx-enhancing-the-prompt-substitution-operator/ta-p/3133385

Good solution, but how would you solve the problem if I have an variable number entered? Once can be 2 characters, once  6 characters ...

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) ...

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?

That creates the prompt literal for the current number in the iteration.

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.

Thanks, this is great.
But I have a minor problem. 

I make this:

Zajeta slika.PNG
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.

I found error.

It was my mistake. Digits.Iterator had the lowercase...
Newbie mistake ... :)

You're allowed 3 newbie mistakes a month. ;)