Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Richarddb

Pages: [1] 2 3 4
1
Hi,

We only have the rdy agnt: on screen.



Normally we got the agent status on the wallboard but after the new queuemetrics installation we only get the ready agents.

and here the php script.

Quote
<?php
/*
  qmon.php
  Author: Barry Flanagan <barry AT flantel DOT com>
  Date: 21 Nov 2007
  Copyright Barry Flanagan 2007
 
  Small program to grab the calls waiting and Agent information for a given queue from the QueueMetrics XML-RPC service and
  create a simple display for use on a wallboard.

*/

$defaultqueue = 'inbound';

require_once 'XML/RPC.php';

$qm_server = "XXXXXXXXXXXX"; // the QueueMetrics server address
$qm_port   = "8080";        // the port QueueMetrics is running on
$qm_webapp = "queuemetrics"; // the webapp name for QueueMetrics
isset($_REQUEST['refresh'])?$refresh = $_REQUEST['refresh']:$refresh=5;
isset($_REQUEST['queue'])?$queuereq = $_REQUEST['queue']:$queuereq=$defaultqueue;

switch ($queuereq) {
  case 'inbound':
    $queueids = "9000|9001|9002|9003|9004|9005|9006|9007|9008|9009|9010|9011|9012|9013|9014|9015|q-123";
   $outboundqueue = '';
    $queuename='inbound';
    break;;

  case 'outbound':
    $queueids = "q-123";
    $outboundqueue = '';
    $queuename='outbound';
    break ;;
}

?>
<html><head><meta http-equiv="refresh" content="<?php echo $refresh ?>"><title><?php echo $queuename . " Wallboard" ?></title></head><body marginheight=0 marginwidth=0>
<table width="100%" cellpadding=0 cellspacing=0 border="0">
  <tr>
<?php



$queuelist = array_merge(explode("|", $queueids),explode("|",$outboundqueue));

// Choose the Realtime nethods we want to query.
$req_blocks_rt = new XML_RPC_Value(array(
      new XML_RPC_Value("RealtimeDO.RTCallsBeingProc"),
      new  XML_RPC_Value("RealtimeDO.RTAgentsLoggedIn"),
      new XML_RPC_Value("RealtimeDO.RTRiassunto")
           ), "array");

// initialize the XML_RPC call
$params_rt = array(
     new XML_RPC_Value($queueids),
           new XML_RPC_Value("robot"),
           new XML_RPC_Value("robot"),
           new XML_RPC_Value(""),
           new XML_RPC_Value(""),
           $req_blocks_rt
       );

// Make the XML_RPC call       
$msg_rt = new XML_RPC_Message('QM.realtime', $params_rt);
$cli_rt = new XML_RPC_Client("/$qm_webapp/xmlrpc.do", $qm_server,$qm_port);
//$cli_rt->setDebug(1);
$resp_rt = $cli_rt->send($msg_rt);
// Make sure it was successful
if (!$resp_rt) {
    echo 'Communication error: ' . $cli_rt->errstr;
    exit;
}
if ($resp_rt->faultCode()) {
    echo 'Fault Code: ' . $resp_rt->faultCode() . "\n";
    echo 'Fault Reason: ' . $resp_rt->faultString() . "\n";
} else {
    $val_rt = $resp_rt->value();
    $blocks_rt = XML_RPC_decode($val_rt);
   
    // now we decode the results
   
    // Get the Agents' Status
    $agent = getAgentLoggedIn( "RealtimeDO.RTAgentsLoggedIn", $blocks_rt );
    // Get all the current call details
    $agentStatus = getCurrentCalls( "RealtimeDO.RTCallsBeingProc", $blocks_rt);   
    // Get details of all the queue activity and store them in the $queue array
    getQueueStatus( "RealtimeDO.RTRiassunto", $blocks_rt, $queueids, $print);   
    // Output the html for the $queue array
    printQueues($queue);
   
}
   

