go-sip-ua
go-sip-ua copied to clipboard
Add "rport" in via to support NAT.
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.
I also need this feature. Hope to support