- General info
- Access restrictions / Security
- FAQ
- Q: How do I make the page refresh every XX seconds ?
- Q: How do I change the coloring rules ?
- Q: How do I test my coloring rules ?
- Q: How do I choose which queues to display ?
- Q: How do I show only a selected agent's queues ?
- Q: How do I query remote ACD server for stats ?
- Q: How to clear ACD stats
- Q: Where can I discuss my ideas ?
General info
The purpose of the page is to demonstrate the usage of sipXecs PHP API.
Most probably one will need to hack the page to get some useful data out of it.
The example stats page is located in the file /usr/local/sipxworks-phpapi/php/htdocs/acd/queuestats.php and is accessible from under the URL: http://localhost:8112/acd/queuestats.php where localhost can be Your IP of FQDN.
Access restrictions / Security
The page resides in a httpd context defined in /etc/sipxpbx/httpd.conf.d/sipxworks-phpapi.conf.
Onc can restrict access to the page there or by dropping appropriate .htaccess file in /usr/local/sipxworks-phpapi/php/htdocs/ folder.
FAQ
Q: How do I make the page refresh every XX seconds ?
A: make the queuestats.php file header look like the one below.
Replace 30 with desired refresh rate.
<HTML> <HEAD> <LINK HREF="default.css" REL="stylesheet" TYPE="text/css" /> <META HTTP-EQUIV="refresh" CONTENT="30" /> </HEAD> <BODY>
Q: How do I change the coloring rules ?
A: You have to hack the PHP code of queuestats.php. All coloring rules are defined in a set of functions named:
function colorWaitingCalls($queue) function colorAvgWaitTime($queue) function colorAbandonedCalls($queue) function colorAvgAbandonedTime($queue) function colorAvgProcessingTime($queue) function colorProcessedCalls($queue) function colorIdleAgents($queue)
Q: How do I test my coloring rules ?
A: change the value of $fakestats to true in /usr/local/sipxworks-phpapi/php/api/sipxglobals.php
This setting will randomize Your stats for every refresh.
<?php
class SIPXAPIGLOBALS {
public static $password = 'secret';
public static $sipXconfigWSDL = '/usr/local/sipxworks-phpapi/php/api/wsdl/sipxconfig.wsdl';
public static $sipXconfigAgentWSDL = '/usr/local/sipxworks-phpapi/php/api/wsdl/sipxconfig-agent.wsdl';
public static $fakestats = true;
}
Q: How do I choose which queues to display ?
A: Append q[]=queue as parameters to the queuestats.php page.
Like : http://localhost:8112/acd/queuestats.php?q[]=asysta2&q[]=asysta3

Q: How do I show only a selected agent's queues ?
A: Append user=user_name as parameters to the queuestats.php page.
Like : http://localhost:8112/acd/queuestats.php?user=301

Q: How do I query remote ACD server for stats ?
A: Wow, if You have a remote ACD server then You probably now how to do stuff.
Anyways, replace localhost with proper URLs in WSDLs or point the SIPXGLOBALS to the correct ones.
Remember to purge PHP's WSDL cache - eg by running /usr/local/sipxworks-phpapi/php/utils/invalidate_wsdl_cache.sh
Q: How to clear ACD stats
A: sipxproc -r ConfigAgent
Q: Where can I discuss my ideas ?
A: on the sipXworks forum ![]()
Add Comment