// Get the current queue stats and place them into the $queue array
function getQueueStatus( $blockname, $blocks, $queueids, $print ) {
    global $queue, $queuelist, $ragents;
     $block = $blocks[$blockname];
     for ( $r = 1; $r < sizeof( $block ) ; $r++ ) {
       $currentQueue = $block[$r][1];
       if ( $currentQueue == "all selected") {
         $ragents = $block[$r][3];
//         continue;
        }

        // if this is a SubQueue, we need to put all the results into the Master Queue for display
       if (1 == substr_count($currentQueue,'.')) {
         list($masterqueue, $subqueue) = explode('.', $currentQueue);
         
         $currentQueue = $masterqueue;
         $queue[$currentQueue]['name'] =  $masterqueue;
         $queue[$currentQueue]['waiting'] =  $block[$r][7] + $queue[$currentQueue]['waiting'];
         $queue[$currentQueue]['nagents'] = $block[$r][2];
         $queue[$currentQueue]['ragents'] = $block[$r][3];
         $queue[$currentQueue]['incalls'] = $block[$r][8] + $queue[$currentQueue]['incalls'];         
         $queue[$currentQueue]['outcalls'] = $block[$r][9] + $queue[$currentQueue]['outcalls'];
         
         
       } else { // it is a normal queue
         $queue[$currentQueue]['waiting'] =  $block[$r][7];
         $queue[$currentQueue]['name'] =  $block[$r][1];
         $queue[$currentQueue]['nagents'] = $block[$r][2];
         $queue[$currentQueue]['ragents'] = $block[$r][3];
         $queue[$currentQueue]['incalls'] = $block[$r][8];       
         $queue[$currentQueue]['outcalls'] = $block[$r][9];       
       }
       // sometimes the maxholdtime is blank, fix it
      if($queue[$currentQueue]['maxholdtime'] == '') $queue[$currentQueue]['maxholdtime'] = '00:00';
     
      // If this is an Outbound queue it needs some special treatment
      if (preg_match('/utbound/', $currentQueue)) {
        $ragents = $queue[$currentQueue]['ragents'];
        $queue[$currentQueue]['waiting'] = '0';
        $queue[$currentQueue]['maxholdtime'] = '00:00';
      }
    }

// This function sorts the $data array of arrays by $field
function orderBy(&$data, $field) {
  $code = "return strnatcmp(\$a['$field'], \$b['$field']);";
  usort($data, create_function('$a,$b', $code));
}

// create the html output for the $queues array
function printQueues($queues) {
  orderBy($queues,'name');
  global $ragents;
  $tdwidth = round(100/sizeof($queues),1) . "%";
  foreach ( $queues as $queue  ) {
    // width for the tables
    $currentQueue = $queue['name'];
    if (1 == substr_count($currentQueue,'Master')) continue;
    $queueholdtime = $queue['maxholdtime'];
    $waitqueue = $queue['waiting'];
    $nagents = $queue['nagents'];
    $currcalls = $queue['incalls'] + $queue['outcalls'];
    $ragents = $queue['ragents'];
     
    // Set up colour and formatting  depending on the status of the queue
    if( $waitqueue == 0 ) {
      $waitbgcolor = "green";
      $snd = null;
      $waitfontcolor = "white";
    } elseif ($waitqueue == 1){
      $waitbgcolor = "yellow";
      $snd = '<EMBED SRC="/sounds/dingdong.wav" HIDDEN="true" AUTOSTART="true">';
      $waitfontcolor = "black";
    } elseif ($waitqueue > 1) {
      $waitbgcolor = "red";
      $snd = '<EMBED SRC="/sounds/ringer.wav" HIDDEN="true" AUTOSTART="true">';
      $waitfontcolor = "white";
      $waitqueue = "<blink>" . $waitqueue . "</blink>";
    }

    if( $ragents > 2 ) {
      $ragentsbgcolor = "green";
      $ragentsfontcolor = "white";
    } elseif ($ragents == 2){
      $ragentsbgcolor = "yellow";
      $ragentsfontcolor = "black";
    } elseif ($ragents <= 1) {
      $ragentsbgcolor = "red";
      $ragentsfontcolor = "white";
    }


    print <<<END
    <td width="$tdwidth" valign="top">
   <div style="border: 2px solid #FFF; width: 100%">
        <div width="100%" align="center" valign="center" style="color:white; font-size: 15px; background-color: green; height: 20px;">$currentQueue</div>
        <div style="background-color: grey; height:3px">&nbsp;</div>
        <div align="center" style="color:$waitfontcolor; font-size: 15px; background-color: $waitbgcolor; ">Calls Waiting</div>
          <div align="center" style="color:$waitfontcolor; font-size: 70px; background-color: $waitbgcolor; ">$waitqueue</div>
        <div align="center" style="color:$waitfontcolor; font-size: 15px; background-color: $waitbgcolor; ">Max $queueholdtime</div>          
        <div style="background-color: grey; height:3px">&nbsp;</div>
        <div align="center" style="color:white; font-size: 15px; background-color: green">Curr Calls:</div>
        <div align="center" style="color:white; font-size: 70px;  background-color: green">$currcalls</div>
         <div style="background-color: grey; height:3px">&nbsp;</div>
          <div align="center" style="color:$ragentsfontcolor; font-size: 20px; background-color: $ragentsbgcolor">Rdy Agnt: $ragents/$nagents</div>
<!--        <div align="center" style="color:$ragentsfontcolor; font-size: 70px; background-color: $ragentsbgcolor">$ragents </div> -->

     </div>
      </td>
END;
    }
  }
}

