Accessing queued call information at end of call

Is there a way, in the dialplan, to access the information that populates the “COMPLETEAGENT” and “COMPLETECALLER” log records?

I need to send the “holdtime” and “calltime” data to an external application.

During testing, I was just using the CDR variables billsec and duration - subtracting the two to come up with a ringtime. However, I am now doing some BACKGROUND() and PLAYBACK() before the QUEUE() call, and that causes the billsec and duration to be the same since the call is answered right away.

Thanks for any information or assistance!

There are no built-in variables to get these informations.
What can be done is the following:

[ul] - Before entering the queue save the actual timestamp within a variable (“CallStart”).

  • Let each Agent be called by a local-channel in the Dial-Command issued in the context You entered with this local channel let the specific Dialcommand to the phone include the U() option, e.g. U(processanswer))

  • Within the processonanswer-context which will be executed once the agent is connected to the caller, store another timestamp (“CallConnected”)

  • After hanging up the call (leaving the Queue), probably in the Hangup-extension, store a third variable (“CallEnd”).

  • Now: The Difference “CallEnd”-“CallStart” is the total time. The Difference “CallConnected”-“CallStart” is the waiting time when positive, in other cases the waiting time is identical to the total time (call was not answered by an agent). The Difference “CallEnd”-“CallConnected” is the CallHandlingTime or total connected time when not negative. A negative value means 0 (call was not answered by an agent)

This doesn’t capture cases where an agent takes a call and palces it on hold or transfers it where additional waiting times may occur and may be interesting for statistical purposes, but: Actually I’m not sure wheter the Queue-Logger logs this explicitly.

[quote] If set to yes, just prior to the caller being bridged with a queue member
; the following variables will be set:
; QEHOLDTIME callers hold time
; QEORIGINALPOS original position of the caller in the queue

${CDR()} will probably give the other information.

Thank you both for the replies. QEHOLDTIME looks like exactly what I was looking for. Not sure how I missed that, I did spend quite a while looking around for something.

I’ll give it a shot today.