[asterisk-dev] [Code Review] 2417: Track On/Off- Hold events in queue_log

Steve Murphy reviewboard at asterisk.org
Thu Mar 28 00:55:42 CDT 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2417/
-----------------------------------------------------------

Review request for Asterisk Developers.


Bugs: https://issues.asterisk.org/jira/browse/ASTERISK-20742
    https://issues.asterisk.org/jira/browse/https://issues.asterisk.org/jira/browse/ASTERISK-20742


Repository: Asterisk


Description
-------

This patch introduces some new events in the queue_log, to track on-hold, and off-hold events,
which QueueMetrics (and anyone else) can use to measure hold times, a traditionally import
metric for Call Centers.

It uses the ast_event interface to generate the events and execute call-back funcs in app_queue.c.

The result are CALLERONHOLD and CALLEROFFHOLD events in queue_log:

1362496243|1362496237.15|300|SIP/204|CONNECT|6|1362496237.16|5
1362496247|1362496237.15|300|SIP/204|CALLERONHOLD|default
1362496249|1362496237.15|300|SIP/204|CALLEROFFHOLD|
1362496251|1362496237.15|300|SIP/204|CALLERONHOLD|default
1362496252|1362496237.15|300|SIP/204|CALLEROFFHOLD|
1362496254|1362496237.15|300|SIP/204|CALLERONHOLD|default
1362496255|1362496237.15|300|SIP/204|CALLEROFFHOLD|
1362496258|1362496237.15|300|SIP/204|COMPLETEAGENT|6|15|1

The CALLERONHOLD event also records the musicclass associated with the MOH.

By using hashtabs in app_queue, the code is optimized for the large-queue cases.
Every MOH call will generate a callback into the app_queue module; it is important
that the code quickly determine whether the MOH event is associated with a queue call.
No Linked-list searches allowed!

This code also drags a few events back into app_queue, namely the code in chan_agent that
recorded agent log-ins and log-outs.

I've tested this code on 1.8 and trunk, and because of the asynchronous nature of 
the queue logging, included a few lines of code to restrict ONHOLD and OFFHOLD events
such that OFFHOLD events will only be generated after an ONHOLD event, and vice-versa.

Others have tested the code and the results are so far positive. We hope to get some
"smaller" production boxes online with this code, and see how it performs "under load".


Diffs
-----

  /trunk/apps/app_queue.c 384234 
  /trunk/channels/chan_agent.c 384234 
  /trunk/include/asterisk/event_defs.h 384234 
  /trunk/res/res_musiconhold.c 384234 

Diff: https://reviewboard.asterisk.org/r/2417/diff/


Testing
-------

On trunk, with small queues; on 1.8 (backported) in at least 2 sites so far (at least, 
according to feedback.


Thanks,

Steve Murphy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130328/e47cfc2b/attachment.htm>


More information about the asterisk-dev mailing list