[asterisk-users] Ignoring time spent waiting in queue in CDR

Atis Lezdins atis at iq-labs.net
Tue Apr 14 08:40:30 CDT 2009


On Tue, Apr 14, 2009 at 4:15 PM, Jared Smith <jsmith at digium.com> wrote:
> ----- "Scott Gifford" <sgifford at suspectclass.com> wrote:
>> The CDR information contains the entire
>> duration of the call as billable seconds, including time spent
>> waiting
>> in the queue.  I would like the billable seconds to only include the
>> time spent actually talking to an agent.
>
> You're absolutely right -- the CDR information is for the entire call.  Instead, look at the queue log (typically written to /var/log/asterisk/queue_log).  It will tell you most (if not all) of the information you need for creating call queue reports.
>

Most, but not all..

Short answer - do an ResetCDR() before entering Queue. This will set
CDR Answer status to "NO ANSWER", and next answer by agent will answer
the CDR, so You will have two distinct values - duration and billsec.
Duration will be total length, but billsec will be conversation time.

On the other hand, You can easily link queue_log with CDR, by enabling
storing of UNIQUEID within CDR record. The same UNIQUEID will be in
queue_log for CONNECT and HANGUP events.

We do have purely CDR based billing implemented, but it requires some
attention upon upgrading Asterisk, as some tiny details might change,
so careful testing is a must. We are happy, as it allows to see
complete call flow for every call, group them easily etc. There's a
sample screenshot: http://ftp.iq-labs.net/screenshots/cdr_view.jpg

However You should really have a think about what are Your
requirements, and how they could change in future. Perhaps using the
queue_log would allow rapid implementation and changes. Also, make
sure to take a look at queue_log on Asterisk 1.6.0/1.6.1, they have
some nice features added.

Regards,
Atis

-- 
Atis Lezdins,
VoIP Project Manager / Developer,
IQ Labs Inc,
atis at iq-labs.net
Skype: atis.lezdins
Cell Phone: +371 28806004
Cell Phone: +1 800 7300689
Work phone: +1 800 7502835



More information about the asterisk-users mailing list