Table of Contents

QueueMetrics Integration

QueueMetrics by Loway lets you monitor agent productivity, measure targets, conversion rates, and view campaign statistics with a simple easy to use interface.
It should work with most versions of AstLinux however a relatively recent version is recommended.

Note -> This guide is for a separate 'Off Box' installation only 1). It also does not go into detail on the setting up of Queue Metrics itself. This guide needs to be read in conjunction with the QueueMetrics documentation found Here.

QueueMetrics Server Build

Although QueueMetrics can be built on any Linux distribution, it is easiest and recommended on an RPM-based distribution. This guide was created using QueueMetrics version 19.10.
The following steps were performed on a Centos 7 Minimal Install. Note that only QueueMetrics related configuration has been included:

Prerequisites

Make sure you have a demo or purchased License Key from Loway before you start.
It is also recommended that you create and record passwords for MYSQL Root and Uniloader users and the QueueMetrics AMI user.

Install Application

yum install wget nano
wget -P /etc/yum.repos.d http://yum.loway.ch/loway.repo
yum install queuemetrics

Set up MYSQL (MariaDB)

systemctl enable mariadb
systemctl stop mariadb
mysqld_safe --skip-grant-tables --skip-networking &
mysql -u root
  FLUSH PRIVILEGES;
  SET PASSWORD FOR 'root'@'localhost' = PASSWORD('** New MYSQL Root Password **');
  Exit
reboot

Disable Firewall

The firewall will block the QueueMetrics 8080 Web GUI port by default. You can open this up in IP Tables or disable the firewall altogether as done below.
Note -> This should only be done if the server is suitably protected behind a firewall on an internal LAN.

systemctl disable firewalld
systemctl stop firewalld

Set up Uniloader User

The Uniloader application running on the AstLinux server accesses MYSQL directly on the QueueMetrics server.

mysql -uroot -p	-> enter root password created above
  CREATE USER 'queuemetrics'@'%' IDENTIFIED BY '** Uniloader Password **';
  GRANT ALL PRIVILEGES ON queuemetrics . * TO 'queuemetrics'@'%';
  FLUSH PRIVILEGES;
exit

AstLinux Setup

There are two integration points for QueueMetrics into Asterisk being the Asterisk manager Interface (AMI) and queue_log file.

Logging Queue events needs to be enabled in logger.conf with:

queue_log = yes

Configure AMI Access

Add the following into Asterisk manager.conf

[queuemetrics]
secret = ** password **
deny = 0.0.0.0/0.0.0.0
permit = ** QM Server IP Address **/255.255.255.255  ; not needed for QM Live (hosted)
permit = 127.0.0.1/255.255.255.255	             ; <- This is necessary for access by the Unitracker for outgoing calls
read = system,call,log,verbose,command,agent,user,originate
write = system,call,log,verbose,command,agent,user,originate

Perform module reload manager in Asterisk.

Uniloader and Unitracker Installation

The Uniloader dynamically pushes data from the queue_log file to the QueueMetrics Database. The Unitracker (incorporated within the Uniloader application), captures outgoing call events and other events e.g. Park, MoH from the AMI and also feeds them into the QueueMetrics database.

Download the uniloader file from: www.queuemetrics-live.com/uniloader and extract the uniloader_amd64 file into /mnt/kd/bin (create if required).

The following init script /mnt/kd/bin/uniloaderd is used to start and stop the two processes:

#!/bin/sh
  
init () {
  :
}

start () {
  ## Add information as required ##
  echo "Starting uniloader and unitracker ..."
  nohup nice /mnt/kd/bin/uniloader -s /var/log/asterisk/queue_log upload --uri "mysql:tcp(** AstLinux IP Address **:3306)/queuemetrics?allowOldPasswords=1" \
  --login queuemetrics --pass ** Uniloader Password ** --token P001 >> /var/log/uniloader.log &
  nohup nice /mnt/kd/bin/uniloader track --host "** AstLinux IP Address **" --port "5038" --login queuemetrics --secret ** AMI Password ** --outboundcalls "1" --parkedcalls "1" >> /var/log/uniloader.log &
}

stop () {
  echo "Stopping uniloader and unitracker ..."
  killall uniloader >/dev/null 2>&1
}

case $1 in

start)
  start
  ;;

stop)
  stop
  ;;

init)
  init
  start
  ;;

restart)
  stop
  sleep 2
  start
  ;;

*)
  echo "Usage: start|stop|restart"
  ;;

esac

Add /mnt/kd/bin/uniloaderd init to /mnt/kd/rc.local and /mnt/kd/bin/uniloaderd stop to /mnt/kd/rc.local.stop. Create if required!
Remember to make all the files executable.

View /var/log/uniloader.log for status and errors after completing the QueueMetrics Initial Setup below.

QueueMetrics Initial Setup

Update Configuration File

Update the XML configuration file /usr/local/queuemetrics/webapps/queuemetrics-18.04.1-493/WEB-INF/web.xml as follows:

<init-param>
          <param-name>LICENZA_ARCHITETTURA</param-name>
          <param-value>** new license key **</param-value>
</init-param>
<param-value>jdbc:mariadb://127.0.0.1/queuemetrics?user=queuemetrics&amp;password=** Uniloader Password **&amp;sessionVariables=sql_mode=''&amp;autoReconnect=true</param-value>

Set up Database

Browse to QueueMetrics_Server_IP:8080/queuemetrics and you will be forwarded to the initial setup screen after an initial error screen.
Add the new root password, accept the agreements and Create Database. Note that the user credentials should have been populated from the web.xml config step above.

Update AMI in System Parameters

There may be a number of system parameters that are required for your installation however this one is always required.
Log into the QueueMetrics Web GUI with demoadmin:demo and select Edit System Parameters.
Update the following parameter:

callfile.dir=tcp:queuemetrics:** AMI Password**@** AstLinux IP Address **

Log out then back in again to update the settings

QueueMetrics Configuration

The configuration of QueueMetrics is not covered in the guide. Please see the QueueMetrics documentation found Here

QueueMetrics Live - Hosted Solution

To use the QueueMetrics Live Hosted Solution the start () section of the qloaderd init script has to be changed like this:

start () {
  ## Add information as required ##
  echo "Starting uniloader and unitracker ..."
  nohup nice /mnt/kd/bin/uniloader -s /var/log/asterisk/queue_log --cacert "/usr/lib/ssl/cert.pem" upload --uri "https://my.queuemetrics-live.com/** Your QM instance name **" \
  --login webqloader --pass "<password of the wqloader QM user>"  >> /var/log/uniloader.log &
  nohup nice /mnt/kd/bin/uniloader track --host "127.0.0.1" --port "5038" --login queuemetrics --secret "<AMI Password>" --outboundcalls "1" --parkedcalls "1" >> /var/log/uniloader.log &
}




1)
at the end of this page you'll also find the changes needed for a hosted QM Live solution