// Get the actual status of each agent
function getAgentLoggedIn( $blockname, $blocks ) {
    $agent = array();
    $block = $blocks[$blockname];
     for ( $r = 1; $r < sizeof( $block ) ; $r++ ) {
       $agent[$block[$r][1]]['name'] = $block[$r][1];
       $agent[$block[$r][1]]['lastlogin'] = $block[$r][3];
       $agent[$block[$r][1]]['queues'] = $block[$r][4];
       $agent[$block[$r][1]]['extension'] = $block[$r][5];
       $agent[$block[$r][1]]['onpause'] = $block[$r][6];
       $agent[$block[$r][1]]['srv'] = $block[$r][7];
       $agent[$block[$r][1]]['lastcall'] = $block[$r][8];
       $agent[$block[$r][1]]['onqueue'] = $block[$r][9];
       $agent[$block[$r][1]]['caller'] = 'none';
       $agent[$block[$r][1]]['entered'] = null;
       $agent[$block[$r][1]]['waiting'] = null;
       $agent[$block[$r][1]]['duration'] = null;
      }
    return $agent;

}

// Get the current call details for each agent or call waiting
function getCurrentCalls( $blockname, $blocks) {
    global $agent, $queue;
    $block = $blocks[$blockname];
     for ( $r = 1; $r < sizeof( $block ) ; $r++ ) {
       $agentname = $block[$r][6];
       $agent[$agentname]['queue'] = $block[$r][1];
       $agent[$agentname]['caller'] = $block[$r][2];
       $agent[$agentname]['entered'] = $block[$r][3];
       $agent[$agentname]['waiting'] = $block[$r][4];
       $agent[$agentname]['duration'] = $block[$r][5];
        if ($agent[$agentname]['duration'] == '-') {
          if (1 == substr_count($agent[$agentname]['queue'],'.')) {
            list($agent[$agentname]['queue'], $subqueue) = explode('.', $agent[$agentname]['queue']);
          }

          if (toSec($agent[$agentname]['waiting']) > toSec($queue[$agent[$agentname]['queue']]['maxholdtime'])) $queue[$agent[$agentname]['queue']]['maxholdtime'] = $agent[$agentname]['waiting'] ;
        }       
      }
      $agentStatus = '';
      $rowcount=1;
      for  ( $r = 0; $r < sizeof( $agent ) ; $r++ ) {
        $agent = array_values($agent);
        if ($rowcount == 1){
          $rowcolor = "green";
          $rowcount++;
        } elseif ($rowcount == 2) {
          $rowcolor = "gray";
          $rowcount = 1;
        }

        // get the last call time for the agent, and convery to epoc time
        if (strstr($agent[$r]['lastcall'],':')) {
          list($h, $m, $s) = explode(':', $agent[$r]['lastcall']);
          $lastcalltime = mktime($h,$m,$s);
        }
        // decide on the agent status we should display       
        if ($agent[$r]['duration'] != '') {
          $status = "On Call since " . $agent[$r]['entered'] . " (" . $agent[$r]['duration'] . " mins)";
          $bgcolor3 = $rowcolor;
          $fontcolor3 = "white";
        } elseif (!preg_match('/-/',$agent[$r]['onpause'])){
          $status = "On Pause since " . $agent[$r]['onpause'];
          $bgcolor3 = $rowcolor;
          $fontcolor3 = "white";
        } elseif (time() - $lastcalltime  < 5) {
          $status = "Wrapping up";
          $bgcolor3 = $rowcolor;
          $fontcolor3 = "white";
        } else {
          $status = "Available";
          $bgcolor3 = $rowcolor;
          $fontcolor3 = "white";
        }
        if ($agent[$r]['name']) {
          $agentStatus .="<tr bgcolor=\"" . $rowcolor . "\" style=\"color:white; font-size: 20px;\"><td>&nbsp;</td><td>" . $agent[$r]['name'] . "</td><td style=\"color:" . $fontcolor3 . ";\" bgcolor=\"" . $bgcolor3 . "\" >" . $status .  "</td><td>" . $agent[$r]['lastcall'] .  "</td><td>" . $agent[$r]['queue'] . "</td></tr>";
        }
      }
    return $agentStatus;
}

