CCX User to edit the Time of Day settings?

Answered Question
Jan 14th, 2010

We have CCX Premium 7.0(1) with a few CSQ's for various different incoming calls.

Each of these CSQ's have defined opening hours using the Time of Day field in the associated script. Because of the bad weather in our area recently I've had to change the time of day field to reflect the office closing early.

Although not a difficult or particularly time consuming job, it would be nice if I could leave it to someone else to make the changes as and when they need to. I was thinking of giving a user access to a number which they would call, follow some prompts, enter the necessary opening/closing times and then make this live on the necessary CSQ.

Does anyone know if this is possible and if so is there a "best" way to do it?

Thanks

Jeff

I have this problem too.
0 votes
Correct Answer by Tanner Ezell about 6 years 11 months ago

Jeff,

You have two options on how you can perform this task, what you're thinking is possible. Additionally, you could go about it another way by calling in and setting a flag when you want the center to close down. Either way is not too difficult.

Lets assume you're going with your first version, have your users enter start/stop times in 24 hour format. For example, 930 for 9:30 AM, and 1730 for 5:30PM

Concat your two strings into the format of: startTime + "-" + endTime. I.e: "930-1730"

Write this value to a document

In your scripts, you'll need to read the document with the string we created above (into a variable, 'todString' in this example). You'll need a single dimension String Array as a variable.

String[] ToD

Assume you stored the ToD string as 'todString'

Set ToD = todString.split("-")

If (int.valueOf(ToD[0]) <= int.valueOf(T[now].getHours() + "" + T[now].getMinutes()) && int.valueOf(ToD[1]) >= int.valueOf(T[now].getHours() + "" + T[now].getMinutes()))

     True:

          /* within hours of operation */

     False:

          /* outside hours of operation */

Essentially what we are doing is this:

storing the hours of operations as "930-1730", once we split it, ToD[0] will be "930", ToD[1] will be "1730"

The "" in T[now].getHours() + "" + T[now].getMinutes() is important, without it you would simply get back a integer result of hours plus minutes.

int.valueOf() turns our Strings into numbers which we can compare. If the startTime is less than or equal to the current time, than we're open. If the endTime is greater than or equal to our current time, we're still open.

If you wished, you could remove the equal to portion of the second check if you wanted to be closed on the minute of 5:30 PM

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4 (2 ratings)
Loading.
Correct Answer
Tanner Ezell Thu, 01/14/2010 - 10:41

Jeff,

You have two options on how you can perform this task, what you're thinking is possible. Additionally, you could go about it another way by calling in and setting a flag when you want the center to close down. Either way is not too difficult.

Lets assume you're going with your first version, have your users enter start/stop times in 24 hour format. For example, 930 for 9:30 AM, and 1730 for 5:30PM

Concat your two strings into the format of: startTime + "-" + endTime. I.e: "930-1730"

Write this value to a document

In your scripts, you'll need to read the document with the string we created above (into a variable, 'todString' in this example). You'll need a single dimension String Array as a variable.

String[] ToD

Assume you stored the ToD string as 'todString'

Set ToD = todString.split("-")

If (int.valueOf(ToD[0]) <= int.valueOf(T[now].getHours() + "" + T[now].getMinutes()) && int.valueOf(ToD[1]) >= int.valueOf(T[now].getHours() + "" + T[now].getMinutes()))

     True:

          /* within hours of operation */

     False:

          /* outside hours of operation */

Essentially what we are doing is this:

storing the hours of operations as "930-1730", once we split it, ToD[0] will be "930", ToD[1] will be "1730"

The "" in T[now].getHours() + "" + T[now].getMinutes() is important, without it you would simply get back a integer result of hours plus minutes.

int.valueOf() turns our Strings into numbers which we can compare. If the startTime is less than or equal to the current time, than we're open. If the endTime is greater than or equal to our current time, we're still open.

If you wished, you could remove the equal to portion of the second check if you wanted to be closed on the minute of 5:30 PM

Tanner Ezell Thu, 01/14/2010 - 10:58

Also, if you are unsure on how to upload a document programmatically, it is as follows:

Create a User variable, 'user' in this example

User the Get User Step, select QueryType "User ID", User ID = username (must be an admin user), Output User = user

On the successful branch, use the Authenticate User Step, selecting the user and inputing the Password/PIN

