cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1004
Views
4
Helpful
12
Replies

Weekly Audio File Rotation in ICM (or CCX)?

tmessenger
Level 1
Level 1

I have a customer requesting a script that would rotate weekly through three audio files (week 1, week 2 , week 3 then back to week 1).  I can build an ICM script that would allow them to set the audio file for the week but they would need to call in at the start of each week to set the script.  

I'm also open to suggestions for this in UCCX. 

Any thoughts on how this could be automated? 

UCCE ICM 9.0.4 / CVP 9.0.1 / CCX 10.5.1

Thanks!

1 Accepted Solution

Accepted Solutions

It looks like your set variable in the initial script was set to a string of "1" rather than 1. I don't know if there is automatic typecast from string to long by setting it to "1."

In your initial value script, set the value to 1 instead of "1" which should make your other script work correctly.

In your weekly script, make sure you set the variable without the "" around the value. It looks like you're setting those values to strings as well.

I don't know if setting the value to "1" converts the value to 1 or if it makes it null. I suspect it makes the value null or empty which is why your IF statements aren't working as expected.

Bill

View solution in original post

12 Replies 12

Mark Frijns
Level 1
Level 1

Use a seperate variable to determine which week you are in, for example set an integer called WeekNr == 1.

In ad admin script you run once a week, on monday, check the WeekNr and add 1 to it. If WeekNr is 4 (Week 3 + 1) make it 1 again.

Use the value to determine which file you want to play.

Think that could do the trick.

Thank you for the help, I think that will work.  I have both the routing and admin scripts built, we'll see on Monday!

Not elegant, but you could make a custom function which has all the weeks in it and then you just rotate through them. For example span1=1000.wav, 1001.wav; span2=2000.wav, 2002.wav and so on.

david

Perhaps, you can post a screenshot of your admin script and we can see why it didn't work.

Bill

The initial_value_script shows the script that sets the CHNwMenuLine_WkChk=1.

The weeklysetvar_script shows the reoccurring admin script that changes the value of CHNwMenuLine_WkChk.  (I believe this is where my error is.) The first IF statement says If CHNwMenuLine_WkChk==1, then Set to 2.  Next if 2 then set to 3 and finally if 3 then set to 1.

I set the initial script to run once, then set the reoccurring script to run every Monday at 1:40pm.  It did not increment the value of CHNwMenuLine_WkChk. 


Thank you for all of your help!

What data type is CHNwMenuLine_WkChk? Character? Long? Float? From the screenshots it looks like it's a Character data type.

Can you expand one of the IF nodes in the weeklysetvar script and take a screenshot of that? I'd like to see how you're checking the variable value. If the condition statement is as you've written, CHNwMenuLine_WkChk==1, it appears you're checking for a numeric value rather than a string value. If your data type is Character, try changing your IF statement to CHNwMenuLine_WkChk=="1" instead; place quotes around the 1 and try again.

Bill

The data type is set for Long. 

Detailed views attached.

It looks like your set variable in the initial script was set to a string of "1" rather than 1. I don't know if there is automatic typecast from string to long by setting it to "1."

In your initial value script, set the value to 1 instead of "1" which should make your other script work correctly.

In your weekly script, make sure you set the variable without the "" around the value. It looks like you're setting those values to strings as well.

I don't know if setting the value to "1" converts the value to 1 or if it makes it null. I suspect it makes the value null or empty which is why your IF statements aren't working as expected.

Bill

That was it! 

Thank you all for your help!

I'm glad that worked for you.

Bill

I thought I had this figured out but no luck.  How do I increase the value of the WeekNr and is a user variable (character type) the correct one to use for this?  Where is the initial value of 1 set?  

You can create the user variable type as long or float; a long integer might be the better choice. I wouldn't use a character data type.

You can create another admin script to set the initial value depending on which week you're in or to 1 if that's your requirement. I do this frequently when I need to initialize a variable or set of variables to an initial value. You can set the admin script schedule to run once then when the value is set the 1st time it runs, delete the schedule and/or admin script so the script doesn't keep resetting the value. Now, your variable should be set to 1 or whatever value you need. Then, your other admin script can check the week number value and act accordingly.

I hope that helps.

Bill