freeswitch icon indicating copy to clipboard operation
freeswitch copied to clipboard

[mod_sofia] Rewrite rport even if endpoint specifies port in contact

Open yois615 opened this issue 3 years ago • 1 comments

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

yois615 avatar Nov 23 '21 18:11 yois615

@Len-PGH

yois615 avatar Jul 05 '22 16:07 yois615

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 avatar Nov 11 '22 16:11 briankwest

@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.

yois615 avatar Nov 11 '22 16:11 yois615

Can you outline your network topology?!?

briankwest avatar Nov 11 '22 16:11 briankwest

FS -> NAT Router -> Yealink device

Yealink sends Contact: sip:[email protected]:5060

FS rewrites the IP but not the port

See #1457

yois615 avatar Nov 11 '22 16:11 yois615

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?

briankwest avatar Nov 11 '22 16:11 briankwest

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)

yois615 avatar Nov 11 '22 16:11 yois615

Unit-tests failed: https://public-artifacts.signalwire.cloud/drone/signalwire/freeswitch/843/artifacts.html

signalwire-ci[bot] avatar Nov 20 '22 19:11 signalwire-ci[bot]