61
Scripting QueueMetrics / Re: Wallboard Example script
« on: December 10, 2007, 12:50:09 »Super coolhow do you set up the script?
Basic instructions are in comments in the script.
To use, simply define the queues you want to monitor as $queueid, and set the QM ROBOT user and PASS, as well as the IP address of your QM server.
I allow passing of a GET variable within the URL to select the queue to monitor, which is then evaluated in the switch statement. Just define $queueid to contain the Asterisk queue names (not the QM aliases). So just change the $queuename and $queueid in the switch statement to suit your needs.
If you want to set a default queue for when no GET is included (i.e. /qmon.php?queue=QUEUENAME) then define this in $defaultqueue.
Code: [Select]
// Set which queue you want to default to when none is specified
$defaultqueue = 'verification';
// Allow seting of the queue to monitor, and the refresh time.
isset($_REQUEST['refresh'])?$refresh = $_REQUEST['refresh']:$refresh=120;
isset($_REQUEST['queue'])?$queuereq = $_REQUEST['queue']:$queuereq=$defaultqueue;
// Depending on which queue was requested, set $queueid for passing to queuemetrics.
switch ($queuereq) {
case 'verification':
$queueid = "301|310|311|312";
$queuename='Dublin Verification';
break ;;
case 'inbound':
$queueid = "401|402|403|404|405|406|407|408|409|410|411|412";
$queuename='Inbound';
break;;
case 'outbound':
$queueid = "Outbound";
$queuename='Outbound';
break ;;
}
// Set up the XML-RPC instance.
require_once 'XML/RPC.php';
$qm_server = "127.0.0.1"; // the QueueMetrics server address
$qm_port = "8080"; // the port QueueMetrics is running on
$qm_webapp = "queuemetrics"; // the webapp name for QueueMetricsHope this helps.
-Barry Flanagan

how do you set up the script?