Table of Contents

Introducing the Loway Keyring

Terminology used

Installation

Installing using RPM

Setting up a cron job

Setting Up QueueMetrics for use with the Keyring

Activating the keyupdater profile

Turning off the key expiration message

Using the Keyring

Initial setup

Loading PPKs

Adding a QueueMetrics system

Advanced functionalities

How to’s

Introducing the Loway Keyring

The Loway Keyring is a simple dashboard application that allows you to administer multiple instances of QueueMetrics that are deployed on a private cloud.

These can be provisioned, scaled up and down and even closed using a web GUI that keeps track of which licenses are installed on each system and that lets you change them as needed.

This model is best suited for deploying a large number of parallel QueueMetrics instances - for example, as a complement of an existing Asterisk cloud offer - without taking the financial risk of purchasing many long-term licenses.

In this way:

You can generate a key as soon as your clients ask for it (no delays due to bank payments, different time zones, etc.)

If your business model is hosting remote call centers with QueueMetrics, you can purchase QM licenses that last as long as your client has paid you for; if they pay you monthly, you do not have to commit to a four-year license in advance.

When each key short-lived expires, the Keyring will silently install a different one - you invoice your client for actual usage only.

Terminology used

A pre-purchased key (PPK) is an activation key that you purchase from Loway and specifies an activation period for a given license of QueueMetrics - for example, a PPK that looks like this:

XQI-LOWAY-74KKMREX6TOH1:QM-50/1/90

will eventually convert into a 90-day QueueMetrics key for 50-agents and 1 Asterisk server, counting from the day you convert it.

A license key is the actual key that will be installed in QueueMetrics in order to activate it. It can be installed manually within the web.xml file or in QM itself, on the License page. It contains a fixed expiration date that cannot be changed once it’s generated.

Installation

The Loway Keyring is a web application written in Java. It requires the same infrastructure as QueueMetrics (Java 6, a MySQL database). In addition, it requires a cron entry to update licenses automatically when needed.

The Keyring can be installed alongside an existing QueueMetrics installation or on a different, dedicated server. The box that the keyring is installed on must be able to reach all the required QM instances - either on a private network or through VPN tunnels. It must also be able to connect to the Internet for key generation.

The Keyring cannot control an instance of QueueMetrics that is installed on the same machine, as during the update process the whole servlet container is restarted.

Installing using RPM

If your Linux distribution uses RPM, installing the Loway Keyring is very easy:

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

Once the installation is complete, you will be prompted to execute a script to install the initial database.

cd /usr/local/queuemetrics/webapps/LowayKeyring-22.02.1/WEB-INF/README
./installDB.sh

You will be prompted to enter your MySQL root password and the default database will be loaded.

In order to access it, point your browser to: http://yourserver:8080/LowayKeyring

Once you see the welcome page, do not forget to set up a cron job as described below.

Setting up a cron job

In order to set up a cron job, run the following command:

crontab -e

When the editor appears, add a line that looks like:

0 23 * * * /usr/bin/wget -O- "http://127.0.0.1:8080/
                LowayKeyring/LKKeyBatch.jsp?user=demoadmin&pass=demo"

(it must be all on one single line).

Make sure that you change the default login and password once you set up the Keyring. Running the cron job daily should usually be enough, though there is no harm in running it hourly.

We strongly suggest using a single time-source throughout all your deployment - so that cross-machine logs make sense and are readable. You can easily achieve this by running ntp periodically to make sure that the clock is aligned on all your servers.

Setting Up QueueMetrics for use with the Keyring

In order for a QueueMetrics instance to be controlled by the Keyring, you should install it as you normally do:

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

and follow the standard installation procedure.

When the QM instance is active, you should log in to it as an administrator and perform the steps described below.

Activating the keyupdater profile

The keyupdater user (the one used for scriptable remote key updates) ships with QueueMetrics but is disabled by default, as a security measure.

Go to Edit users and classes, look at the keyupdater user and edit it.

Set it as Enabled: yes and change its default password

Turning off the key expiration message

When the expiration date of a QueueMetrics license is very close, QueueMetrics will display a warning message. As Keyring licenses are usually quite short (a few days or one month), your users will otherwise often see this message.

In order to turn it off, set:

default.noLicenseWarning=true

within the configuration.properties file of each QueueMetrics instance.

Using the Keyring

If you point your browser to http://yourserver:8080/LowayKeyring you should see the inital login screen.

You can login as "demoadmin", password "demo" for the first access.

Initial setup

The first thing you have to do is to change the default password for user demoadmin.

You can do this by going to the User editor (select Manage Users on the homepage):

You should also edit the email address for user demoadmin, as reminders for any license generated through the Keyring will be sent from Loway systems to this specific address.

Remember to log out and log in again, before continuing the installation. Also, make sure that the password you just changed is reflected in the pass field of the crontab request you previously set up.

Loading PPKs

If you are just starting out with the Keyring, most likely you will have received a set of demo keys from Loway.

In order to load them into the system, click on Manage Licenses on the homepage:

Copy and paste the license list in the box on the right and click on the Add button. The system will confirm the number of imported keys.

If you import a key multiple times, it will be skipped; so no harm comes from doing so.

Adding a QueueMetrics system

Adding a customer

The first thing you have to do is to add a Customer, that is the entity that "owns" each QueueMetrics system. Click on Manage Customers from the home page:

The only mandatory field is the Company name.

Creating a QM instance

After you created your customer, go back to the home page and add a system.

