Wednesday 23 April 2014

UCCX9 http trigger showing agent status

In order for a supervisor to check the current status of each agent by using a web page, we can use a http trigger to get these info from statistics report and present them to another web page.
Code a searching web page with an input value and submit to match http trigger script
feel free to download complete script:
https://drive.google.com/file/d/0B5tzzJsbkWkIMjR3TVowVWFFMVk/edit?usp=sharing
enteragentname.html
<html>
<head>
<title>Agent Status Search</title>
</script>
</head>
<body>

<CENTER><FORM METHOD="post" action="http://142.100.64.14:9080/report">
<DIV>Enter Agent Name to check status
<br><br><br>

Agent is :
<INPUT NAME="INagentName" TYPE="text" SIZE="20">


<INPUT TYPE="SUBMIT" VALUE="Search">
</DIV>
</FORM></CENTER>

<body>
</html>

Create the following variables for the script




Get “INagentName” stored into “AgentID” as a string value

Use “AgentID” that contains value to search the current agent state

Also, get an integer number from statistics report, representing the duration in seconds at the same status of an agent
If you are using UCCX Enhanced or premium license, then we are able to reformat this integer value into hh:mm:ss format using java in a set() step as below:
{

int hours = StateDur / 3600;
int remainder = StateDur % 3600;
int minutes = remainder / 60;
int seconds = remainder % 60;

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

}



Convert “statetime” value into  a new format
Code a web page to display results
Report.html
<html>
<head>
</head>
<body>
    <center>
    <h1>Online Status Report</h1>
    <font face=verdana size=1>
    <table border=0 cellpadding=3>

    <tr>
<td> <div align="center"><strong>Agent</strong></div></td>
<td> <div align="center"><strong>Status</strong></div></td>
<td> <div align="center"><strong>Duration</strong></div></td>
    </tr>
<tr>
<FORM METHOD="post" action="http://142.100.64.14:9080/report">
<td bgcolor="F5F5F5" aligh=right>
<font face=verdana size=1>
<INPUT NAME="INagentName" TYPE="text" value="%webagentName%" SIZE="20">
</font>
</td>
<td bgcolor="F5F5F5" aligh=right><font face=verdana size=1>%webagentStatus%</font></td>
<td bgcolor="F5F5F5" aligh=right><font face=verdana size=1>%webstatedur%</font></td>
<td><INPUT TYPE="SUBMIT" VALUE="Fresh"></td>
</tr>
</table>
</font>
</center>
</body>
</html>

Use keyword transform to assign values to the web page
Upload report HTML file to uccx default folder
 
Use an variable to response this web page

VARIFICATION:
Enter agent name and search
Redirect result page to uccx
Agent changes status to “Not Ready”
Press “Fresh” button







No comments:

Post a Comment