Skip to content

Fix sdp connection address#1552

Open
jsmhlz wants to merge 2 commits intosipsorcery-org:masterfrom
jsmhlz:fix-sdp-connection-address
Open

Fix sdp connection address#1552
jsmhlz wants to merge 2 commits intosipsorcery-org:masterfrom
jsmhlz:fix-sdp-connection-address

Conversation

@jsmhlz
Copy link
Copy Markdown

@jsmhlz jsmhlz commented Apr 7, 2026

I recently encountered an issue where an upstream SBC is sending an inbound call to my application, the application answers it but sends the local IP in the SDP connection info. To fix this, I specified the public IP in the UserAgent.Answer but discovered the local IP still being sent. I have made this change in RTPSession.cs to ensure the given public IP used in the UserAgent.Answer is used in the CreateAnswer if the IP Address has been specified.

jsmhlz added 2 commits April 7, 2026 11:57
…not guaranteed this will be used which can cause 1way audio issues. This change means that if a publicIPAddress is specified (ie passed all the way down into CreateAnswer) then it is guaranteed to be used as the connection IP address in the SDP answer
@sipsorcery sipsorcery added the sdp label Apr 9, 2026
@sipsorcery
Copy link
Copy Markdown
Member

The same effect can already be achieved by passing the IP address into the Answer method using the `publicIpAddress parameter.

@sipsorcery sipsorcery added the sip label Apr 13, 2026
@jsmhlz
Copy link
Copy Markdown
Author

jsmhlz commented Apr 13, 2026

Yeah that's what I thought, but I found a weird edge case in the wild where it just doesn't apply. I figure if the IP is provided it should be guaranteed to use the provided IP address, which this PR does do :)

@sipsorcery
Copy link
Copy Markdown
Member

Would it be possible to provide some more info about the edge case to see if there's a better way to fix it?

The problem with burying public IP address properties way down in the code is callers need to somehow discover them as well as setting them in mulitple places.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants