This tutorial will guide you through the configuration of the AudioVault service, setting up the Wallboard Cache on the QueueMetrics Agent page, and setting up the Caddy service to make it all run together.

Why is this procedure needed?

You might not want to change the default “80” and “443” ports on your PBX server, or have to manage certificates or other third-party hosting recordings services. You might just want to set up a server and not have to do anything else.
Plus, if you want to use the Cached Wallboard feature, you might not want to add a Docker container on your PBX server, that will take up resorces from your PBX.

Following this procedure you can move on a separate server the Docker and Caddy services, needed to host the audio recordings and cached wallboard.

If you need just the AudioVault or cached Wallboard feature, you can still use this guide, simply ignore the feature that you don’t need.

Prerequisites

  • a PBX server with a private and public IP;
  • a secondary server, ideally on the same network as the PBX server, with a private and public IP; (in this guide we are using CentOS7)
  • 2 domain names for the secondary server (in this guide, “audiovault.mydomain.com” and “wbcache.mydomain.com”);
  • a QueueMetrics-Live instance;

What is AudioVault?

AudioVault is a new functionality of our multi-function tool Uniloader; namely, a way to search files over a local disk and to make them accessible as a secure JSON service from a remote server. The way it works is pretty easy: Uniloader sits on the same system where files are; it just exposes a JSON service that allows for searching and file retrieval by authorized clients.

Of course, as this service has to be accessible from the Internet, you will need to publish it over a registered DNS name, and we will have to make sure that all transactions are secure.

Media files found are returned by exposing a public URL that can be downloaded by the client’s browsers or proxied by your QueueMetrics-Live instance. To reduce related risks, all URLs are encoded with an anti-tamper mechanism so that a third party cannot retrieve arbitrary files on arbitrary paths. They also have an expiry date embedded that ensures a link is only valid for a short period after it is generated. Also, on each run of Uniloader a specific random link secret is generated, so that only links generated within the current execution are valid.

This means that QueueMetrics-Live can now link to your local recordings (that will remain stored on your local media, with no risks and legal issues of remote transfer) and your users will now be able to use them.

NOTE: It’s importanto to keep in mind that the data stream of the recordings, on your local network between the two servers, is not encrypted.

What is the Wallboard Cache?

The Wallboard Cache is basically a QueueMetrics Wallboard, cached as a PNG file, and sent to the agent page, so that even agents working from home can benefit from it; or, you can display a wallboard on an existing smart TV, even when its browser is too old to work well with current web standards.

This allows anyone that has access to the URL to view the chosen Wallboard.

What is Caddy?

Caddy is a powerful, open source web server with automatic HTTPS written in Go. Most people use Caddy as a web server or proxy, but at its core, Caddy is a server of servers. We are going to use Caddy to simply make available the recordings and cached wallboard in HTTPS.

Setting up the PBX server

On the PBX server, we simply need to make sure that the recordings are available and that the Uniloader service is installed (at least version 21.4).

Check if Uniloader is installed with (when installed using yum):

uniloader -v

If Uniloader is not installed, use the following commands:

wget https://yum.loway.ch/loway.repo -O /etc/yum.repos.d/loway.repo
yum install uniloader 

Creating the AudioVault service

Create and edit:

/etc/init.d/uniloader-audiovault

With:

#!/bin/bash
#
# Startup script for Uniloader AudioVault.

# Source function library.
. /etc/rc.d/init.d/functions

pidfile=${PIDFILE-/var/run/uniloader-audiovault.pid}
logfile=${LOGFILE-/var/log/asterisk/uniloader-audiovault.log}
lockfile=${LOCKFILE-/var/lock/subsys/uniloader-audiovault}

prog=$0
RETVAL=0

start() {
    echo -n $"Starting AudioVault:"
    uniloader av serve \
    --path file:/var/spool/asterisk/monitor/ \
    --token YOUR_TOKEN \
    --public-url https://audiovault.mydomain.com \
    --bind-to localhost:4000 \
    --pid $pidfile \
    >>$logfile 2>&1 &
    echo_success
    echo
    touch ${lockfile}
    return 1
}

stop() {
    echo -n $"Stopping AudioVault:"
    kill $(cat ${pidfile}) 2> /var/null
    sleep 1
    RETVAL=$?
#    echo_success
#    echo
    if [ $RETVAL = 0 ]
    then
  rm -f ${lockfile} ${pidfile}
    fi
    return $RETVAL
}

status() {
  if [ ! -f ${pidfile} ]
  then
    echo "$prog is not running"
    RETVAL=3
  else
    echo "$prog is running..."
    RETVAL=0
  fi
  return $RETVAL
}
# See how we were called.
case "$1" in
  start)
        start
    ;;
  stop)
        stop
    ;;
  restart)
    stop
    start
    ;;
  status)
  status
  ;;
  force-reload)
    stop
    start
    ;;
  *)
  echo $"Usage: $prog {start|stop|restart|status|force-reload}"
  exit 1
esac

exit $RETVAL

You will need to edit the following variable with:

path file → the path to the recordings
token → the token, basically the password that you chose, to access the recordings
public-url → the domain name, where the recordings will be found (the domains name of your PBX server)

