This commit, partially cherry-picked from ee00df57, enhances the commit to address FLEXISIP-71. To accomplish this, transactions now utilize the main Agent if Out/inAgent is null. Additionally, to mitigate memory leaks upon shutdown, transactions self-reference deletion is implemented when sofia-sip deletes the C transaction.
See !970 (closed) for original MR and approval