QueueMetrics > MySQL storage and Qloaderd/Uniloader

queue_log table fields

(1/3) > >>

dlm:
I'm using qloaderd script to copy queue_log records to MySQL. I followed the instructions and everything works fine. One of our customer requested a specific format of the queue stats in order to import this data into another statistic software.

1. I need to re-elaborate the basic log information but could not find enough about the standard fields of the queue_log table in queuemetrics MySQL db. Any suggestions about the field meaning (especially data1..data4 and verb), so I can build my own queries?  ???

2. Secondly, is there any way to extract the Answered Calls (and Unanswered Calls) detail page in a CSV/XML format automatically or from a script/software? I was able to write a program which takes CSV exported data form QM and builds up data into a specific custom format, so I wonder if I can import data automatically instead of manually feed my script.

Thank you for your support.

David

QueueMetrics:
Hello David,
parsing the queue_log table directly via SQL is not a great idea - if it were so easy at it may seem, there would be no need for QueueMetrics itself! :)
If you need to elaborate on or export data from QueueMetrics, the best way to do it is to use the XML-RPC interface - see http://queuemetrics.com/download/QueueMetrics_XmlRpc_v10.pdf - with a scripting language of your choice. You may use that interface just to query QM for the very list of taken and lost calls or agents essions and then work on those as the basic "building blocks" of your own reports.

dlm:
Yes, I noticed that the queue_log table was not so useful for what I need to do. And yes, that's why QM is there for...  ;)

As for the XML-RPC, what tables codes I need to use to get the following from the interface?

1. Detail of answered calls
2. Detail of unanswered calls

Have you got a quick sample accessing the interface with PHP (I can't use Java or Python  :-[)...?

Thanks. Kind regards.

David

QueueMetrics:
Hello there,
the tables you are looking for can be accessed using the following names:


* DetailsDO.CallsOK
* DetailsDO.CallsKO
* DetailsDO.AgentSessions
I think the names are fairly well self-explanatory :)

We are preparing an XML-RPC tutorial for PHP as well, as it is very widely used. I'll keep you posted. This should be a good starting point anyway: http://www.phpbuilder.com/columns/luis20010329.php3?page=3&print_mode=1


QueueMetrics:
This is a very simple XML-RPC client for QueueMetrics. It is based on the standard XML_RPC library that is a part of Pear, so it should be already installed on most recent versions of PHP.
This client will query QueueMetrics asking for the details of answered and unanswered calls, and will print them out in tabular form. Should be pretty self-explanatory. :)



--- Code: ---
<h1>QueueMetrics XML-RPC client in PHP</h1>
<?
require_once 'XML/RPC.php';

$qm_server = "10.10.3.5";           // the QueueMetrics server address
$qm_port   = "8080";                // the port QueueMetrics is running on
$qm_webapp = "queuemetrics-1.3.3";  // the webapp name for QueueMetrics


// set which response blocks we are looking for
$req_blocks = new XML_RPC_Value(array(
  new XML_RPC_Value("DetailsDO.CallsOK"),
    new XML_RPC_Value("DetailsDO.CallsKO")
    ), "array");

// general invocation parameters - see the documentation
$params = array(
          new XML_RPC_Value("queue-dps"),
new XML_RPC_Value("robot"),
new XML_RPC_Value("robot"),
new XML_RPC_Value(""),
new XML_RPC_Value(""),
new XML_RPC_Value("2007-01-01.10:23:12"),
new XML_RPC_Value("2007-10-10.10:23:10"),
new XML_RPC_Value(""),
$req_blocks
          );
         
$msg = new XML_RPC_Message('QM.stats', $params);
$cli = new XML_RPC_Client("/$qm_webapp/xmlrpc.do", $qm_server, $qm_port);
//$cli->setDebug(1);
$resp = $cli->send($msg);
if (!$resp) {
    echo 'Communication error: ' . $cli->errstr;
    exit;
}
if ($resp->faultCode()) {
    echo 'Fault Code: ' . $resp->faultCode() . "\n";
    echo 'Fault Reason: ' . $resp->faultString() . "\n";
} else {
    $val = $resp->value();
    $blocks = XML_RPC_decode($val);

     // now we print out the details....   
     printBlock( "result", $blocks );
     printBlock( "DetailsDO.CallsOK", $blocks );
     printBlock( "DetailsDO.CallsKO", $blocks );
}

// output a response block as HTML
function printBlock( $blockname, $blocks ) {
echo "<h2>Response block: $blockname </h2>";
echo "<table border=1>";
$block = $blocks[$blockname];
for ( $r = 0; $r < sizeof( $block ); $r++ ) {
echo "<tr>";
for ( $c = 0; $c < sizeof( $block[$r] ); $c++ ) {
echo( "<td>" . $block[$r][$c] . "</td>" );
}
echo "</tr>\n";
}
echo "</table>";
}

?>


--- End code ---

Please forgive the indenting - I am having some copy&paste problems.

Navigation

[0] Message Index

[#] Next page

Go to full version