Current Wait Time - HTML WallBoard

Answered Question
Feb 24th, 2010
User Badges:

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;}

I am in the process of making a Wall Board for a new call center we’re putting in. One of the metrics I’d like to be able to show to the group would be the current wait time on the various queues.


I have created a script that goes out reads a simple HTML file. Pulls out CSQ Reporting statistics stores them in various variables. Then does a keyword trans form with the results from the variable back into the HTML document. Very simple and working fine for all metrics except current wait time, this always shows as -1. Ideally it would output in hh:mm:ss format. I’m not sure how to take an integer and output back into the desired format.


Thanks in advance.


UCCX 7.0(1)SR05_Build504


wallboard.jpg


script.jpg

Correct Answer by Anthony Holloway about 7 years 1 month ago

Without going into a lot of detail, a -1 means the system cannot determine a metric at that instance.  So you can either treat it as a wati time of 0 or Invalid.


Your challenge seems to be, how to convert seconds into MM:SS.


Script:

wait_time = get reporting stats()

set wait_time = (wait_time < 1) ? 0 : wait_time

set conv_wait_time = "" + (wait_time / 60) + ":" +  (wait_time % 60)


Or if you want to pad single digits, change the last set to this:


set conv_wait_time = {

     int minutes = wait_time / 60;

     int seconds = wait_time % 60;

     return ((minutes < 10) ? "0" : "") + minutes + ":" + ((seconds < 10) ? "0" : "") + seconds;

}

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
Correct Answer
Anthony Holloway Thu, 02/25/2010 - 09:36
User Badges:
  • Purple, 4500 points or more

Without going into a lot of detail, a -1 means the system cannot determine a metric at that instance.  So you can either treat it as a wati time of 0 or Invalid.


Your challenge seems to be, how to convert seconds into MM:SS.


Script:

wait_time = get reporting stats()

set wait_time = (wait_time < 1) ? 0 : wait_time

set conv_wait_time = "" + (wait_time / 60) + ":" +  (wait_time % 60)


Or if you want to pad single digits, change the last set to this:


set conv_wait_time = {

     int minutes = wait_time / 60;

     int seconds = wait_time % 60;

     return ((minutes < 10) ? "0" : "") + minutes + ":" + ((seconds < 10) ? "0" : "") + seconds;

}

tpfrankli Thu, 02/25/2010 - 17:10
User Badges:

Thanks for the information, now what may seem like a dumb question. Where does this script get placed at? Is this a custom script in the UCCX wallboard script or does this go into my HTML file?


If I'm following the top half of your post you've definded two variable:


conv_wait_time

and wait_time


Are these int variables? My guess would be that wait_time is as you're storing the reporting statistics into it.


Thanks

tpfrankli Fri, 02/26/2010 - 07:22
User Badges:

I've spent some more time looking at this and I follow what you posted. It all goes into the script and I do define two new variables.

Anthony Holloway Fri, 02/26/2010 - 15:24
User Badges:
  • Purple, 4500 points or more

That is correct.  Glad you were able to work it out on your own.  If this solved your question, would you mind updating the post to reflect that?

Actions

This Discussion

Related Content