I’ve merged the two threads that were started by the same person on similar topics.
RobertO wrote:The Proxy is correcting the incorrect SIP port
Local SIP ports can be completely different than the proxy server SIP port. They're not related. One is used by a SIP device (ATA or IP Phone, for example) on a LAN. The other is used by the server you're trying to connect with.
Proxy Server SIP port (UDP 5060) being used by FPL's Proxy server, voip.freephoneline.ca, is not related to the local SIP port (UDP 5061) being used by a device (ATA, IP Phone, SIP app on smartphone or computer) for listening to SIP traffic (or for SIP signalling). Unless voip.freephoneline.ca:5061 has been specified for Proxy (with 5061 being entered incorrectly for the proxy server port) server, no correction is required. The proxy server SIP port can not be UDP 5061 with Freephoneline (UDP port 5060 is set by the service provider), but UDP 5061 can be a local SIP port (set by the user), other than the potential problem I mention next.
The reason the local SIP port is recommended to be a random high port number is due to SIP scanners typically probing UDP 5060 and 5061. (Additionally, sometimes problems arising from buggy router features can be avoided.) The idea is security through obscurity, but the bottom line is that nothing is better than a good firewall. With pfSense, SIP scanners shouldn't be an issue. However, when using a number of residential routers, hubs or modem/router combos (or gateways) that ISPs issue for residential customers, port scanning attacks can present problems. Suddenly people believe they're getting calls from "1001", for example. Those aren't real calls. Those are SIP scanners being used by crackers to steal services and break into devices on the customer's LAN. I do not recommend using default UDP 5060 or 5061 for the local SIP port or X_UserAgentPort. A random number between 30000 and 60000 should be used instead.
In an SPA2102, local SIP port is defined by (navigate to Line 1 or whatever is being used-->SIP settings-->) SIP Port.
That's the local SIP port, and it's not the same thing as the proxy server port being used by Freephoneline.
For an Obihai ATA, the local SIP port is called X_UserAgentPort (navigate to Voice Services-->SP(FPL) Service-->X_UserAgentPort).
For Grandstream ATAs, the local SIP port is called Local SIP Port (found under the FXS Port tab). Grandstream ATAs have an option to use random local SIP ports, which is good when dealing with corrupted NAT issues.
Unfortunately, by default many local SIP ports are set to UDP 5060 in ATAs, IP Phones, and SIP apps.
Local SIP ports for multiple SIP accounts should be different. If one is set to 35261, don't choose the exact same random high number for local SIP ports when registering/configuring other accounts on devices. Additionally, different local RTP ports or different RTP port ranges should be used. Some routers can produce problems otherwise, with traffic not reaching the right device. However, it should be noted that other routers can properly detect devices on the same LAN that are trying to use the same port number, and those routers automatically use a different port number for the next device trying to register.