Billing in case of call forwarding

Hi, In case of call forwarding if A makes call to B and B forwarded the call to c on some condition. Then the CDR entries in mysql DB are of A–>C with zero billing secs and A–>B is having actual billing seconds. But i want a CDR entry which has info on B–>C CDR event. Is there any configuration changes required to achieve this functionality?

          Any help is greatly appreciated....

Well, the way it works is sort of right.

A never actually called C - B did.

Hence The A --> C is zero billing.

But, don’t get disheartened - there are major changes coming in the CDR department :wink:.

To expand on the previous reply, SIP has been designed from an engineering, rather than a business model point of view, so a call forward is achieved by telling the calling party to call another number. Because Asterisk is a back to back user agent, it can associate the calls, but a pure SIP environment wouldn’t even guarantee that; the new call could look like a completely new call from the original A party…

With regard to the CDRs, look at:

Thank you guys for immediate response, But how to capture a CDR event from B–>C. Is there any special dial plan entry to acheive this if so guys please provide me the sample? Its an urgent requirement from the client. Can u explain how to handle this case in detail? :bulb:

Change the source code. This is a non-trivial bit of work that goes well beyond the limits of free consultancy.

I am pretty confident that the structure of Asterisk doesn’t reflect any interaction between B and C and that there are no CDRs that directly reflect such interaction. You will need to correlate the two CDRs. You may be able to detect channel variables on the forwarded call, and add information to the userfiled, or to a field in a custom CDR, to help you correlate.

You may need to enable “unasnwered” call CDRs to maximise the information input to your correlation process.

It is possible that the changes to CDRs currently being considered will make correlation easier, but I still doubt that they will generate a CDR that directly reflects the interaction between B and C…

If you are prepared to consider the long term, joining in the discussion about the Asterisk issue I mentioned (possibly on the design mailing list, rather than the bug tracker, might be advisable.


CDR Issues are well covered in this Blog entry .


Al though the link provided is fine, It is a bit confusing, can you please guide me through the configuration steps how to capture B --> C CDR event.

You cannot do so without significant development work. I doubt that anyone is prepared to do that work for free.

The URLs you are being given basically tell you that the current CDR support is not suitable for complex cases.

More precisely, whilst people may be prepared to do it free as part of the medium to long term development of Asterisk, they are unlikely to want to provide a specific solution, just for you, in the short term.