[mod_sofia] uuid_simplify - fix to-/from-tag in refer-to header #2773
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.
When using uuid_simplify a REFER is sent with a Refer-To header.
The Refer-To header contains a URI with Replaces params that contains a to-tag and from-tag.
The tags are currently set from channel variables ${sip_to_tag} and ${sip_from_tag} dependent on the call direction of the partner channel.
However, this only works in basic call scenarios.
The tags get invalid when user agent role (UAS/UAC) of partner channel changes (e.g. by Re-INVITE for hold, session-timer, ...) before uuid_simplify is called.
In such a call scenario mod_sofia will keep call direction but switches content of ${sip_to_tag} and ${sip_from_tag} channel vars.
Thus, call direction and channel vars will no longer result in correct tags as defined by RFC 3891 (chapter 3 sentence 3+4).
With this pull request I would suggest using local and remote tag from underlying nua state of partner channel regardless of the call direction.