10-12-2012 02:56 PM - edited 03-14-2019 10:40 AM
How can I create a holiday schedule in my CCX script so calls go to voicemail on holidays instead of going into the queue?
10-12-2012 04:17 PM
Create an XML document (like the one attached) that has your company holidays in it. You'll need to update it each year as the company recognized day changes each year.
You will need to collect the specific day in the script, and then reference the current day against the XML document. I've include a basic script that only shows how the date collection would look in a scirpt. There is probably a cleaner way to do this, but this should get you started.
10-12-2012 11:44 PM
What is the ownername and ownerteam in the xml script for? I see that is also referenced in the .aef script.
10-15-2012 06:41 AM
Those are just the names of the fields in the XML document. You can call them whatever you want. I quick copied another XML I had to put the dates in there. The script needs to know which fields in the XML it is looking at for data, so you need to specify in the script.
You can change the names to "Recognized Date" and "Company Holiday" or anything else you would like. Just make sure whatever you call them in the XML you also reference in the script.
10-15-2012 09:02 AM
I'm actually really curious as to why the XML based solution for Holidays took off like it did. Don't get me wrong, it's certainly a good option, and I have used it many times in the past myself. I'm just curious.
Anyway, here's an alternate solution to the XML one Andrew posted, and the many others that exist on the forum. We will explore using a Date array in lue of an XML document, and you simply call it via Subflow looking for the return value of "is_holiday." It's pretty light weight.
Some benefits include:
Filename: holidays.aef
Variables
Date holiday = null
Date[] holidays = new Date[] {D[11/22/2012], D[11/23/2012], D[12/25/2012]}
Iterator holidays_iterator = com.cisco.util.EmptyIterator.iterator
boolean is_holiday = false
Date today = D[now]
Script
Start
Set holidays_iterator = holidays.iterator
Label Read Next Holiday
If (holidays_iterator.hasNext())
True
Set holiday = (Date) holidays_iterator.next()
If (holiday.month == today.month && holiday.date == today.date && holiday.year == today.year)
True
Set is_holiday = true
Goto End of Script
False
Goto Read Next Holiday
False
Goto End of Script
Label End of Script
End
So, that's the subflow, and this next script is your Main AA script. I will omit everything except for the pieces necesary to use the holiday subflow. It only uses a single variable, and two script steps.
Filename: main_aa.aef
Variables
boolean is_holiday = false
Script
Start
...answer, greet, etc...
is_holiday = Call Subflow(SCRIPT[holidays.aef], is_holiday)
If (is_holiday)
True
/* Today is a holiday */
...holiday treatment...
False
/* Today is not a holiday */
...the remainder of the AA...
End
You could take this a step further and include timezone support by taking in an input parameter of type Timezone and name timezone, and then generate your today variable at runtime like so:
Set today = D[D[now], timezone]
You could also leverage the input parameter of the holidays Date array, which would override the default array. Or even specify a new Date array called holidays_include to allow the inclusion of some additional holidays. You would just repeat the actions in the script for both variables.
Challenge: How could you implement a holidays_exclude feature?
Anthony Holloway
Please use the star ratings to help drive great content to the top of searches.
10-25-2012 06:15 AM
Thanks Anthony. I'm now on 8.5 and your suggestion works. A previous suggestion from you using xml worked for me on 7 so instead of searching for 8.5 holiday scripts I searched for your name on the forum!
10-25-2012 08:20 AM
Oh dear! I better not start posting in the IP Telephony forum, it might delute your searches for UCCX solutions!
Thanks for the feedback, it's appreciated.
Anthony Holloway
Please use the star ratings to help drive great content to the top of searches.
01-29-2013 09:34 AM
Hi Anthony
I used your method and its working
going to implement this for a client next week
Thanks
shameer
06-17-2013 02:53 AM
I tried to understand what you're saying but didn't manage it. The presentation you're doing with the date variables. My java/programming/whatever way of thinking is not developed :/ . I'm just a humble network engineer
04-20-2014 01:04 PM
04-20-2014 02:00 PM
04-20-2014 02:59 PM
Hello Sam,
Thanks for your input, that worked like a charm
Thanks for you help
Rich
10-03-2014 12:19 PM
Hello Sam,
I used your input above but can't seem to get it to work. Here is my post.
https://supportforums.cisco.com/discussion/12317046/holiday-script-uccx-date-array-creation
Any input would be greatly appreciated.
Thank you,
Jeffery
06-29-2015 03:17 PM
Sam Womack! Good work as usual! Works like a charm.
03-01-2016 09:31 PM
Hi Sam,
Would it be possible to pass the dates in the string array as a parameter to the scipt, to make it easier for end users to change the dates?
Cheers and thanks,
Sam.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide