freeswitch
freeswitch copied to clipboard
[mod_sofia] Rewrite rport even if endpoint specifies port in contact
If NDLB-force-rport is enabled, we rewrite the rport regardless of what the endpoint thinks the port should be. We do this by checking the status of server_rport_level before writing the port.
Fixes #1457
@Len-PGH
You're actually breaking the entire purpose of this feature. Your devices are capable of behaving correctly, and what your devices thinks, vs what the NAT in the middle thinks differ.
@briankwest Just making sure we're both on the same page:
if (port) is checking if the end device is including port info, and if it does it will use it regardless of the rport. That behavior is incorrect if NDLB is enabled. We should not honor the device's incorrect port announcement, rather use rport. Therefore, we add a check to see if the flag is set before committing that port number.
Can you outline your network topology?!?
FS -> NAT Router -> Yealink device
Yealink sends
Contact: sip:[email protected]:5060
FS rewrites the IP but not the port
See #1457
You don't need to do this for a Yealink make that device do its job, STUN and what not and enable rport and things will just work. Is a public IP on FS or is it behind aws or gcp?
Public IP.
I agree the device is stupid; I'm trying to handle stupid devices. We honor rport regardless of what the device says. Can you re-explain the problem you had in the first comment here? I'm not imagining where this breaks anything. (and if it does I'll obviously drop the PR)
Unit-tests failed: https://public-artifacts.signalwire.cloud/drone/signalwire/freeswitch/843/artifacts.html