How do I set and log the hangup initiator?

Colleagues, please tell me, is there any already proven method for identifying and logging in the CDR the connection participant who hung up first? All managers really want to have such information.
I was recommended several directions to achieve this result, but maybe there is already some kind of ready-made solution. I believe that this need is very typical.

I would appreciate your advice,

You could grep the freeswitch log for “Sending BYE to” to see who initiated the hangup.