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.

New Member

Play Prompt by use of string variables

Hi,

Im writing a script and i hope to reuse most of the logic from it for other very simmilar scripts.

Regarding the prompts, i have made a prompt directory which categorises the prompt names (which are a numeric value) to keep it structured. Hopefully this will explain better.

Prompts are reccored and stored in xx=team ID yy=prompt categry and zz=prompt

e.g. 060110.wav = team 06, prompt category = 01 (welcome) and prompt = 10 (

To play the welcome message i have;

variable; (all string)

teamID - e.g "06"

pWelcomeMessage - e.g. "0110.wav"

play prompt = teamID + pWelcomeMessage

This allows me to set the teamID as a parameter and use the same script over again. This piece is working perfect....

In the queuing section i have to play the position in the queue. Initially i had the system play the position number from a get reporting statistic which worked but they want to record the position prompt themselves. so, If the PIQ <= 5 there is a SET step to;

set pPositionInQueue = "teamID + positionPromptCategory + positionInQueueString + positionPromptExtn"

I was hoping this would work, i converted the PIQ integer to a string to see if that fixed it but no luck. So for caller who is position 2 in the queue the prompt file should be (with no spaces) 06 021 2 .wav.

Any ideas on where im going wrong? I think i need to use a generate prompt step but im not sure....

Best wishes

Jon

2 ACCEPTED SOLUTIONS

Accepted Solutions

Re: Play Prompt by use of string variables

Playing two user defined prompts in one Play Prompt step:

Play Prompt (--Triggering Contact--, P[var1 + var2] + P[var3 + var4])
Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.

Re: Play Prompt by use of string variables

Hmm, I'm not sure why my email response never made it to the thread but alas, the original message:

set pPositionInQueue = teamID +""+ positionPromptCategory +""+
positionInQueueString +""+ positionPromptExtn

That will result in a string.

You must have + "" in there otherwise, when you add two strings
together that contain a number it gets added. Putting in "" prevents
this.

From my understanding thats what you are trying to accomplish

You want the result of say, "061001.wav" from strings teamID "06" and pSomethingElse "1001.wav"

Tanner Ezell www.ctilogic.com
8 REPLIES

Re: Play Prompt by use of string variables

You are close.  You will need to pad your PIQ for values less than 10.

Play Prompt (--Triggering Contact--, teamID + positionPromptCategory + ((positionInQueue < 10) ? "0": "") + positionInQueue + positionPromptExtn)
Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.
New Member

Re: Play Prompt by use of string variables

Thanks for the quick reply Anthony!

Why do i need to pad out the PIQ string? the PIQ value should be the last digit before the file extension e.g 060212.wav. I know i said the category was only two digits but as i play a different prompt for PIQ > 5 then i can set the first prompt digit in the category digits.

Cheers

Jon

New Member

Re: Play Prompt by use of string variables

Ive got round the problem slightly by not setting the variable pPositionInQueue. It worked when i had specified "teamID + positionPromptCategory + positionInQueueString + positionPromptExtn" as the prompt for the menu step instead of the pPositionInQueue variable. the only problem now is that in need to play a prompt before this with a filename of "teamID + pQueueSeccond" which are again all variables. So in theror it looks like;

prompt = "teamID + pQueueSecond" + "teamID + positionPromptCategory + positionInQueueString + positionPromptExtn"

I think im going to have to have a container prompt to achieve this unless anyone knows some syntax.

/Jon

Re: Play Prompt by use of string variables

Playing two user defined prompts in one Play Prompt step:

Play Prompt (--Triggering Contact--, P[var1 + var2] + P[var3 + var4])
Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.

Re: Play Prompt by use of string variables

Sorry, I understood your comment to require a double digit PIQ for your prompts.

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.

Re: Play Prompt by use of string variables

Hmm, I'm not sure why my email response never made it to the thread but alas, the original message:

set pPositionInQueue = teamID +""+ positionPromptCategory +""+
positionInQueueString +""+ positionPromptExtn

That will result in a string.

You must have + "" in there otherwise, when you add two strings
together that contain a number it gets added. Putting in "" prevents
this.

From my understanding thats what you are trying to accomplish

You want the result of say, "061001.wav" from strings teamID "06" and pSomethingElse "1001.wav"

Tanner Ezell www.ctilogic.com

Re: Play Prompt by use of string variables

To clarify what Tanner is saying.

A String plus an Integer, equals a String.  In programming, this is called type casting.

Thus:

int a = 1

int b = 2

String s = a + b

s == "3"

Whereas:

int a = 1

int b = 2

String s = "" + a + b

s == "12"

Message was edited by: Anthony Holloway - To be technically correct, only the Editor lets you type cast so easily as I did in the first example.  Java would not have let you done that, and only worked with the second example.

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.
New Member

Re: Play Prompt by use of string variables

Thanks guys that worked a treat. Have some magic stars!

380
Views
0
Helpful
8
Replies