Hangup cause capturing

Can anyone suggest on how to capture the hangupcause code in the below scenario.

Server dials a customer.
Once customer answers and input a dtmf, server will dial other DNIS.
Native bridging will happen on the call(with two channels).
Now i need to capture both the channels hangup cause code.

In my setup, i am able to get the hangupcause code only for the one channel in which i have initiated the first call.

suggest me on getting the cause code of the second call as well

I would expect you to get the cause for the second channel, not the first one, although you may get a normal clearing cause if the first one goes first.

If you have your first and second mixed up, you need to use a local channel to do the actual Dial of the first party, so that you have dialplan running during that process.