Author Topic: Wallboard Example script  (Read 41191 times)

clara

  • Newbie
  • *
  • Posts: 10
  • Karma: 0
    • View Profile
Re: Wallboard Example script
« Reply #15 on: April 08, 2008, 16:54:04 »
Hello,

Does somebody have following error?

Fault Code: 2 Fault Reason: Invalid return payload: enabling debugging to examine incoming payload


Thanks

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: Wallboard Example script
« Reply #16 on: April 10, 2008, 12:41:50 »
Where do you get that? in PHP?

clara

  • Newbie
  • *
  • Posts: 10
  • Karma: 0
    • View Profile
Re: Wallboard Example script
« Reply #17 on: April 10, 2008, 16:23:57 »
Yes, the fault is generated by the following php code:

 echo 'Fault Code: ' . $resp_rt->faultCode() . "\n";


kayodea

  • Newbie
  • *
  • Posts: 21
  • Karma: 0
    • View Profile
Re: Wallboard Example script
« Reply #18 on: August 14, 2008, 13:03:15 »
I tested this script today and all went well, except that nothing is happening or displayed as expected at the "Calls Waiting" and the "Agents Status" area. I could see a display of Agents logged on/Available or on a call below as expected.

Please can anyone point me to what am doing wrong or still need to do. Here is my script;

$defaultqueue = 'CustomerCare';

// Allow setting of the queue to monitor, and the refresh time.
isset($_REQUEST['refresh'])? $refresh = $_REQUEST['refresh'] : $refresh=10;
isset($_REQUEST['queue'])?$queureq = $_REQUEST['queue']:$queuereq=$defaultqueue;

$queueid = "4000";
$queuename = 'Customer Care';

// 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 = "queue"; // the webapp name for QueueMetricsi

$req_blocks_rt = new XML_RPC_Value(array(
                 new XML_RPC_Value("RealtimeDO.RTRiassunto"),
                 new XML_RPC_Value("RealtimeDO.RTCallsBeingProc"),
                 new  XML_RPC_Value("RealtimeDO.RTAgentsLoggedIn")
                 ), "array");
// general invocation parameters. Set the USER and PASSWORD to a QM user with ROBOT key
$params_rt = array(
           new XML_RPC_Value($queueid),
      new XML_RPC_Value("wallboard"),
           new XML_RPC_Value("abcd12345"),
           new XML_RPC_Value(""),
           new XML_RPC_Value(""),
           $req_blocks_rt
       );


as you can see, I am monitoring only one queue, so I don't need the switch statement. I hope am right?

Cheers to All.

scooby2

  • Newbie
  • *
  • Posts: 30
  • Karma: 0
    • View Profile
Re: Wallboard Example script
« Reply #19 on: August 31, 2008, 07:24:09 »
I tested this script today and all went well, except that nothing is happening or displayed as expected at the "Calls Waiting" and the "Agents Status" area. I could see a display of Agents logged on/Available or on a call below as expected.
I'm getting the same thing so I am thinking something with the XML changed. I will post if I get it figured out. I plan on taking a deeper look when I get a chance.

kayodea

  • Newbie
  • *
  • Posts: 21
  • Karma: 0
    • View Profile
Re: Wallboard Example script
« Reply #20 on: September 09, 2008, 15:00:35 »
Hi ALL,

Any clue on getting this resolved. 

Regards.

Bevort

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
    • View Profile
    • Email
Re: Wallboard Example script
« Reply #21 on: September 11, 2008, 09:05:21 »
Hi kayodea

I work with the 2ns example from byronsmith because we like the layout.

I found some write errors in parts of the code

He uses
Code: [Select]
$queue['All selected']['nagents']It must be
Code: [Select]
$queue['all selected']['nagents']
In the HTML part I replaced the $nagents wit $queue['all selected']['nagents'] to get some 1st results.
this workes but only with 1 queue
I made equal changes to the other 2 number parts

I am still working more on it but get results now

Hope this helps