// function to convert 00:00:00 time to seconds.
function toSec ($hms) {
      list($h, $m, $s) = explode (":", $hms);
      $seconds = 0;
      $seconds += (intval($h) * 3600);
      $seconds += (intval($m) * 60);
      $seconds += (intval($s));
      return $seconds;
}


?>

</tr><tr><td>&nbsp;</td></tr><tr>
<!-- Agent Status Table -->
<td colspan=20 bgcolor="gray" valign="top">
<table  width="100%" height="100%" cellpadding=0 cellspacing=0 style="border: 2px solid #000">
  <tr style="color:white; font-size: 25px;">
    <td>&nbsp;</td><td>Agent</td><td>Status</td><td>Last Call</td><td>Current Queue</td>
  </tr>
  <?php echo $agentStatus ?>
</table>

</td>

</table>
</body>
</html>



2
Hi,

we have reinstalled queuemetrics but we are using dynamic agents now. How can I get the agent status back on the wallboard.

3
CentOS release 5.7 (Final)

mysql  Ver 14.14 Distrib 5.5.18, for Linux (i686) using readline 5.1

4
Hi,
I am installing qloaderd but I am getting the message that it needs a other mysql version. Is there a another qloaderd verion for mysql 5.5 or do I have to downgrade my mysql ?

mysqld  Ver 5.5.18-log for Linux on i686 (MySQL Community Server (GPL))

yum install qloaderd

Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package qloaderd.noarch 0:1.27-22 set to be updated
--> Processing Dependency: libdbi-dbd-mysql for package: qloaderd
--> Running transaction check
---> Package libdbi-dbd-mysql.i386 0:0.8.1a-1.2.2 set to be updated
--> Processing Dependency: libdbi-drivers = 0.8.1a-1.2.2 for package: libdbi-dbd-mysql
--> Processing Dependency: libmysqlclient.so.15(libmysqlclient_15) for package: libdbi-dbd-mysql
--> Processing Dependency: libmysqlclient.so.15 for package: libdbi-dbd-mysql
--> Running transaction check
---> Package libdbi-drivers.i386 0:0.8.1a-1.2.2 set to be updated
--> Processing Dependency: libdbi >= 0.8 for package: libdbi-drivers
---> Package mysql.i386 0:5.0.95-1.el5_7.1 set to be updated
--> Running transaction check
---> Package libdbi.i386 0:0.8.1-2.1 set to be updated
--> Processing Conflict: mysql conflicts MySQL
--> Finished Dependency Resolution
mysql-5.0.95-1.el5_7.1.i386 from update has depsolving problems
  --> mysql conflicts with MySQL-server
Error: mysql conflicts with MySQL-server
 You could try using --skip-broken to work around the problem
 You could try running: package-cleanup –problems
                        package-cleanup –dupes
                        rpm -Va --nofiles –nodigest
The program package-cleanup is found in the yum-utils package.

5
QueueMetrics installation / Queuemetrics on a 64 bits environment
« on: November 21, 2011, 11:32:32 »
Hi,
We are going to reinstall the voip servers. Are there any problems with Queuemetrics on a 64 bits environment??

6
MySQL storage and Qloaderd/Uniloader / Re: Qloaderd missing data
« on: October 25, 2011, 13:09:12 »
Hi,

We already solved the problem now. There was a problem with the rights in the script. Besides that, the script was directing to the wrong database.

7
MySQL storage and Qloaderd/Uniloader / Re: Qloaderd missing data
« on: October 14, 2011, 15:59:41 »
Hi,

Is there anyone who know a solution for this problem. The report of last month is incomplete.

8
MySQL storage and Qloaderd/Uniloader / Re: Qloaderd missing data
« on: October 07, 2011, 17:06:57 »
After we used the link you mentioned above, it does delete the information but it doesn't reload it into the database. It means we now miss even more data then before.

Do you have a solution for this?

root@enovpbx1 qloader]# ./queuePartialUpdater.pl /var/log/asterisk/queue_log.4 P001 /var/log/qlog.log
|QueueMetrics Partial Queue Database Updater - $Revision: 1.4 $
|Removing items from time id 1317607324 to 1317693107 for partition P001
|Moving items with timestamp greater than 1317693107 for partition P001
|Calling ./qloader.pl -h 127.0.0.1 -d queuemetrics -u queuemetrics -p javadude /var/log/asterisk/queue_log.4 P001 /var/log/qlog.log 1
|Restoring items with timestamp greater than 1317693107 into partition P001
|QueueMetrics Partial Queue Database Updater – terminating



9
MySQL storage and Qloaderd/Uniloader / Re: Qloaderd missing data
« on: October 07, 2011, 11:37:22 »
This is our partition information, P001 is the partition we always used and are still using.


The current storage info:

Partition                 Entries                 N. calls   From:                       To:                               Days of data:    Last heartbeat:   
P001                      1.132.473 1         30.822   2008-12-15 12:16   2011-10-07 10:29        1.026,1 days   2011-10-07 10:29

10
MySQL storage and Qloaderd/Uniloader / Re: Qloaderd missing data
« on: October 06, 2011, 11:33:04 »
The script is not working. When we run a report in queuemetrics we are still missing the same days.

./queuePartialUpdater.pl /var/log/asterisk/queue_log.10 P001 /var/log/qlog.log

[root@enovpbx1 qloader]# ./queuePartialUpdater.pl /var/log/asterisk/queue_log.9 P001 /var/log/qlog.log |QueueMetrics Partial Queue Database Updater - $Revision: 1.4 $
|Removing items from time id 1317088925 to 1317174707 for partition P001
|Moving items with timestamp greater than 1317174707 for partition P001
|Calling ./qloader.pl -h 127.0.0.1 -d queuemetrics -u queuemetrics -p javadude /var/log/asterisk/queue_log.9 P001 /var/log/qlog.log 1
|Restoring items with timestamp greater than 1317174707 into partition P001
|QueueMetrics Partial Queue Database Updater - terminating

11
Realtime Live / Call unanswered is still in QM after disconnecting
« on: October 04, 2011, 13:22:58 »
Hi all,

We have the following issue:

In the morning there was a phonecall and was directly ended. Since that time the call is still 'unanswered yet' in Queuemetrics (more then 5 hours now).  How can we end this call in Queuemetrics? I don't see an option in the detail screen for this call. It's in the unanswered detail page.

Thanks in advance.

12
MySQL storage and Qloaderd/Uniloader / Qloaderd missing data
« on: September 30, 2011, 09:58:57 »
Hi all,

A week ago we had to fail over to the other pbx and we forgot to start the qloaderd service. The database is missing one day of data. My question is if we can use the ./loadAllQueueLogFiles.sh script to load the missing data into the database.

Qloaderd version 1.22-16

13
Running QueueMetrics / Re: Communication error on wallboard
« on: January 31, 2011, 11:43:22 »
I sent you a message with the link.

14
Running QueueMetrics / Re: Communication error on wallboard
« on: January 27, 2011, 16:51:20 »
Is this an option?

15
Running QueueMetrics / Re: Queue details export in Excel
« on: January 27, 2011, 16:24:30 »
It worked, thank you for the help!

Pages: [1] 2 3 4