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

Need help to check time in routing script with if node.

Hi Team

I have a situation to check time in routing script by comparing values with memory variable . Please help me to get answers of below mentioned queries.

1, Which 'data type ' need to use in user variable list to store time  ( string ,date )

2 ,is it possible to check time if node like  : time(Global.user_time)>time(21,45,00)

any other better options ?

regards

Renni john

  • Contact Center
5 REPLIES

Need help to check time in routing script with if node.

Hi,

the recommended type for storing a time value: Float.

You did not write the details about filling that Global.user_time variable, but most likely: Global.user_time = now().

The now() built-in function returns the actual time.

If you want to compare two times, then yes, it's time(Global.user_time)>time(21,45,00) to see if the time is past 21:45:00.

G.

New Member

Need help to check time in routing script with if node.

Hi Gergely

Thanks a lot for your fast reply .But we have a different situation , let me explain.

Since our central controller is configured with CET time ,we are planning to manage Time & DST change of different regions with Global user variables .

As per our plan , Admin script will fetch system time with the help of built in functions : hour() , minute() ,second() and modify Hours value based on region & DST changes , then concatenate and store modified hour , minute , second to Global variable . This variable will use to check TOD in routing script .

Does it make any sence ?

Regards

Renni john

Need help to check time in routing script with if node.

Hi,

it makes sense but to be absolutely honest with you, I don't really see the reason why anything would be stored in a global variable.

What I would do is simply use time() > time(7,0) in an If node to decide where to route a call in a script serving a country in the CET timezone, and time() > time(8,0) in a script serving the UK - both will open at 7:00 in the morning, local time.

Otherwise, I would create three globals, integer type, one for storing the hour, the second the minute and optionally, the third storing the second value.

G.

New Member

Re: Need help to check time in routing script with if node.

Thanks Gergely

you are right ,if its a simple time check then its fine . But in our scenario, server configured with CET time and we have call centers in different regions and DST change makes more complexity in TOD .

If we consider North America , they have their own DST change and CET has also DST change , so 4 times we need to change the time in routing script  .

I couldnt concatenate hours, minute, seconds to memory variable .But below mentioned logic works fine for NA, bcz the time difference will affect only to 'hours' part

1, Configured 2 Global variables , one for 'hour'  and another for 'Weekday'.

2, Both variables are gettng modified by admin script  based on Time different and DST .

3 ,Weekday and time variables will be checked in routing script ,for example if opening hours is Mon-Fri ( 8:00 -18:00) the configuration would be;

If node 1 : Global.user_weekday>1&&Global.user_weekday<7

If node 2 : time(Global.user_Hour,minute(),second())>time(6,00,00)&&time(Global.user_Hour,minute(),second())

Please let me know if you have any better idea to solve this situation.

Regards

Renni John

New Member

We have implemented this

We have implemented this logic for NA and it worked fine .

Regards

Renni John

 

242
Views
0
Helpful
5
Replies