cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
18069
Views
56
Helpful
24
Replies

How can I create a holiday schedule on CCX

Justin Westover
Level 1
Level 1

How can I create a holiday schedule in my CCX script so calls go to voicemail on holidays instead of going into the queue?

24 Replies 24

Andrew Skelly
Level 7
Level 7

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.

Please rate helpful posts by clicking the thumbs up!

What is the ownername and ownerteam in the xml script for? I see that is also referenced in the .aef script.

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.

Please rate helpful posts by clicking the thumbs up!

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:

  • Shareable between all scripts as a subflow (just like XML docs are)
  • Validates Date input at time of entry (XML docs can contain typos or improper formatting of dates)

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.

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!

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.

Hi Anthony

I used your method and its working

going to implement this for a client next week

Thanks

shameer

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

Hello Anthony,

Can you take a look at my scripts and let me know what I may be missing as it seem like my is_holiday variable keeps changing to true regardless of what is in the Date Array.

 

Thanks

Richard

Rich, I know you didn't ask me..but I would work with String with this..check out the Image..and test with the attached script..Let me know how it looks to you..

Hello Sam,

Thanks for your input, that worked like a charm yes

 

Thanks for you help

Rich

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

Sam Womack!  Good work as usual!  Works like a charm.

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.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: