Changing SIP bind port

We have started having a problem with SIP softphone registration happening every few hours for no apparent reason. People will all be working away on the phones, then suddenly no phones can register, I think the ISP is sporadically blocking port 5060 for whatever reason. Otherwise I have no explanation why things are fine, then suddenly not, then fine 30 minutes later. This also started happening right after upgrading our internet speed.

We are on an HA system at a hosting company. I want to try to change the SIP bind port to let’s say 5160, i changed the bind port under SIP settings to 5160, and changed an extension to use port 5160. I try to connect using a softphone and no dice. I get ‘cannot connect to server’. Is there anything else I need to change?

You need to restart asterisk and provide a binding IP in the field above.

I changed the bind port under advanced SIP settings to 5160,
I changed the extension port to 5160.
I ran amportal restart
I set X-lite to domain

I get nothing. I also get nothing when I set SIP debug the log.

Any other suggestions? What am I doing wrong?

See above ^ you need to provide an IP to bind to as well as the port. Don’t change the port on the extension page. Just leave it at 5060.

The binding IP is already set since we are an HA system. I will change the extension back to 5060. I’m also checking with our hosting company to make sure the ports I am using are open through the firewall since the PBX is behind a NAT.

When you got the speed change from your ISP did they change your modem? I’ve seen a lot of speed upgrades being done by the cable companies around here (TWC & Comcast) and they will swap the modem to a DOCSIS3 modem to support the higher speeds. Consequently these newer modems have a SIP ALG turned on by default.

They did not swap the modem. I would be afraid for them to do so since things could get worse if the new modem did not implement ALG properly. But then again, things already are worse.

Instead of all this guessing you can run a simple command to see if Asterisk is binding to the port you want it to:

netstat -lnp | grep asterisk

[[email protected] ~]# netstat -lnp | grep asterisk
tcp        0      0      *                   LISTEN      9461/asterisk
udp        0      0 *                               9461/asterisk
udp        0      0      *                               9461/asterisk
unix  2      [ ACC ]     STREAM     LISTENING     8238755 9461/asterisk       /var/run/asterisk/asterisk.ctl

You are bound correctly so it’s either iptables or something higher up. Nothing to do with Asterisk

Thanks tm. I appreciate the help. i am assuming at this point it’s my hosting company. I’m waiting back to see if the ports are/can be opened.

I had my hosting company open up some ports and now I can connect.

So my comments are:

The port setting under Extensions is not used in conjunction with the SIP port settings. If the host is set to dynamic, it is ignored. I think I am correct on this.

Second point is, my other HA PBX node picked up the new SIP port without having to do a restart of Asterisk. I expected when I failed over, it would not be running on the correct port because I never restarted Asterisk on that box. I was however able to connect without a restart.

Yes. That is a really confusing setting.

I am not sure if this is a good thing or a bad thing? :smile: