Thanks you so much for a quick answer. Storing data to $dlg_var()
really solves this problem.
Hi,
Swapping the From and To URIs headers when sending an in-dialog request (such as a BYE) from callee to caller is not a but, but the protocol-compliant way to do things. :-)
Lots of possibilities for saving original values if so desired. Dialog variables ($dlg_var(...)) are probably the easiest. I prefer to persist this stuff in the database by writing an initial CDR row on the initial invite and only updating it thereafter.