scooby2

  • Newbie
  • *
  • Posts: 30
  • Karma: 0
    • View Profile
Re: Wallboard Example script
« Reply #22 on: September 12, 2008, 06:15:50 »
Thanks Bevort. That helps the bottom part.

It appears at least with 1.4.6 that RTCallsBeingProc is not working or this script does not use it right. Anyone using one of these scripts and 1.4.6 with success?

moa

  • Newbie
  • *
  • Posts: 27
  • Karma: 1
    • View Profile
Re: Wallboard Example script
« Reply #23 on: September 24, 2008, 17:32:06 »
RTCallsBeingProc is working just fine after the upgrade from 1.4.2 to 1.4.7 last night.  I did have to do Bevorts change with the "all selected" case.  Here's the code for RTCallsBeingProc:
Here's the call to it:
Code: [Select]
$agentStatus = getCurrentCalls( "RealtimeDO.RTCallsBeingProc", $blocks_rt, $agent );
And here is getCurrentCalls
Code: [Select]
function getCurrentCalls( $blockname, $blocks, $agent ) {
    global $agent;
    $block = $blocks[$blockname];
     for ( $r = 1; $r < sizeof( $block ) ; $r++ ) {
       $agent[$block[$r][6]]['caller'] = $block[$r][2];
       $agent[$block[$r][6]]['entered'] = $block[$r][3];
       $agent[$block[$r][6]]['waiting'] = $block[$r][4];
       $agent[$block[$r][6]]['duration'] = $block[$r][5];
       $agent[$block[$r][6]]['queue'] = $block[$r][1];
      }
      $agentStatus = '';
      $rowcount=1;
      for  ( $r = 0; $r < sizeof( $agent ) ; $r++ ) {
        $agent = array_values($agent);
        if ($rowcount == 1){
          $rowcolor = "lightgray";
          $rowcount++;
        } elseif ($rowcount == 2) {
          $rowcolor = "white";
          $rowcount = 1;
        }
        if ($agent[$r]['duration'] != '') {
          $status =  $agent[$r]['entered'] . " Call " . " (" . $agent[$r]['duration'] . ")";
          $bgcolor3 = $rowcolor;
          $fontcolor3 = "maroon";
          $blinkon = '';
          $blinkoff = '';
        }
        elseif ($agent[$r]['onpause'] != '-') {
          $pauseTime=substr_replace($agent[$r]['onpause'],"",5);
          $pauseWhat=substr_replace($agent[$r]['onpause'],"",0,6);
          $pauseDuration = time() - strtotime($pauseTime);
          if($pauseWhat == "Break" && sec2hms($pauseDuration) > "0:10:00"){
          $status = $agent[$r]['onpause'] . " (". sec2hms($pauseDuration) .")";
          $bgcolor3 = $rowcolor;
            $fontcolor3 = "red";
            $blinkon = '<blink>';
            $blinkoff = '</blink>';
          }elseif($pauseWhat == "Lunch" && sec2hms($pauseDuration) >= "0:60:00"){
          $status = $agent[$r]['onpause'] . " (". sec2hms($pauseDuration) .")";
          $bgcolor3 = $rowcolor;
            $fontcolor3 = "red";
            $blinkon = '<blink>';
            $blinkoff = '</blink>';
          }elseif($pauseWhat == "ACW" && sec2hms($pauseDuration) >= "0:01:00"){
          $status = $agent[$r]['onpause'] . " (". sec2hms($pauseDuration) .")";
          $bgcolor3 = $rowcolor;
            $fontcolor3 = "red";
            $blinkon = '<blink>';
            $blinkoff = '</blink>';
          }elseif($pauseWhat == "Meeting" && sec2hms($pauseDuration) >= "0:60:00"){
          $status = $agent[$r]['onpause'] . " (". sec2hms($pauseDuration) .")";
          $bgcolor3 = $rowcolor;
            $fontcolor3 = "blue";
            $blinkon = '';
            $blinkoff = '';
          }elseif($pauseWhat == "Extra Duties" && sec2hms($pauseDuration) >= "0:10:00"){
          $status = $agent[$r]['onpause'] . " (". sec2hms($pauseDuration) .")";
          $bgcolor3 = $rowcolor;
            $fontcolor3 = "red";
            $blinkon = '<blink>';
            $blinkoff = '</blink>';
          }
          else{
          $status = $agent[$r]['onpause'] . " (". sec2hms($pauseDuration) .")";
          $bgcolor3 = $rowcolor;
          $fontcolor3 = "blue";
          $blinkon = '';
          $blinkoff = '';
        }
        }
       
       
         else {
          $status = "Available";
          $bgcolor3 = $rowcolor;
          $fontcolor3 = "black";
          $blinkon = '';
          $blinkoff = '';
        }
            $agentStatus .="<tr bgcolor=\"" . $rowcolor . "\" style=\"color:black; font-size: 30px;\"><td>&nbsp;</td><td style=\"color:" . $fontcolor3 . ";\" bgcolor=\"" . $bgcolor3 . "\" >".$blinkon."" . $agent[$r]['name'] . "".$blinkoff."</td><td style=\"color:" . $fontcolor3 . ";\" bgcolor=\"" . $bgcolor3 . "\" >".$blinkon."" . $status .  "".$blinkoff."</td><td>" . $agent[$r]['queue'] . "</td><td>" . substr_replace($agent[$r]['caller'],"",10) . "</td></tr>";
     
      }
     
    return $agentStatus;
}



