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

Scripting help - Time of day routing for specific dates

I need to be able to route calls based on time of day and the date (for holidays, etc.). For example, one department is open from 8am-1pm on Labor Day. The generic holiday.aef and holiday file for AMPM does not work in this case. Any suggestions?

Thanks,

Tom

7 REPLIES
Green

Re: Scripting help - Time of day routing for specific dates

Expression Editor - how are your Java programming skills?

Otherwise, take the holiday.aef file as an example and make some more XML files and cruise through them. Are you wanting to read the opening hours from the XML file, or could you program it?

Regards,

Geoff

Re: Scripting help - Time of day routing for specific dates

If you write a lot of scripts you'll want to create a subflow for this kind of thing. You can use it over and over again.

The built-in Java date/time and calendar classes are broken and esentially useless. My suggestion is to abandon them and use a third-party class library. Personally I use the Joda Time class library in my UCCX scripts and it works like a charm.

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

Re: Scripting help - Time of day routing for specific dates

>>The built-in Java date/time and calendar classes are broken and esentially useless.

I'll debate this.

The Java Gregorian Calendar class is a complete specification. It's not broken - it just takes a little bit of work to learn how to use, because it has capabilities way beyond the typical IVR programming.

The Date/Time class that the IVR scripts use is a deprecated class - but that's a Cisco issue, and anyway, it still works.

Regards,

Geoff

Re: Scripting help - Time of day routing for specific dates

Geoff,

It may be a complete specification but it is unwieldy to use and it has a host of quirks and buggy behaviors. I am not the only one who thinks this way. A Google search will turn up a host of rants and raves about the class which are too numerous to mention and much better articulated.

However, I will give my personal gripe with the Calendar class which is that you cannot perform date comparisons or do any useful date/time math using the definitions supplied to the objects themselves. The Calendar class always uses the local date/time of the system it is running. So, to compare two objects who have different time zone values you must first generate printable output and then do your own math on it.

Why the class cannot be smart enough to subtract two date objects or tell me if one date object is greater than another is simply unacceptable to me. I frequently need to open / close call centers in different time zones where the UCCX server may be in the America/Los_Angeles timezone and the call center is in America/Denver. It requires way too much coding to do this in the Calendar class (using UCCX scripting or in just plain Java itself.) The Joda Time class has this all built-in and it is quite simple and intuitive to use.

I am afraid I must dissent here and continue to assert that the Calendar class is broken and useless.

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

Re: Scripting help - Time of day routing for specific dates

Would you be willing to post some example scripts of yours on opening and closing using Joda?

Thanks.

Re: Scripting help - Time of day routing for specific dates

Not quite up to me. There are questions of intellectual property and all that I'll have to get cleared.

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

Re: Scripting help - Time of day routing for specific dates

Hi Tom

We have a solution where opening hours is checked by subscript. This script checks current date/time against 2 XML files. First file contains Holidays and if date/time dosn't match here, second XML file with normal opening hours (mon-sun)

Both files contain upto 3 different open time definitions with corresponding welcome/close prompts.

Depending on returned values from subscript, main script can act as requested.

Example for dec. 24, where subscript would return closed, since no time is defined but date is matched(99 states the function is not used)

AabenTim1=OpenHour1

AabenMin1=OpenMinute1

LukkeTim1=CloseHour1

LukkeMin1=CloseMinute1

00

00

00

00

99

99

99

99

99

99

99

99

1000

99109

Hope this can give some inspiration

Henrik

598
Views
0
Helpful
7
Replies
CreatePlease to create content