sipgo icon indicating copy to clipboard operation
sipgo copied to clipboard

feat: introduce WithForceLocalReplySocket

Open agranig opened this issue 2 months ago • 2 comments

When running a server in Docker or on a D-Nat'ed environment, force replies from this server from the local socket instead of trying a Via match. Otherwise replies will be sent from a new socket with a random port.

agranig avatar Dec 16 '25 12:12 agranig

Hi Andreas. Thanks for looking at this. I unfortunately know what could trigger you todo this. I am not sure did you work on 1.0.0, but there was fix added in meantime So by default it should go with local socket as on this line

https://github.com/emiago/sipgo/pull/278/files#diff-bac0f4e718050ee8bf1af96fcb0854abbf4f76d93e1fcca7f1acf1a37f7e5c69L523

It was made some buggy changes recently, but 1.0.0 was already pushed. Most of test worked due to client using rport for NAT, and routing was anyway forced on local socket.

Pls check last main branch and see this without fix.

Then only feature that could be is reversed, forcing non local socket but this is already exposed with TransportIdleConn

emiago avatar Dec 16 '25 19:12 emiago

Will do, give me some days to check that. Thanks for the hint!

agranig avatar Dec 17 '25 20:12 agranig