In this example, we will show how to install QueueMetrics on the same server using MySQL storage and configure everything to have a working system. Setting things up should require about 30 minutes.
QueueMetrics is a fully-fledged call center monitoring solution - see http://queuemetrics.com . It is an industry-proven, commercial product that is available free of charge to smaller call centers, home users and SOHO’s and is used in a large number of call centers worldwide, including installations with hundreds of agents online.
If you have a SSH client or can access the system console (i.e. the attached keyboard and monitor, if any), log in as user root with password password (you entered the password during system installation).
If not, you should install the Java SSH client - see Common problems and solutions at the end of this tutorial.
After logging in as root, type the follwing commands:
wget -P /etc/yum.repos.d http://yum.loway.ch/loway.repo yum install queuemetrics
The yum command will download QueueMetrics and all of its dependencies and install it on your system. This may take a while, depending on your internet connection speed. When asked to confirm the installation, type "y" to proceed.
After the installation is complete, you have to install the sample MySQL database that will be used to initialize the system, by executing the following commands:
cd /usr/local/queuemetrics/webapps/queuemetrics-1.6.1/WEB-INF/README ./installDb.sh
Note that the exact directory to use will depend on the QueueMetrics version being installed and is displayed on the last page of output that yum produces. Follow the on-screen instructions (it is a matter of typing in a couple of passwords as detailed by the installDb utility itself) and the database will be created.
| Tip | |
|---|---|
For your convenience, remember that the default MySQL password for TB is "passw0rd" (that’s a zero!) and the suggested default DB password for QueueMetrics is "javadude". |
| Tip | |
|---|---|
For your convenience, remember that the default AsteriskNOW installation has empty default MySQL password and the suggested default DB password for QueueMetrics is "javadude". |
QueueMetrics comes with a user-modifiable Asterisk context that should be included in the main Asterisk context to provide additional functionalities, like e.g. automated agent log-ons and many more.
Run the following commands:
cd /usr/local/queuemetrics/webapps/queuemetrics-1.6.1/WEB-INF/ cp mysql-utils/extensions-examples/extensions_queuemetrics.conf /etc/asterisk
Then you should edit the file /etc/asterisk/extensions_custom.conf as shown in the picture by issuing the command:
nano /etc/asterisk/extensions_custom.conf

Basically you should add a line that reads:
#include extensions_queuemetrics.conf
This will be picked up by Asterisk on the next reload.
Edit the configuration.properties file of QueueMetrics:
cd /usr/local/queuemetrics/webapps/queuemetrics-1.6.1/WEB-INF/ nano configuration.properties
Look for the following properties within the file and change them accordingly:
default.queue_log_file=sql:P001 callfile.dir=tcp:admin:amp111@127.0.0.1 default.rewriteLocalChannels=true callfile.agentlogin.enabled=false callfile.agentlogoff.enabled=false default.hotdesking=86400
These changes mean:
To test that everything is fine, you’ll have to point your browser to the address http://myserver:8080/queuemetrics and you should see a screen like the following one.

If you see this screen, you know that QueueMetrics is working fine. As you’ll be curious to check it out, you can login as user demoadmin password demo.
If you run on Asterisk 1.6, you also need to give the "originate" permission to QueueMetrics:
nano /etc/asterisk/manager.conf
Add the "originate" permission in both "read" and "write" lines:
[admin] secret = amp111 deny=0.0.0.0/0.0.0.0 permit=127.0.0.1/255.255.255.0 read = system,call,log,verbose,command,agent,user,originate write = system,call,log,verbose,command,agent,user,originate
Save and exit.
In this example, we’ll keep a copy of the statistics provided by Asterisk on a database table, this offers a number of advantages:
This can be obtained very easily by entering:
yum install qloaderd
| Note | |
|---|---|
When installing on AsteriskNOW, a warning message will be shown as reported below. Confirm the message with y to continue. |
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897 Importing GPG key 0xE8562897 "CentOS-5 Key (CentOS 5 Official Signing Key) <centos-5-key@centos.org>" from /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 Is this ok [y/N]: y
After it’s done, you can test that the resident loaderd is working by issuing the following command:
tail /var/log/asterisk/qloaderd.log
If you see a log file that shows no errors, you’re done.

After this, do not forget to tun off the log rotation for the /var/log/asterisk/queue_log file, or the logs enclosing your precious queue data will be periodically deleted.
See Common problems and solutions at the end of this tutorial to turn off log rotation.
Installing on a different server can be a good idea if your call center has over 20 or 30 agents and you don’t want to slow down the main Asterisk box when running statistics.
It’s very easy to do:
When you’re done, go to the TrixBox server and edit the file /etc/sysconfig/qloaderd.
It should look like this:
PARTITION=P001 QUEUELOG=/var/log/asterisk/queue_log LOGFILE=/var/log/asterisk/qloaderd.log LOCKFILE=/var/lock/subsys/qloaderd PIDFILE=/var/run/qloaderd.pid MYSQLHOST=localhost MYSQLDB=queuemetrics MYSQLUSER=queuemetrics MYSQLPASS=javadude
Edit the variables MYSQLHOST, MYSQLDB, MYSQLUSER, MYSQLPASS to point to the new QueueMetrics server.
Then isssue the command:
/etc/init.d/qloaderd restart
Check the log file to make sure that there are no errors and data is being uploaded correctly to the QM server.
Change the callfile.dir property in order to point to the Asterisk server and, on the Asterisk server itself, allow Asterisk Manager (AMI) access from the QueueMetrics server.
You should also make sure that the Asterisk server and the QueueMetrics server have clocks aligned to a sub-second difference; otherwise the real-time page may act strangely, e.g. by specifying negative wait times. In order to avoid this, you should install ntpd on both servers.
Point your browser to your TrixBox or AsteriskNOW server; you should see a welcome screen.
When using TrixBox:
You should see the FreePBX welcome screen.