Most of it is the original code from Barry.  You might notice I added extra stuff to handle the techs on pause.  It makes the text start blinking if they take to long of a break.  I hope this helps.

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: Wallboard Example script
« Reply #24 on: September 25, 2008, 10:57:59 »
Cool man!

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: Wallboard Example script
« Reply #25 on: October 06, 2008, 09:39:06 »
Anybody wants to contribuite this script to the "QueueMetrics add-ons" collection? see http://forum.queuemetrics.com/index.php?board=14.0

moa

  • Newbie
  • *
  • Posts: 27
  • Karma: 1
    • View Profile
Re: Wallboard Example script
« Reply #26 on: October 27, 2008, 22:18:44 »
 ???

Quick question, has anyone figured out how to make the function getAgentLoggedIn(); only return the agents that are logged into the requested queues ?  I've got four different wallboards, one for each department.  Only problem is it shows every person that is logged into the phones, it doesn't matter if they are associated with the department queues or not.

moa

  • Newbie
  • *
  • Posts: 27
  • Karma: 1
    • View Profile
Re: Wallboard Example script
« Reply #27 on: October 27, 2008, 22:40:02 »
Well, guess I should try a few things before I post.  Here's a quick and dirty way:

Code: [Select]
function getAgentLoggedIn( $blockname, $blocks ) {
    $agent = array();
    $block = $blocks[$blockname];
     for ( $r = 1; $r < sizeof( $block ) ; $r++ ) {
      //$queues = $block[$r][4];
      if($block[$r][4])
      {
       $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'] = '----------';
       $agent[$block[$r][1]]['entered'] = null;
       $agent[$block[$r][1]]['waiting'] = null;
       $agent[$block[$r][1]]['duration'] = null;
       }
      }
    return $agent;
}


QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: Wallboard Example script
« Reply #28 on: October 28, 2008, 09:43:38 »
Really man, why not contribute the script to the sourceforge project? :)

moa

  • Newbie
  • *
  • Posts: 27
  • Karma: 1
    • View Profile
Re: Wallboard Example script
« Reply #29 on: October 30, 2008, 18:39:28 »
Really man, why not contribute the script to the sourceforge project? :)


No one has contributed this yet?  I'll contribute it once I figure out this last problem.  Here's the issue:

We have queueA and queueB, splitting those up is easy.  But when you have a supervisor that is logged into both queues.  And he/she is on a call on queueA, he is showing up available on the queueB page.  I'm assuming that this has to do with QM and how it displays the users on the realtime stats page.  Any suggestions ?