[asterisk-dev] Real world CDRs

Juan Pablo Abuyeres jpabuyer at tecnoera.com
Sat May 20 19:07:25 MST 2006


Hi guys,

I am facing a problem with CDR... I reported it as a bug on the digium 
issue tracker (7137), but then, while trying to solve it myself I 
realized it was more of a design issue. Then I was told to come here and 
the report got closed, so here I am.

When A calls B, and B blindtransfers the call to C, I ForkCDR to make 2 
CDR records. I want the first call to have accountcode of user A, and 
the second (the blindtransfered) call to have accountcode of user B.
When I ForkCDR, both calls have the same accountcode (user A's). If I 
ForkCDR before the new Dial (in the middle of the blindtransfer), I 
would expect the new cdr to have accountcode of the account that's 
making the transfer, not the original caller.

I've been looking at the source code trying to solve this myself. It's 
not an easy task to try to undestand this beast with no background :) so 
I have a design question. Correct me if I'm wrong.
ast_chan->cdr is a pointer to a linked list of cdr's for a channel, but 
apparently from ast_cdr_setaccount() it is expected that every 
ast_chan->cdr->accountcode to be the same.. It doesn't make sense to me, 
from a billing system point of view. Please give me some clues on this.

We are building a custom billing system. In the way, we've realized 
asterisk generates CDR records that are not at all friendly with billing 
tasks. We have had to tweak the dialplan and make wonders with it to get 
usable CDR records to bill almost correctly. IMHO, Asterisk should 
generate CDR records more understandable (is that a word? :)) by a 
billing system, specially when blindtransfering and referring calls. I 
hope there's interest on improving this area. I am willing to help in 
what I can.

Thank you.

Juan Pablo Abuyeres




More information about the asterisk-dev mailing list