On the successful branch, use the Upload Document Step, assuming US English, Language = L[en_US], Name = "HoursOfOperations.txt", User = user, Document = doc

Don't forget to set your document in the following fashion:

Set doc = startTime + "-" + endTime

You should be set.

Jeff Clark Mon, 02/01/2010 - 07:21

Thanks for all the replies!

Tanner - it's Monday afternoon for me after a heavy weekend and I'm having difficulty in reading & understanding your posts! Tomorrow could be very different, but is there any chance you have an example script you could post up or email me please?

Thanks

Jeff

susanto.liu Thu, 07/29/2010 - 20:28

Thank You Tanner,

You make me have inspiration to solve my problem to split a long string variable

RSwartzmiller Fri, 01/15/2010 - 06:48

Don't base your hours on 'Time of Day'. Base it on if agent's are logging or ready which every you want.

Use the get Reporting statistic

Report Object: "CSQ IPCC Express"

Field: "Logged-In Resources"

Row Identifier: "CSQ Name"

Results Statistic" "int value"

Then use a if statement, if int value is > then 0

True---Open

False--Close

SAN J Fri, 01/15/2010 - 08:36

One way to do it too would be to use a call-in script that writes a variable to an xml file. Within your main script right after the business hours check, do a lookup of that xml file (same method as used in the holiday script in the cisco script repository) and then do an IF statement where if the variable equals true then consider it afterhours.

Tanner Ezell Fri, 01/15/2010 - 10:17

Jsantos16,

The flip side is you also have to set it to no longer be set. (Ever forget something?)

This method is better suited for Emergency situations, or depending on business needs, something like Ad Hoc meetings.

Using Time of Day is the best option.

Tanner Ezell Fri, 01/15/2010 - 10:15

RSwartzmiller,

It's generally a bad idea to base your openness on Agents logged in, instead if Agents logged in = 0, you should do some action (for instance, email a distribution group that manages those agents).

What if for example, all but one agent logs off, the other simply left it while in the Not Ready state? Are you really going to continue queuing calls?

Time of Day makes sense.

Arpit Arora Wed, 03/05/2014 - 07:09

Hi Tanner,

This post helps me a lot in scripting. But i am facing a problem in getting the current time.

I use below expression for getting the time but its not giving me correct time.

int.valueOf(T[now].getHours() + "" + T[now].getMinutes()

Suppose current time 19:07, its giving me value as '197' rather than '1907'. Is there any way i can get the correct value.

Thanks & Regards,

Arpit

Gergely Szabo Wed, 03/05/2014 - 07:42

Hi, that's by design. Let me ask you this: what is the use of that timestamp? It's not recommended to store date or time values as strings.
Thanks.
G.


Sent from Cisco Technical Support Android App

Arpit Arora Wed, 03/05/2014 - 08:04

Thanks for reply Gergely.

I am trying to compare the Current Time with the time in XML doc as suggested in this post.

Lets assume you're going with your first version, have your users enter start/stop times in 24 hour format. For example, 930 for 9:30 AM, and 1730 for 5:30PM

Concat your two strings into the format of: startTime + "-" + endTime. I.e: "930-1730"

Write this value to a document

In your scripts, you'll need to read the document with the string we created above (into a variable, 'todString' in this example). You'll need a single dimension String Array as a variable.

String[] ToD

Assume you stored the ToD string as 'todString'

Set ToD = todString.split("-")

If (int.valueOf(ToD[0]) <= int.valueOf(T[now].getHours() + "" + T[now].getMinutes()) && int.valueOf(ToD[1]) >= int.valueOf(T[now].getHours() + "" + T[now].getMinutes()))

     True:

          /* within hours of operation */

     False:

          /* outside hours of operation */

Essentially what we are doing is this:

storing the hours of operations as "930-1730", once we split it, ToD[0] will be "930", ToD[1] will be "1730"

The "" in T[now].getHours() + "" + T[now].getMinutes() is important, without it you would simply get back a integer result of hours plus minutes.

int.valueOf() turns our Strings into numbers which we can compare. If the startTime is less than or equal to the current time, than we're open. If the endTime is greater than or equal to our current time, we're still open.

I am also trying to follow the same thing as my customer wants to manually change the Operation Hours.

Thanks & Regards,
Arpit

Actions

This Discussion

Related Content