go-sip-ua icon indicating copy to clipboard operation
go-sip-ua copied to clipboard

Add "rport" in via to support NAT.

Open finntenzor opened this issue 1 year ago • 1 comments

Problem: Can not connenct to SIP server when client behind a NAT network.

Request Log:

REGISTER sip:[email protected]:7060 SIP/2.0

Via: SIP/2.0/UDP 192.168.1.187:50066;branch=z9hG4bK.iJM9FQ5m5ZRW0ZJZTAvNGlTyN9JPA6Nl
......

What's expected:

REGISTER sip:[email protected]:7060 SIP/2.0

Via: SIP/2.0/UDP 192.168.1.187:50066;rport;branch=z9hG4bK.iJM9FQ5m5ZRW0ZJZTAvNGlTyN9JPA6Nl
......

Solution: Add an additional "rport" parameter in "Via" when request is prepared. (RFC3581) I submitted a PR draft at PR 98. This PR only checks the functionality, not the configuration, which may need to be added.

finntenzor avatar Oct 14 '23 12:10 finntenzor

I also need this feature. Hope to support

FireTiger23 avatar Apr 08 '24 06:04 FireTiger23