I use Queuemetrics to monitor our call queue. In order to be able to track agent availability, QM requires that you write information to the Queue Log, either using the QueueLog application or the System command combined with echo, like this:
exten => _422XX,3,System( echo "${EPOCH}|${UNIQUEID}|NONE|SIP/${EXTEN:3}|\
AGENTLOGIN|-" >> /var/log/asterisk/queue_log )
The folks at QM suggest using their own login/logout context, but I am reluctant to do that for fear of breaking the way that FreePBX handles queues (things like not sending multiple queue calls to phones with call-waiting). So, I would prefer to modify FreePBX’s [app-queue-toggle], or maybe the *45XXX extension, to include lines that write to the Queue Log.
I think that the best way to accomplish this would be to add the relevant lines to the [app-queue-toggle-custom] context in /etc/asterisk/extensions_custom.conf, but I was wondering if anyone else had done this, and if there is a way to force the custom lines to execute at a certain point in the process, or if they will always execute first, last, or whenever. I have considered placing a number in the custom lines (like “exten => s,5” instead of “s,n”) to force their execution at a specific point, but the hard-coded nature and potential for breaking across upgrades bothers me, and I am uncertain how to properly do it given the (deactivate), (activate), etc subroutines in app-queue-toggle.
Many thanks,
Tom
PS: I am also pursuing this on the QM side, but I’d appreciate opinions on how best this can be done from a FreePBX point of view.
PPS: I wonder if it might be a good idea for FreePBX to write the events out to the log by default, as the information can be useful for things other than QM, and I don’t think it would cause undesired behavior for those who do not need it…?