QueueMetrics > Scripting QueueMetrics

Wallboard Example script

<< < (3/10) > >>

byronsmith:
Hello,

Not sure if anyone was interested, I made a few slight adjustments and a few colour/design changes.

http://my.computr.co.uk/downloads/qmon.txt (to change queuename use qmon.php?queue=queueone|queuetwo|queuethree etc)
http://my.computr.co.uk/downloads/style.css.txt

http://my.computr.co.uk/downloads/image1.jpg
http://my.computr.co.uk/downloads/image2.jpg
http://my.computr.co.uk/downloads/image3.jpg

I also found I had the same error that moa had with Xerces, basically followed the instructions and viola, it all worked. I have Queuemetrics 1.4.2

Another problem I found was:

$params_rt = array(
           new XML_RPC_Value($queuename),
           new XML_RPC_Value("USER"),
           new XML_RPC_Value("PASSWORD"),
           new XML_RPC_Value(""),
           new XML_RPC_Value(""),
           $req_blocks_rt
       );

Where $queuename was $queueid but after changing it to $queuename it worked for me... no idea why.

Anyway,

Enjoy.
Byron

QueueMetrics:
Looks really cool!  :D
the value you pass in the XML-RPC call is the queue_id in Asterisk (that is the 'raw' queue name) or a set of queue names, pipe separated (eg q1|q2|q3)
Thanks!

barryf:

--- Quote from: byronsmith on February 14, 2008, 14:33:21 ---
Another problem I found was:

$params_rt = array(
           new XML_RPC_Value($queuename),
           new XML_RPC_Value("USER"),
           new XML_RPC_Value("PASSWORD"),
           new XML_RPC_Value(""),
           new XML_RPC_Value(""),
           $req_blocks_rt
       );

Where $queuename was $queueid but after changing it to $queuename it worked for me... no idea why.


--- End quote ---

That's because you took out the switch statement:

// 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 ;;
}


I use this so that I can pass a queue GET parameter such as "inbound" which then sets
$queueid= "401|402|403|404|405|406|407|408|409|410|411|412";

which contains the real Asterisk queue names separated by pipes, and also sets $queuename for display at the top.

-Barry Flanagan

byronsmith:
Hi Barry,

For sure, I realised what your switch/case was for but I didn't need it in my case. Apologies if it looked like what I did made it seem as if the code broke, this was not the case, in fact the truth is when I used the queue id's in the query string it didn't work, using the queue names it did work in my case, hence the reason for bringing up the $queueid and $queuename etc.

Anyways, the many thing is it works and all that is thanks to your efforts, many thanks.

Regards
Byron

Roque:
The screen shots look great.  But where does this script go (directory) or is it appended into an existing script?  How does it get called?
Thanks in advance!
-Roque

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version