Additional queue_log logs for QueueMetrics

In addition to the standard queue_log logs generated by Asterisk, QueueMetrics is able to parse a number of other verbs in order to enable advanced tracking features. Some of these additional logs are already generated by QueueMetrics itself or Uniloader although you can freely implement them in your own dialplans.

Basic queue_log structure

The queue_log file is normally located under /var/log/asterisk/. Each line in this file is to be considered as an event that happened in the queues. The fields are separated by a pipe sign; here an example line:

10000005|214530.123|queue|Agent/123|CONNECT|4

The fields are, in order: timestamp of the event, unique id of the call, queue name, agent code, verb name, and up to 5 additional data fields whose usage depends on the verb.

You can add custom lines in queue_log by calling Asterisk’s QueueLog() function.

Updating past calls

QueueMetrics usually allows modifying calls with custom values, e.g. setting feature codes, outcomes or variables - only:

  • when the call is active, or

  • up to a specified point in time after the call completes.

This value can be changed. The default is 1800 seconds (30 minutes) after the call is ended, but it can be edited by changing the value of default.callStatusTimeout in the configuration properties through the "Edit system parameters" page in QueueMetrics.

Having a longer period has two important issues:

  • it is more likely that such data falls outside the given analysis window, and therefore may not appear correctly in some reports, and

  • it may add a significant amount of load to the ongoing analysis.

Music-On-Hold Tracking

The MOH events must be tracked during the call (between the CONNECT and the COMPLETEAGENT or COMPLETECALLER events); the CALLERONHOLD event is written when the call is put on hold, CALLEROFFHOLD when the call is resumed. These events are currently tracked by Uniloader, enabling the Unitracker feature.

10000001|214530.A|queue|NONE|ENTERQUEUE||123456
10000005|214530.A|queue|Agent/302|CONNECT|4
10000015|214530.A|queue|NONE|CALLERONHOLD
10000025|214530.A|queue|NONE|CALLEROFFHOLD
10000042|214530.A|queue|Agent/302|COMPLETEAGENT|4|37

Tracking IVR

IVR events must be tracked before the beginning of the call; here’s an example of IVR tracking with the IVRSTART and IVRAPPEND.

10000000|214530.A|ivr|NONE|INFO|IVRSTART|caller|dnis
10000010|214530.A|ivr|NONE|INFO|IVRAPPEND|X|menu-1
10000020|214530.A|queue|NONE|ENTERQUEUE||123456
10000030|214530.A|queue|Agent/302|CONNECT|10
10000040|214530.A|queue|Agent/302|COMPLETEAGENT|10|10

As you usually cannot know on which queue the IVR will end (otherwise you would not need an IVR…​) we suggest logging on a figurative queue called ivr. This way, when you run a report only for your queue, you do not get IVR events; if you run a report for both queue and ivr at once, IVR events are added to the queue calls.

You could log everything under ivr, and use the menus to distinguish them, or you could have multiple distinct "queues", e.g. one per DID.

Available verbs are:

  • INFO IVRSTART: logs the caller and DNIS. If you just need to log the DNIS for a non-IVR call, see Adding DID/DNIS information. You could also do both.

  • INFO IVRAPPEND: user presses a key on the IVR tree

  • INFO IVRHANGUP: call terminated during IVR

  • INFO IVRGOAL: goal reached during IVR

Whenever possible, it is advisable to specify a menu for the IVR and avoid using NONE in the queue field.

You can find a detailed explanation of all verbs at Implementing IVR.

Adding DID/DNIS information

To track the number that the caller dialled (usually named DID or DNIS), you add a record like:

1020000|2.1|NONE|NONE|INFO|DID|1234

If you know that the DID leads to one fixed destination queue, you can add it so searching will be more efficient:

1020000|2.1|queue|NONE|INFO|DID|1234

Adding Tags to a call

You can add a tag to a call (see Adding TAG information to calls), before, during and after the call itself, keeping in mind that if you run a report for a certain period of time only events that happened in the report’s time window are shown. See Updating past calls.

A call can have only one tag, if multiple tags are added to the logs only the last one will be used.

Tags are added using the verb INFO. Here’s an example of tag added to the call after a few IVR choices:

1020000|2.1|NONE|NONE|INFO|DID|1234
1020000|2.1|NONE|NONE|INFO|IVRAPPEND|1|i1
1020000|2.1|NONE|NONE|INFO|IVRAPPEND|3|i1
1020001|2.1|NONE|NONE|INFO|TAG|T2

A tag can be used in your CRM integration URL as follows: TAG

Refer to this page for additional details about this feature: CRM Integration

Adding Feature codes to a call

You can add a feature code to a call (Adding TAG information to calls), before, during and after the call itself, keeping in mind that if you run a report for a certain period of time only events that happened in the report’s time window are shown. See also Updating past calls.

Feature codes are added using the verb INFO. Here’s an example of feature code added to the call after a few IVR choices; you can also see how a feature code can accept an additional free text field:

1020000|2.1|NONE|NONE|INFO|DID|1234
1020000|2.1|NONE|NONE|INFO|IVRAPPEND|1|i1
1020000|2.1|NONE|NONE|INFO|IVRAPPEND|3|i1
1020001|2.1|NONE|NONE|INFO|FTR|X1
1020001|2.1|NONE|NONE|INFO|FTR|X2|Free text field

