fix: hold/resume invite SDP direction negotiation and IP handling#126
Open
vyntro wants to merge 3 commits intoemiago:mainfrom
Open
fix: hold/resume invite SDP direction negotiation and IP handling#126vyntro wants to merge 3 commits intoemiago:mainfrom
vyntro wants to merge 3 commits intoemiago:mainfrom
Conversation
When a hold re-INVITE is received with ``a=sendonly`` in the SDP, the answer is incorrectly generated with ``a=sendrecv`` instead of ``a=recvonly``. This causes the remote side to stop sending RTP/audio after resume, even though the call remains up.
If the direction attribute (``a=sendonly``, ``a=recvonly``, etc.) is the last line in the SDP and there is no trailing newline, the parser skips this line. As a result, the direction is not processed, and the answer defaults to ``a=sendrecv`` This causes incorrect media negotiation and RTP/audio failures after hold/resume.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix for the issue #125
I have observed the below three issue when i try to use the call hold on functionality.
1. SDP Direction Handling Issue
When a hold re-INVITE is received with
a=sendonlyin the SDP, the answer is incorrectly generated witha=sendrecvinstead ofa=recvonly. This causes the remote side to stop sending RTP/audio after resume, even though the call remains up. Correct SDP direction negotiation is critical: the answer must reflect the proper direction (sendonly → recvonly, recvonly → sendonly, etc.).2. SDP Parser Bug (No Trailing Newline)
If the direction attribute (
a=sendonly,a=recvonly, etc.) is the last line in the SDP and there is no trailing newline, the parser skips this line. As a result, the direction is not processed, and the answer defaults toa=sendrecvThis causes incorrect media negotiation and RTP/audio failures after hold/resume.3. IP Handling Issue
When answering a hold/resume re-INVITE, the 200 OK SDP sometimes uses c=IN IP6 :: or c=IN IP4 0.0.0.0 instead of the configured IPv4 address or ExternalIP. This can cause the remote side to reject the media or stop sending RTP.
Impact
Expected
Actual
SIP trace (abridged)