Thank you for the idea, but unfortunately this wont work for me.
What I need is to receive a call and then dial two or more calls from my server to another location one after another, and for that I need just one CDR. Instead Asterisk creates two CDRs.
Your idea gave a little different result, but still no cumulative CDR.
The easiest way is to do this in the billing software.
You could use a local channel to isolate the the incoming leg. There would be only one Dial application call, so only one CDR from the dialplan running on the actual incoming channel.
but as soon as 301 hangs up, call is disconnected.
I have temporary solved my problem by creating custom CDR in h extension, with Realtime_Store application, but this is not such a good way to do things like this.