[asterisk-dev] The Trouble with CDR's...!

Brian Degenhardt bmd at fourloop.com
Tue Dec 19 12:03:28 MST 2006


Steve Murphy wrote:
> To He/She Who Cares about CDR's in Asterisk
> 
> I need some community input and proposals.

Some of the changes below sacrifice accurate call counts for tracking 
who participated in the call.  Also, there's no method of linking legs 
together, so determining "what happened" from CDRs will be difficult.

> ======
> CASE 4: (blind transfer) A calls B;  B transfers call to C (via e.g.,
> #151) C answers; A and C converse; the call is hung up.
> 
> 
> in 1.4:
> 
> "","","151","extension","Zap/52-1","Zap/51-1","Dial","Zap/51|30|
> tw","2006-12-18 09:44:59","2006-12-18 09:45:01","2006-12-18
> 09:45:39","40","38","ANSWERED","DOCUMENTATION","","1166460296.5",""
> 
> 
> in my 8221 branch:
> 
> "","150","150","extension","Zap/52-1","Zap/50-1","Dial","Zap/50|30|
> tw","2006-12-18 08:44:01","2006-12-18 08:44:08","2006-12-18
> 08:44:12","11","4","ANSWERED","DOCUMENTATION","","1166456641.5",""
> 
> "151","151","151","extension","Zap/51-1","Zap/52-1","","","2006-12-18
> 08:44:12","2006-12-18 08:44:17","2006-12-18
> 08:44:31","19","14","ANSWERED","DOCUMENTATION","","1166456652.7",""

This looks like "A" participated in two calls, but if you asked him, 
he'd say he was only on one.  If you're billing on a per-call basis, 
this will be inaccurate.  Also, without a method of linking these two 
CDRs together, it's impossible to know that they're related.

There's two things that I think are missing from the current CDR 
implementation:

* call counts should be accurate.  If I pick up the phone, and dial a 
number, there should only be one CDR entry for my call.  If there isn't 
a single entry, I should be able to easily determine that related lines 
are all part of one call.

* events throughout the call should be logged.  If I talk to three 
different people, that should be logged in some matter.  Ideally, things 
like blind transfers, parking events, and directed pickups should be 
logged.  When the call is hung up, the source of the hangup should be 
logged.

We've hacked together a lot of this functionality in Switchvox.  Here's 
a screenshot to illustrate:
http://www.switchvox.com/misc/cdr.jpg

Most of this was done by calling AppendCDRUserField whenever something 
interesting happens.  This only works if there's only a single CDR 
record per call, or if it's easy to link together CDR records from the 
same call.

Ideally, any future changes to the CDR behavior would allow us to 
continue to provide the above information.  In a perfect world, Asterisk 
would log this info for me so that I don't have to do fancy things in 
the dialplan to record what's going on.  I've got a lot of ideas on how 
this would be implemented if anyone is interested.

Sorry if this expands the scope of your bugfix, but I just wanted to 
point out our perspective.  IMHO the only correct change that can be 
done to CDRs is to change them much more fundamentally than how they 
work now.

cheers
Brian Degenhardt
bmd at switchvox.com



More information about the asterisk-dev mailing list