cloudwebrtc / go-sip-ua

Go SIP UA library for client/b2bua
Apache License 2.0
215 stars 84 forks source link

handle branches and reinvites properly #73

Closed danieldonoghue closed 2 years ago

danieldonoghue commented 2 years ago

This PR should store unique branches as different transactions (by creating a compound key for the session store) allowing multi-branch support. It also addresses reINVITEs so that they are identified using a "to" header tag instead of simply by receipt of a duplicate INVITE.

cloudwebrtc commented 2 years ago

Sorry, one has been delayed until now. It seems that there is no problem. I will merge it first. If there is any problem, we can fix it again.

cloudwebrtc commented 2 years ago

@danieldonoghue I think I need to revert this PR. Using CallID + branch to store InviteSession will cause subsequent Bye, UPDATE, and INFO requests after the INVITE transaction end, and cannot find the existing session.

gaaf commented 2 years ago

As the commit message did not mention the intent of the changes I initially failed to see what it was supposed to do.

From the comments here, I see the intent is to create separate dialogs from incoming INVITEs with the same dialog ID, but different branch ID. I have a use-case for this too and have an idea how to fix this. I'll send a PR within a few days.