Existing feature codes can also be removed. QueueMetrics will report the complete history of added and removed feature codes in the call’s detail:

1080003|8.1|NONE|NONE|INFO|NOFTR|X1
1080003|8.1|NONE|NONE|INFO|NOFTR|X2

A feature code can be used in your CRM integration URL as follows: F:X1

Or you can just check if a feature code exists (outputs 1) or not (outputs 0): FX:X1

Refer to this page for additional details about this feature: CRM Integration

You can find a detailed explanation of all verbs at Enable call features.

Adding custom variables to a call

You can add custom variables to a call, before, during and after the call itself, keeping in mind that if you run a report for a certain period of time only events that happened in the report’s time window are shown. See Updating past calls.

Variables are added using the verb INFO. Here’s an example of variable added to the call:

1030000|3.1|q1|NONE|ENTERQUEUE||01202579573|1
1030001|3.1|q1|NONE|INFO|VAR|MY_VAR_NAME|MY_VAR_VALUE
1030002|3.1|q1|SIP/5435|CONNECT|2|1411721579.4098058|4

A variable can be used in your CRM integration URL as follows: V:MY_VAR_NAME. Refer to this page for additional details about this feature: CRM Integration

If the same variable is present multiple times with different attributes, the last one wins.

Both variable names and values are always lowercased by QueueMetrics. If you need to have an uppercase value, we suggest URL-encoding it. E.g. "Loway" → "%4coway"

Known variables

While in general you can use any variable and set it to any value, there are some variables that have a "magic" meaning to QueueMetrics, as detailed below.

Variable Description

QM_CASEID

A reference to the "case id" of a case

QM_CUSTID

A reference to a specific customer

Tracking Outbound calls

If you want to track outbound calls you should create fake queue_log records as if the call was actually made in a queue. An outbound call is introduced by the CALLOUTBOUND verb. The called number will be tracked in the second additional field after the verb name (the first additional field refers to the call’s URL). These events are currently tracked by Uniloader, enabling the Unitracker feature.

This is a valid outbound call:

1092000000|1092214530.A|sk-fissi|Agent/302|CALLOUTBOUND||12345679
1092000005|1092214530.A|sk-fissi|Agent/302|CONNECT|5
1092000042|1092214530.A|sk-fissi|Agent/302|COMPLETEAGENT|5|37

Tracking pause reasons

QueueMetrics lets you discern between the different kinds of pause of your agents, in order to track also payable or billable activities. Pause codes are defined in the "Edit Pause codes" page (Configuring pause codes).

Using the PAUSEREASON verb immediately after the PAUSEALL verb you can add a pause code. In case of multiple PAUSEREASON verbs for the same pause only the most recent will be taken into consideration:

1400156431|x1|9998|SIP/99881|ADDMEMBER|
1400156432|NONE|NONE|SIP/99881|PAUSEALL|
1400156432|1400156430.782045|NONE|SIP/99881|PAUSEREASON|99
1400156432|NONE|NONE|SIP/99881|UNPAUSEALL|
1400156432|NONE|9988|SIP/99881|UNPAUSE|
1400156443|x2|9998|SIP/99881|REMOVEMEMBER|
You can find a detailed explanation at Enabling Pause Codes.

Adding the call status (outcome)

The call status will help you track the results of your calls. A call status can be added after the beginning of the call, and after the end of the call keeping in mind that if you run a report for a certain period of time only events that happened in the report’s time window are shown. See Updating past calls.

In case of multiple call statuses only the last one is taken into consideration.

The call statuses are defined in the "Edit call outcomes" page (Configuring call outcomes)

10000000|1142264431.21|queue-dps|NONE|ENTERQUEUE||34
10000030|1142264431.21|queue-dps|Agent/102|CONNECT|30
10000040|1142264431.21|queue-dps|Agent/102|COMPLETEAGENT|30|10
10000050|1142264431.21|NONE|Agent/102|CALLSTATUS|30
You can find a detailed explanation at Enabling call outcomes.

Tracking Hotdesking events

Tracking the hotdesking events (Enabling Hotdesking in the agent page) just before the queue login events is very useful if you are using dynamic extensions in your call center. This will help QueueMetrics tracking the association between the agent code and the extension number used by that agent at any given moment:

100000|10101010.11|NONE|Agent/102|HOTDESK|SIP/1235

Tracking Skills

In skill-based routing systems you can track the requested skills with the REQSKILL verb. (Configuring skills). These events are valid before the call is connected to the agent.

100000|1167335958.530054|cpc|NONE|ENTERQUEUE||01909723335
100001|1167335958.530054|cpc|NONE|INFO|REQSKILL|DE|90
100002|1167335958.530054|cpc|NONE|INFO|REQSKILL|NET|70
100041|1167335958.530054|cpc|Agent/101|CONNECT|41|Agent/101
100064|1167335958.530054|cpc|Agent/101|COMPLETECALLER|41|23
You can find a detailed explanation of all verbs at Tracking required skills.