nathelper: port add_contact_alias() and handle_ruri_alias() #3769
+560
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Port
add_contact_alias()andhandle_ruri_alias()functionsDetails
Those are slightly better version of the
fix_nated_contact()originating from Kamailio.The problem with
fix_nated_contact()is that it could cause RURI for in-dialog requests contain a different IP address as compared to the Contact in the initial INVITE.Most endpoints are fine with that, however tere are some, notably MS Teams, which would reject such request with:
The full exchange when using
fix_nated_contact()is as follows:UA->OpenSIPS (initial INVITE):
OpenSIPS->UA:
UA->OpenSIPS:
OpenSIPS->UA (re-INVITE):
UA->OpenSIPS:
Solution
Use
add_contact_alias()in the INVITE/200 OK paths andhandle_ruri_alias()in in-dialog request path.UA->OpenSIPS (initial INVITE):
OpenSIPS->UA:
OpenSIPS->B2BUA (initial INVITE):
B2BUA->OpenSIPS (re-INVITE):
OpenSIPS->UA (re-INVITE):
Compatibility
Should not be any if used correctly. Special test case for the voiptests has been created and will be enabled once the change is merged into the opensips/master.