cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1280
Views
10
Helpful
5
Replies

UCCX Dynamic Menu

Nliya53887
Level 1
Level 1

Hello,

Can someone provide me an example on how to build a dynamic menu.

I need to list items in an array in a menu. The file name is the value of the string in the array.

For example the menu should say as following. I am new to UCCX and not sure where this logic go in.

Array[0].wav press 1

Array[1].wav press 2

Array[3]wav press 3

For more items press 9

 

Thanks in advance. 

1 Accepted Solution

Accepted Solutions

Yes, you'd use the Do step right before hand, however, you could technically place it in the Menu step (shown below).

 

Is the "For", "Press" and number (E.g., "one" "two" "three") supposed to be system generated or will you have those recorded as separate wav files?

 

Also, the .wav file extension is optional, so if it's not in the String array (E.g., String[] {"Sales"} VS String[] {"Sales.wav"}) then it's not a problem.

 

If you were system generating the for, press and the number, then you could change the Do step to this to insert them:

{
	int i = 0;
	int j = my_array.length;
	for (; i < j; i++) {
		result += sp[UserDialog\for] + p[my_array[i]] + sp[UserDialog\press] + n[i + 1];
	}
}

The n[] tells the system to say a number (like "Four" or "One Hundred").

 

The sp[] is a system prompt, and plays the correspond wav file.  There's no easy way to see which system prompts are available, but if you have the UCCX ISO, you can drill into the following folder to see them all (using 12.5 as an example):

 

UCSInstall_UCCX_12_5_1_UCOS_12.5.1.10000-31.sgn.iso\Cisco\contactcenterexpress\RPMS\UCCX07_Prompts-8.0.1-1.i386.rpm\UCCX07_Prompts-8.0.1-1.i386.cpio\.\common\cisco\uccx\Prompts\system\G711_ULAW\g711.tgz\g711.tar\en_US\

 

 I don't really recommend doing it in here, because it makes the script look ugly, but you could do this right in the menu step like this:

uccx-menu-expression-block.png

View solution in original post

5 Replies 5

Anthony Holloway
Cisco Employee
Cisco Employee

Welcome to the world of UCCX!  Two questions for you:

 

  1. Does the wav file contain the full instruction? I.e., "For Sales, press 1"  Or does it only contain the option outcome and you need to dynamically state the key mapped to it?  I.e., "For Sales..."

  2. How are you dynamically changing the programming/logic under each menu option?  E.g., If right now, it's Press 1 for Sales, and that goes to Sales, but then the Array changes to Support as Press 1, wouldn't the programming under option 1 need to change dynamically too?

 

Even before you answer, I can still share a solution on converting a String array into a concatenated prompt variable.

 

However, before we get straight into the answer, let's look at a few building blocks first.

 

UCCX does something called type casting for us, sepcifically with the Set step.  So, if we had a filename in a String, we could cast that to a Prompt like so:

Set my_prompt = "filename.wav"
/* my_prompt is now P[filename.wav] */

Also, it acts the same whether you enter a String literal or used a variable there.

 

We don't always have to type cast first before using it, because some steps can actually handle different types of input.  You can see this pretty easily with the mouse over tool tip on the input fields like so:

 

uccx-tool-tip.png

 

Therefore, if I was using a single String variable to hold my filename, I could actually just pass it to the menu step without the need for a cast:

 

uccx-menu-string-prompt.png

 

Again, this works with Sting variables as well as literals.

 

Unfortunately, you cannot just put a String array in there and hope for the cast to happen....that would be nice.

 

We could write some code to convert each of the elements to a prompt and concatenate them for us, but there's actually a built in step for that.

 

The Create Container Prompt step is used to build the Prompt concatenation for you, however, it would be a fixed size all the time.  So, if you could guarantee that your Array will never be a different size, then this might be the option for you:

 

uccx-prompt-container.png

 

If you did need a solution which could handle String arrays of varying sizes then we could turn to this small bit of code in a Do step:

{
	int i = 0;
	int j = my_array.length;
	for (; i < j; i++) {
		result += p[my_array[i]];
	}
}

This assumes that your String array is called my_array and the resulting prompt variable you'll play with the menu step is called result.

 

I hope that helps you out.

 

PS There are some really detailed notes on the Expression Language over on developer.cisco.com

Hello @Anthony Holloway ,

Thanks for your response.

1. No the wave file does not contain the full instruction. My plan is to pay 'For' as prompt before the menu ('for' needs to be played only at the beginning of the listing).

press1, press2, press 3.... these are separate recordings.

Sales, Marketing, HR,... these are the only values in the array so when playing it, the script needs to add .wav to too. 

 

2. Yes the press option needs to dynamically change too. I was thinking while looping through the array, if the index is 0, set the prompt to play press1, if index is 1, set the prompt to play press 2.....

 

The array is a not a fixed length. 

 

so if I am using a do Step to build the prompt path, and then I use a Menu step right after it? Basically the do step builds the full phrase for the Menu?

Yes, you'd use the Do step right before hand, however, you could technically place it in the Menu step (shown below).

 

Is the "For", "Press" and number (E.g., "one" "two" "three") supposed to be system generated or will you have those recorded as separate wav files?

 

Also, the .wav file extension is optional, so if it's not in the String array (E.g., String[] {"Sales"} VS String[] {"Sales.wav"}) then it's not a problem.

 

If you were system generating the for, press and the number, then you could change the Do step to this to insert them:

{
	int i = 0;
	int j = my_array.length;
	for (; i < j; i++) {
		result += sp[UserDialog\for] + p[my_array[i]] + sp[UserDialog\press] + n[i + 1];
	}
}

The n[] tells the system to say a number (like "Four" or "One Hundred").

 

The sp[] is a system prompt, and plays the correspond wav file.  There's no easy way to see which system prompts are available, but if you have the UCCX ISO, you can drill into the following folder to see them all (using 12.5 as an example):

 

UCSInstall_UCCX_12_5_1_UCOS_12.5.1.10000-31.sgn.iso\Cisco\contactcenterexpress\RPMS\UCCX07_Prompts-8.0.1-1.i386.rpm\UCCX07_Prompts-8.0.1-1.i386.cpio\.\common\cisco\uccx\Prompts\system\G711_ULAW\g711.tgz\g711.tar\en_US\

 

 I don't really recommend doing it in here, because it makes the script look ugly, but you could do this right in the menu step like this:

uccx-menu-expression-block.png

It worked beautifuly! Thanks @Anthony Holloway 

 

Sweet!