Add permissions using:

chmod 757 /etc/init.d/uniloader-audiovault

Reload the Unit changed on disk:

systemctl daemon-reload

Enable the uniloader-audiovault service with:

systemctl enable uniloader-audiovault

And finally, start the AudioVault service with:

service uniloader-audiovault start

Setting up the new server

On the new server we are going to make sure that Docker is available, run a container with the Cached Wallboard and install Caddy.

Installing the Wallboard Cache

At this point go to your QueueMetrics server, select the Wallboard you want to share, click on the little heart icon, and you will have its URL in your clipboard. Paste it somewhere. Replace the three asterisks that appear in the password field with the correct password, and note the resulting URL.

Find out more about this in our documentation:
Kiosk mode

You will need to edit the URL a little, this is what you need:

  • URL → the URL to your QueueMetrics-Live instance, followed by “/unk/qm_wab2.do?”
  • user → in this case we are going to be using the default “robot” user, make sure that user is enabled in QueueMetrics
  • pass → the password of the “robot” user
  • queues and wallboardId → can be found by clicking on the “heart” shaped icon, on your Wallboard.

Now go to the new server and run:
docker run -e "URL=https://YOUR_QUEUEMETRICS_INSTANCE_URL/unk/qm_wab2.do?user=robot&pass=password&queues=300&wallboardId=10" -p 3000:3000 -d loway/wbcache

Installing Caddy

Then we install a very simple HTTPS proxy by using Caddy (v. 1.0.3).

It can easily be installed with:

yum install caddy 

It will automatically generate HTTPS keys for you through Let’s Encrypt and will manage renewals all on its own.

Configuring Caddy

A very basic configuration in /etc/caddy/caddy.conf could then be:

audiovault.mydomain.com {
      proxy / http://INTERNAL_PBX_IP:4000 {
               header_upstream X-Forwarded-Proto "{scheme}"
               header_upstream X-Forwarded-Host "{host}"
               header_upstream X-Forwarded-Port "{server_port}"
          }

      gzip
      tls "e-mail@audiovault.mydomain.com"
  }
wbcache.mydomain.com {
      proxy / http://127.0.0.1:3000 {
               header_upstream X-Forwarded-Proto "{scheme}"
               header_upstream X-Forwarded-Host "{host}"
               header_upstream X-Forwarded-Port "{server_port}"
          }

      gzip
      tls "e-mail@wbcache.mydomain.com"
  }

Enable the Caddy service with:

systemctl enable caddy

Save and restart the Caddy service with:

service caddy restart

Now all HTTPS request will be sent to AudioVault on its (externally inaccessible) port 4000.

To make sure the AudioVault service is running correctly you can access:

https://audiovault.mydomain.com

You should see the Uniloader and AudioVault logo.

Then you can make sure the cached Wallboard is working correctly by visiting:

https://wbcache.mydomain.com/?wb=wb

Configuring the QueueMetrics instance

Now it’s time to configure the QueueMetrics instance, to access the recordings and the cached Wallboard (from the QueueMetrics Agent page).

Recordings configuration

Go to “QueueMetrics Homepage → Settings → Edit system parameters”.

At the end of the file, add:

audio.server=it.loway.app.queuemetrics.callListen.listeners.JsonListener
audio.jsonlistener.url=https://audiovault.mydomain.com/search/
audio.jsonlistener.method=POST
audio.jsonlistener.searchtoken=token
audio.jsonlistener.verbose=true
audio.html5player=true
  • audio.jsonlistener.url → is the URL to the AudioVault recordings, followed by /search/
  • audio.jsonlistener.searchtoken → is the token that we chose previously, when creating the AudioVault service

Log out and then back in, and you can start listening to the recordings in the reports.

Cached Wallboard configuration

Once the cached wallboard is visible, you just need to tell your QueueMetrics-Live instance to display the wallboard on the Agent’s page, in an inner resizable panel.
Go to “QueueMetrics Homepage → Settings → Edit system parameters”, edit the configuration and add the following two lines:

realtime.agent_webpanel1_url=https://wbcache.mydomain.com/?wb=wb&agent=[a]
realtime.agent_webpanel1_label=My wallboard  
  • realtime.agent_webpanel1_url → is the URL to the cached wallboard, followed by /?wb=wb&agent=[a].

Now all your agents will have a new panel called “My Wallboard” that displays the wallboard in (almost) real-time. You can move it around, and you can resize it as you best see fit.

Troubleshooting

Configuration doesn’t seem to apply.

Make sure you are using Caddy version 1.0.3.

caddy version

Certificates are not received.

You can use the following command to see the Caddy service status:

journalctl -u caddy

If you see multiple failed attempts when requesting certificates, it might mean that port 80 or port 443 are not reachable on your server.
Make sure port 80 is reachable from outside your firewall, by Letsencrypt.

QueueMetrics References

QueueMetrics software is available on premise or as a cloud hosted service for FreePBX, YeastarS PBX, Grandstream, Issabel, FusionPBX and many other Asterisk distros.

For more technical information, please refer to the User Manual.

Visit www.queuemetrics.com for a free 15 days full-featured trial.

keyboard_arrow_left Back