Enter a name that will identify this Asterisk instance, the customer and which license you want to deploy. You should also enter the address of the QueueMetrics instance (as you would use to login) and the username and password for the local keyupdater user.

The default values are:

Instance Name : Enter a name for the QueueMetrics instance

Select Customer : The customer that this QM instance belongs to

QM Host URL : QueueMetrics URL (e.g. http://myserver:8080/queuemetrics)

QM Host Username : It is usually "keyupdater" (see Chapter on Activating the keyupdater profile)

QM Host Password : The default one is "enableme", but you should change this as soon as possible

Key type : The kind of licence you want to associate to this instance

Checking the system actually works

Before doing anything with a system, it is important to check that the system is actually available on the address you entered. To do so, click on the Check button next to the URL field.

If all went well, you should receive a confirmation message.

If you receive an error message here, this means that either QM is not available on the given URL, or that the user keyupdater is not present or not enabled, or that the wrong password was entered.

Deploying a license

When initially deploying a license, you can click on the Generate Now button to generate the key and have it deployed. In a few seconds the QueueMetrics system will be provisioned and active.

As in real-life you have contracts that may have any duration, it is possible to set an expiration date and have the license automatically generated every time it is about to expire. This is what the cron job does.

When the cron job runs, it basically asks two questions:

Is the current license present and active? if so, it does nothing

Does this license have to be renewed up to a certain point in the future? If so, the license is generated and installed.

In case a license is generated but the installation fails (e.g. that particular QM instance is down), then the cron job will repeatedly try to install that key, until it succeeds. A detailed activity trace is held on the system log.

If you do not understand what is going on with a given key, the syslog is the first place you should check.

Please note that the new license will be renewed until it covers at least the expiry date - not a big issue if your licenses are paid on a weekly basis, but if they are e.g. monthly and the license is renewed the second day of the month, it will however last until the end of that month.

Advanced functionalities

PPK history

As soon as your business grows, your PPK list will get very large and searching for relationships between PPKs, keys generated and associated instances could be difficult. To help you to identify which PPK was used by a specific QM instance, which key is deployed to a QueueMetrics instance, its validity perriod and its activation date, a set of filtering options was implemented.

Switching to the Manage Licences page the whole list of PPKs is shown, independently by the status each PPK has. For each Generated and/or Activated PPKs the Start Validity and End Validity columns are populated with their relevant information. Generated and/or Activated keys have an icon in the More info column. Click on this icon to have detailed information about a specific PPK; a popup box opens as shown in the picture below.

Through the two dropdown lists present on the right side of the page is possible to filter the PPK list by licence type and/or licence status. To have the filtered list you should select which licence type and/or status you need to list, then click on the Filter button.

Activity log

Each time a user edits/inserts a customer or a QM Instance, each time the batch processor runs or a user manually triggers a key generation/activation process, a set of activity events are generated and logged on the keyring database.

These events could be inspected for security reasons or to better understand what happened if something went wrong by clicking on the of the View Syslog page. The View Syslog link is available only to users holding the key SYSLOG. In order to assign a specific key to the user please refer to User Accounts and Security

How to’s

Extending or reducing a QueueMetrics key

In order to extend and/or reduce an existing license, you create a new one and replace the old one with it. It is immediately active. The old one is basically "dumped" and cannot be recycled.

What if I run out of PPKs?

In case you should run out of the PPK required for that client, it will be impossible to generate the key and an error message will be logged. (We plan to add email notifications in the near future).

To help you avoiding this situation, when a license that is set to be renewed does not have a possible PPK on the current database, we display a warning icon.

Help! My QM license expired and remote key deployment does not work!

If a QueueMetrics license key expires, the whole application might become unavailable. This does not usually happen the very day the key expires, but after its expiry date a QM instance may stop working at any moment. When this happens, even the remote key deployment webservice becomes unavailable, and so the Keyring cannot restart that QM instance.

If this happens to you:

Have a new license key generated manually for that instance (if there isn’t one already available). The Keyring will generate a new key and complain that the QM it should be installed on is not working.

Open the Manage Licences page and search the latest key generated for that specific instance. Click on the More Info icon to have a popup where the Activation key is shown

Manually copy the generated key (you can find it in ) to the LICENZA_ARCHITETTURA property of the WEB-INF/tpf.properties file you can find in your QueueMetrics instance

Restart QueueMetrics

Trigger the updater, so that the Keyring will install the key again and will report the key as currently installed.

User Accounts and Security

Access to the LowayKeyring pages is granted by mean of a pairs of username and password tokens. These should be present in the list of authorized users. Each user is related to a specific class. Classes are a set of containers where security keys are grouped. Each security key is a token that, when hold by a user or a class, allows the holding user to do a specific action or set of actions.

In order to add, edit, delete users, an administrator should click on the Manage Users link on the top of the page. Only adminstrators, or better, only users holding the USRADMIN key are allowed to enter to the user’s administration page. From this page is possible to define, edit or delete a set of classes. Each class should have a unique name and a set of security keys that will be applied to each user inheriting that class. From this page is also possible to define, edit or delete a set of users. Each user should have a unique name, a password, and should inherit from a specific class. It’s also possible to assign a specific security key to one or more users.

A security key is usually made by a case insensitive text-based token. Some security keys are pre-defined by the LowayKeyring framework. This means that they could be used to activate specific actions for users holding that key. An example is the USRADMIN that enables user definitions page for the user holding that key.