Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

Setting Prompt Directory path using a string variable?

So when you define a Prompt you get the form P[promptname.wav] and all is good.  What we want to do is have that prompt name be retrieved from a prompt directory which is defined by a string.   So assume all your prompts have the same numbers like 1001.wav but the actual file is customized based on things like Sales/1001.wav and Marketing/1001.wav   and you want to have a StringValue DirectoryName set the Directory to Sales or Marketing.   The Script does not seem to support setting P["DirectoryName"/1001.wav] where Directory Name is a string variable.    Is there a solution to this other than changing the entire prompt to a string type and dropping the P[] data type entirely?   

Everyone's tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions

Sam,Once you've built your

Sam,

Once you've built your fully qualified prompt path and filename you can just assign your string variable to the prompt variable directly.  You don't need to encapsulate it with P[].  You'll find the UCCX editor will automatically ask you if it is a user prompt or system prompt if you use the "=" step.

Note: As of UCCX 8.0 all prompt names and directory names are case sensitive.

 

-Steven

Please help us make the communities better. Rate helpful posts!
8 REPLIES

The way in which I normally

The way in which I normally do this is

final String PRMPT_DIR = "path/"

P[PRMPT_DIR + "1001.wav"]

Sam not quite sure this does

Sam not quite sure this does it.  In your example the value PRMPT_DIR is a fixed value, that works.  The question has to do with the need to Change the value of PRMPT_DIR per call.  Based on which Trigger is called, we use that Trigger to index an Options file to retrieve the PROMPT_DIR value.  The thinking being that we us prompt numbers throughout the script but the come from different directories  so that departments can customize their prompts without having us create a separate script.  In your example we would want the value for path to change each time.

 

 

 

It doesn't..here is a

You are correct..make promptDir just a normal old String

Set that String however your logic works out for your groups...

if trigger == "Sales"

promptDir = "Sales/"

Use Parentheses

P[(prmptDir + "1001.wav")]

 

New Member

I am working with a similar

I am working with a similar issue.   It is simple enought to set the Prompt Directory but when it is a variable it seems to have different results.  The attached simple script is used to demonstrate Sam's recommendation.  The XML document is embedded in the script variable, so you dont need to create it.   So the script reaches into the XML document and pulls up the variable strDirectoryName and then adds "/" to it and then sets the strPromptDirectory.   I have done it three ways:  Hard coded, string value for prompt' and prompt data type resolved from string.  As you single step through the script you will find that all values populate appropriately, but only the hard coded play prompt actually plays the prompt.  The other two assemblies fail.  (Clearly it assumes the prompt 10001.wav is in the directory Generic/ if you want to try it).    Written in  Version 8.5 editor.  

Peter Buswell (aka DrVoIP) http://blog.drvoip.com

Sam,Once you've built your

Sam,

Once you've built your fully qualified prompt path and filename you can just assign your string variable to the prompt variable directly.  You don't need to encapsulate it with P[].  You'll find the UCCX editor will automatically ask you if it is a user prompt or system prompt if you use the "=" step.

Note: As of UCCX 8.0 all prompt names and directory names are case sensitive.

 

-Steven

Please help us make the communities better. Rate helpful posts!
New Member

OK, I have rewritten the

OK, I have rewritten the example case as you suggest and, no surprise, you are absolutely correct and it works.    I am unhappy however, to learn that I now have to administer my prompt names in two places! Ugly.  I have to specify the prompt data type and name it in the value/parameter fields and the do a bunch of set commands in the actual script?   Well at any rate, there is a lesson here for all of us and thank you Steven for your excellent contribution!

 

Peter Buswell (aka DrVoIP) http://blog.drvoip.com

Just use the (parentheses) if

Just use the (parentheses) if it don't look right(and if you want to define a prompt within a different type of Step and/or you are really doing the business with open curly braces and in that case the Set Step won't do anything for you as it does Auto Data Conversion..but doesn't do it if you open the brace)..the beauty of Software is you can do it many many ways..just remember to practice safe coding practices if you can help it..

:)

New Member

Steven,

Steven,

This is Essi from EB IT department. We are in need to update / rebuilt our UCCX scripts; are you infested in that project? Please let me know. seven o seven five two four- three three eight eight.

493
Views
0
Helpful
8
Replies