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

Alex Balashov abalashov at evaristesys.com
Tue Apr 14 01:49:19 CDT 2009


I wouldn't approach this by trying to rework the CDRs at all;  CDRs are 
fundamentally low-level call records.  They correspond to calls.

If you need logic to support a billing model for some specific 
application (i.e. time after connect to agent), I would approach that 
from a higher layer of abstraction that is more closely coupled to the 
application's own.  For example, you could listen for Manager API events 
that indicate a queue caller's connection to an agent and flag those. 
There are numerous ways to skin this cat.

What I would not do is try to mess with the CDRs to achieve this end; 
there is a reason they are called CDRs -- call detail records.  Not 
queue detail records, not MoH detail records, not IVR detail records, 
but _call_ detail records.  If nothing else, you may find that someday 
you will need the total call duration for other purposes, and have shot 
yourself in the foot by hacking it out this way.

Plus, it's just too hard.  Why jerry-rig CDRs when there are far easier 
and more functionally modular / extended ways to accomplish the same goal?

Wrong tool for the job.

Just my $.02, of course...

Scott Gifford wrote:

> Hello,
> 
> I'm working on an Asterisk configuration for a call center, and they
> bill based on the time spent talking to an agent, but not for any time
> spent waiting in a queue.  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.
> 
> I am using Asterisk 1.4.18.
> 
> The only way I have found so far is to correlate the CDRs with the
> "CONNECT" queue records, figure out the end time of the call by adding
> the CDR start time to the duration, then figure out the actual
> duration by subtracting the time of the queue "CONNECT" record.  That
> seems messy and error-prone, and I'm hoping there's a better way.
> 
> I also looked at using the ResetCDR() or ForkCDR() dialplan functions,
> but I don't see a way to cause code to run immediatly after the agent
> answers a call from the queue.
> 
> Any suggestions?  Am I missing some easy way of doing this?
> 
> Thanks!
> 
> ----Scott.
> 
> 
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> 
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users


-- 
Alex Balashov
Evariste Systems
Web    : http://www.evaristesys.com/
Tel    : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
Mobile : (+1) (678) 237-1775



More information about the asterisk-users mailing list