SOLVED "Confused" SIP Registratons

kyle95wm

Phone Genius Owner
Joined
Apr 16, 2016
Messages
520
Reaction score
90
Okay so Im not sure if you guys are able to answer this, but I'll explain my situation the best I can.

So what happens is if we have an internet outage or we have to reset our internet connection for whatever reason, our IP endpoints act......weird. I'll give some context below.

So one phone has extension 3080 while an ATA is assigned to both 3190 and 3192. Theres also a soft-phone involved which has 3181 and another hardware phone with extension 3180.

I know exposing my extension numbers here is a security risk, but nobody will be able to find my server anyways so I don't care.

So what happens is whenever our internet goes out to the point where all endpoints de-register,

3190/3192's calls GO to extension 3080 as if 3080 is 3190/3192. All calls that are supposed to go to 3180 go to 3181.

I have not been able to confirm if calls go to 3080 - perhaps they do? The only way to fix this is to unplug all phones from the LAN for maybe 30 seconds or a minute to give Asterisk enough time to acknowledge that all endpoints are un-registered. I then proceed to reboot all the phones one by one (because I'm paranoid)

To provide some more context regarding the server, it's hosted in the cloud (therefore its all off-site) and the phones are all my my local LAN connecting to this cloud server. I have a feeling that it may be a NAT issue, but Im not sure. I haven't really changed much in my router/firewall or server. The server is running CentOS 6.8 with the latest Incredible GUI (FreePBX 12) and the latest version of Asterisk 13.

Any suggestions would be appreciated.
 

kyle95wm

Phone Genius Owner
Joined
Apr 16, 2016
Messages
520
Reaction score
90
@briankelly63 seems you deleted your comment:

Do a little searching... Well know consequence of connectivity loss in earlier Asterisk versions. There are a boatload of suggestions to minimize the issue. On is use IP addresses vs. name. Others are to cache DNS.

So I'm not fully understanding here: Where am I supposed to look? What am I making changes to? All endpoints use the server's IP address and not a DNS name.
 

kyle95wm

Phone Genius Owner
Joined
Apr 16, 2016
Messages
520
Reaction score
90
So the only thing I can make of your suggestion (or rather Google's) is to enable qualify and reduce the timeouts?
 

billsimon

Well-Known Member
Joined
Jan 2, 2011
Messages
1,540
Reaction score
729
What are the SIP endpoints you are using, and what router? Do they all use port 5060 as their source port? Are you using a super cheap router? Your router's connection tracking (which keeps NAT sorted out) isn't working right through changes in the network. Setting your endpoints to use a random source port will help. We saw this same behavior with a bunch of endpoints that all used the same source port. Having them randomized gives each endpoint more of a unique "footprint" in the NAT table and it eliminated the misrouting problem for us.
 

kyle95wm

Phone Genius Owner
Joined
Apr 16, 2016
Messages
520
Reaction score
90
What are the SIP endpoints you are using, and what router? Do they all use port 5060 as their source port? Are you using a super cheap router? Your router's connection tracking (which keeps NAT sorted out) isn't working right through changes in the network. Setting your endpoints to use a random source port will help. We saw this same behavior with a bunch of endpoints that all used the same source port. Having them randomized gives each endpoint more of a unique "footprint" in the NAT table and it eliminated the misrouting problem for us.

The SIP endpoints Im using are a combination of hardware phones, ATA's and a soft phone on the rare occasion. I have an ASUS RT-AC87R running ASUSWRT Merlin firmware (custom firmware based off the stock ASUS firmware) which is handing out DHCP option 66 to everyone.

For more details on the endpoints I have a Yealink T46G and a Mitel 5330e phone. The ATA I'm using is the Cisco SPA112, and the soft phone is X-Lite. Yes, they all use port 5060.

NOTE: I have NOT opened any ports in my router, as these phones are connecting to a server hosted on DO.

How would I go about setting a "source port" for my endpoints? Is it something on the phone or PBX side?

What you're saying makes sense, as like I said above all endpoints use the same SIP port (5060) so Im guessing when my router/internet connection restarts, the server doesn't know which physical endpoint belongs to which extension. I would assume if I were to run an in house PBX this would obviously be easier to deal with, as each endpoint has its own IP, unlike with my setup where all endpoints share a single public routable address.
 

kyle95wm

Phone Genius Owner
Joined
Apr 16, 2016
Messages
520
Reaction score
90
Here's the output of "sip show peers". Note that 3181 is my soft phone which isn't open currently.

Code:
Name/username             Host                                    Dyn Forcerport Comedia    ACL Port     Status      Description                    
3080/3080                 99.238.236.0                           D  No         No          A  5060     OK (114 ms)                                
3180/3180                 99.238.236.0                           D  No         No          A  1026     OK (112 ms)                                
3181/3181                 (Unspecified)                            D  No         No          A  0        UNKNOWN                                    
3190/3190                 99.238.236.0                           D  No         No          A  1024     OK (152 ms)                                
3192/3192                 99.238.236.0                           D  No         No          A  1024     OK (109 ms)                                
FlowRoute/xxxxxxxx        216.115.69.144                              Yes        Yes            5060     Unmonitored
 
Last edited:

kyle95wm

Phone Genius Owner
Joined
Apr 16, 2016
Messages
520
Reaction score
90
hmmm so I just took a quick look at my "per-extension" settings and noticed for my 3190 extension (I assume other extensions are like this too) NAT is set to no and the port is set to 5060. However in the SIP settings the NAT there is set to yes. What should I be doing?
 

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
1,642
Reaction score
852
3190 and 3192 will never work as expected as they both appear as 99.238.236.137 on port 1024, I suggest your ATA/extensions_on_them might need to be configured to use separate ports and further any and all routers will need to bear that in mind.
 

kyle95wm

Phone Genius Owner
Joined
Apr 16, 2016
Messages
520
Reaction score
90
I set NAT to yes in all extensions if that helps the situation......
 

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
1,642
Reaction score
852
No, it doesn't you can't expect asterisk to differentiate between two extension that don't differ on ip address and port, how would it know?, both phones can probably call out, but calls to them would "randomly" ring on the last device that registered, the call is effectively sent to 99.238.236.137 on port 1024 what at the far end will adjudicate that dilemma , please think about that . . .
 

kyle95wm

Phone Genius Owner
Joined
Apr 16, 2016
Messages
520
Reaction score
90
Okay so now I need to ask, PBX-wise, what needs to be done on the server and client end? My router would more than likely not have a problem going out, as I would be changing the port per extension, correct? ALL extensions are currently set to use 5060 for their port numbers (for connecting/registering). What I am most confused about is where the 1024 port number came from, as there is no mention of it anywhere in the FreePBX GUI.

If I change the port from say, 5060 on 3192 to say, 5061 (or whatever port happens to be available on the system) I assume I would have to change this port on the client side as well? If I decide I wanted to use more ports, would I need to open these in my iptables firewall (on the server)?

I just want to make sure I'm understanding what everyone here is saying about port numbers and IP addresses.

EDIT: Just took a look at IPTABLES and remembered that my specific IP address was being allowed FULL server access to EVERY port. However on some entries (like when I used add-fqdn or add-ip scripts) where I told it to only allow TCP and UDP SIP ports 5060-5069 were opened for those addresses. Interesting!
 

kyle95wm

Phone Genius Owner
Joined
Apr 16, 2016
Messages
520
Reaction score
90
Okay sorry for double posting again but I think I got it!

So I went into my PBX and changed my FAX machine to use port 5061 while still keeping my first port of my ATA at 5060.

Code:
Name/username             Host                                    Dyn Forcerport Comedia    ACL Port     Status      Description                   
3080/3080                 99.238.236.0                           D  Yes        Yes         A  5060     OK (116 ms)                               
3180/3180                 99.238.236.0                           D  Yes        Yes         A  1026     OK (109 ms)                               
3181/3181                 (Unspecified)                            D  Yes        Yes         A  0        UNKNOWN                                   
3190/3190                 99.238.236.0                           D  Yes        Yes         A  1024     OK (143 ms)                               
3192/3192                 99.238.236.0                           D  Yes        Yes         A  5061     OK (147 ms)                               
FlowRoute/xxxxxxxx       216.115.69.144                              Yes        Yes            5060     Unmonitored

Now Im not sure if I should be concerned about the other phones on my network, but I think this is a good enough fix.
 
Last edited:

Members online

Forum statistics

Threads
25,841
Messages
167,939
Members
19,264
Latest member
baata
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top