Show ringing phones in the realtime page

With Asterisk 1.4 and QueueMetrics 1.7.1 is possible to have ringing phones information on the realtime page. This information should be provided to QueueMetrics through minor modifications in Asterisk configuration files. Since Asterisk 1.4, a new RINGNOANSWER event is available in the queue_log. This event shows the last agent that did not pick up the phone when ringing but, obviously, this information is available only when the phone stops ringing. With the hereby listed modifications it is possible to have ringing phone information as soon as a call enters in a particular queue. This option is available only for systems where the hotdesking is not enabled; for systems where hotdesking is required, the realtime ringing information can not be written in the queue_log but the standard RINGNOANSWER information is available directly from asterisk.

Realtime ringing information is fed to QueueMetrics by means of AGENTATTEMPT events inserted in the queue_log. This information should be generated by the Asterisk dialplan. For this reason it’s mandatory to specify Local Channel extensions as members in the queues definitions: this will enable the app_queue to pass from the dialplan to start ringing phones.

We take as example the queue queue_dps defined in the queues.conf, as reported below:

[queue-dps]
announce-frequency=0
announce-holdtime=no
eventmemberstatus=no
eventwhencalled=no
joinempty=yes
leavewhenempty=no
maxlen=0
periodic-announce-frequency=0
queue-callswaiting=silence/1
queue-thereare=silence/1
queue-youarenext=silence/1
retry=5
strategy=ringall
timeout=15
wrapuptime=0
member=Local/100@from-internal-custom
member=Local/101@from-internal-custom
member=Local/102@from-internal-custom

Let’s assume we have three members tied to the extensions 100, 101 and 102 defined in the from-internal-custom context. We assume that the extension 200@from-internal-custom is the entry point for the queue queue-dps.

The extensions.conf should be defined as:

[from-internal-custom]

exten => 100,1,System( echo "${EPOCH}|${PCHANNEL}|queue-dps|SIP/${EXTEN}|AGENTATTEMPT" >> /var/log/asterisk/queue_log )
exten => 100,n,Dial(SIP/100)
exten => 100,n,Hangup()

exten => 101,1,System( echo "${EPOCH}|${PCHANNEL}|queue-dps|SIP/${EXTEN}|AGENTATTEMPT" >> /var/log/asterisk/queue_log )
exten => 101,n,Dial(SIP/101)
exten => 101,n,Hangup()

exten => 102,1,System( echo "${EPOCH}|${PCHANNEL}|queue-dps|SIP/${EXTEN}|AGENTATTEMPT" >> /var/log/asterisk/queue_log )
exten => 102,n,Dial(SIP/102)
exten => 102,n,Hangup()

exten => 200,1,NoOp("Here is a call for the queue")
exten => 200,n,Set(__PCHANNEL=${UNIQUEID})
exten => 200,n,Queue(queue-dps,,subq)
exten => 200,n,Hangup()

In the example above, the PCHANNEL variable is set in the extension 200 to the UNIQUEID for each incoming call in the queue. The variable is used by the extensions 100, 101 and 102 to write a signature in the queue_log file. The same should be replicated for each agent, for each queue and for each internal extension in the system.

To have real time ringing information, the last step to be performed is to modify che configuration key default.ignoreRingNoAnswer present in the configuration.properties file in the QueueMetrics installation folder. This key should be set to "true". This switches the QueueMetrics analyzer to the proper working modality, where RINGNOANSWER verbs are discarded, because ringing information is now provided by the AGENTATTEMPT events.