When using AsteriskNOW:
You should see the FreePBX system status screen.
Click on Queues and create a new one with the following parameters:
Leave all other settings blank.
Click on "Apply configuration changes" / "Continue with reload".
You should see a result like the following one.

Likewise, create queues 301 and 302 in turn.
If you have not already done so, for the purpouse of this tutorial, you should create three SIP extensions and associate them to three physical or software phones.
They should be named 400, 401 and 402.

When you’re finished, apply configuration changes and try placing some test calls, to make sure that all phones are working.
| Note | |
|---|---|
The picture above reports extensions 200 and 201. You need to generate extensions 200, 201 and 202 only if you don’t want to enable hotdesking. In this case we suppose that agents with code 200 will answer calls from the extension 200 and so on. To explain how the hotdesking funcionality could be implemented you need to define the extensions 400, 401 and 402 instead of the 200 and 201. |
We now have to configure QueueMetrics to use the newly-defined queues and agents.
Go to http://10.10.3.123:8080/queuemetrics and login as demoadmin with password demo.
From the home page, click on Edit QueueMetrics settings / Setup wizard.
| Note | |
|---|---|
The Setup wizard is only present if you’re logged with a user holding the CONFIG key. If you are migrating from a QueueMetrics version older than 1.5.2 you need to add this key to your account. |

Follow the wizard until complete.

At this point, queues 300, 301 and 302 have been created.
We now have to tell QueueMetrics on which queues our agents will be working.
Edit QueueMetrics settings / Edit agents.
Create a new agent, setting the following parameters:
Leave all other parameters blank. Note that the agent code must be the prefix Agent/ plus the extension number, without spaces or other characters.

At the end, the agent configuration screen should look like the following one:

Now you should edit the queue-agent association, that is, select which agents can work on which queues.
Just click on Cfg Queues / choose queue 300 / Agents

Make sure that the following settings are implemented:
While you are at it, you should also edit the "00 All" queue so that you can see all your inbound activity at a glance.
Set:

If everything is fine, the queue configuration page should look like this:

See that Agents column shows the number of agents defined as "2-0-0", that is to say 2 agents as Main Level, 0 as Wrap, 0 as Spill.
The configuration so far is enough for running reports.
This may become a problem if the number of queues and agents is higher than it is in this example - you can never tell if all agents are logged on to their correct queues, and your agents often cannot either.
QueueMetrics helps you in this by offering the so-called Agent’s page, that is, a specialized page from which agents can log on, log off, go to pause, see processed calls and do other activities as well.
In order to enable this, you have to create a log-on for each agent that matches exactly the agent code you used in the agent definition, so e.g. for extension 200 you would use Agent/200.
Go to Home page / Edit QueueMetrics settings / Administer users.
Create a new user:
| Warning | |
|---|---|
Make sure that the class is set to AGENTS and not e.g. ADMIN, or they will log-on as administrators! |

Finally, create entries for extensions 201 and 202 as well. At the end, the user list should look like the following screenshot:

| Tip | |
|---|---|
While you are in the user configuration screen, take a second to change the password for user demoadmin and the other default users; using default passwords in a production environment is unwise. |
To check if your changes have been successful, try logging off and logging in again with the credentials for Agent/200; you should see a screen that looks like the following:

From this page:
You can also associate the four bottom buttons to a set of functions that can either be URLs that can be opened or pieces of the Asterisk dialplan that can be launched.
You can run QueueMetrics in many different modes:
We suggest looking into the QueueMetrics User Manual to make the most of the wealth of information that QM can provide.
We configured the system to record all calls in format WAV49 (a derivative of GSM that is natively playable on Windows machines).
Therefore, from QueueMetrics, you simply run a report and then click on "Answered" / navigate to the bottom of the page / "All calls" / see list of all calls found / click on magnifying glass icon / click on the audio file.

Although there is usually only one, there can be zero or more audio files linked to a given call.
By listening to the audio recording of a call, you can easily implement a Quality Assessment process to review the quality of each agent’s work. Although this topic is not part of the scope of this guide, it is not to be overlooked and is discussed in detail within the User Manual.
It is sometimes necessary to listen to live inbound calls as they happen, while the agent is still on line with the caller. QueueMetrics makes such a task trivial.
In order to implement this, you must edit the /etc/asterisk/extensions_queuemetrics.conf and change the following lines as shown here:
...
exten => 11,7,ChanSpy(${QM_AGENT_LOGEXT})
...
...
exten => 14,6,ChanSpy(${QM_AGENT_EXT})
...This is needed because we use dynamic agents and not standard agents, so we have to attach to their SIP channels to do the actual listening.
After the change, force a reload of the dialplan by making a minor change in FreePBX and apply changes.
Then, go to the Realtime page in QueueMetrics and wait for a call to be available; when it is, click on the small telephone icon and enter your local extension.

Your phone will ring and you will be able to listen to the call in progress as it’s happening.