Hello,
We use dialog module in our configuration.
uac_replace_from/to  is called after dlg_manage().
restore_mode is auto.

URIs are modified automatically in all subsequent local requests, exclude BYE generated in dlg timeout.
In this case original URIs are sent to both caller and calee sides.
If call going through only one kamailio server, all works fine.
Problem starts with a chain of servers with from/to manipulation.
When timeout occurs in one kamailio server, calee kamailio server receives BYE with original (not modified) URIs and URI restore gets wrong parsing result.
Call clears in caller side and stay connected in caller.

Whether there is any solution?

BR ,

Julia.