Link to home
Start Free TrialLog in
Avatar of Jeff swicegood
Jeff swicegood

asked on

Asterisk loses it's connection to VoIP provider every day or so

I am trying to get my connection to be stable.  Everything works fine but then every 24 hours (not exactly) SIP SHOW PEERS reports that Viatalk, my VoIP provider, is UNREACHABLE (but I can ping Viatalk, no problem) which is then fixed by power cycling the modem (not the router). It is a Zyxel 660R modem.  All other servers and connections on the network work fine while this is happening.
Avatar of Jeff swicegood
Jeff swicegood

ASKER

Just to clarify: Asterisk is the only thing that loses it Internet connection. Asterisk is running within a Virtual machine  on an Ubuntu host. The VM has it's own NIC (is bridged to) connected directly to the router.

Router: Netgear WNR3500L running dd-wrt
hi
does the connection become ok when you restart asterisk??
plus are your connected to your VoiP provider using their server name or IP?

Hi, Thank you for your response.  Resetting Asterisk does not restore the connection. It is connected using the server name, but ping is able to resolve it when I try it.
Avatar of Member_2_1968385
In the past, Netgear firewall/routers would often manipulate the contents of some SIP packets - I assume this was in a misguided attempt to be "helpful", but the consequences were nearly always bad. However, on the latest firmware versions I have seen a new "SIP ALG" option (in the Security section, under Advanced settings). The option can be switched on or off. I recommend that you (a) upgrade to the latest firmware on the Netgear router and (b) see if that SIP ALG option exists and, if so, switch it off.

Another possibility is to disable connection testing on Asterisk for this SIP Peer. It could mean that you are just hiding the problem rather than fixing it, but sometimes the connection testing thinks the link is broken when in fact it is still working. The option to look for is "qualify". To disable it just set qualify=no.
Could it still be the Netgear router if I am not running Netgear firmware on it? It is running dd-wrt firmware. Also the same problem was there on the previous router, a trendnet 632BRP, also running dd-wrt. Could it be a dd-wrt problem?

I set quality=no. We'll see if it loses it's connection tonight.
When I set qualify=now is shows the peer as "unmonitored" but I know it's not connected because I can't make or receive any calls. It's temporarily fixed by power-cycling the modem.
I mean qualify=no.
Thanks for trying qualify=no, but if you cannot make or receive calls when the problem occurs then clearly it is not just a case of Asterisk making a mistake about the connection. In which case, I suggest you put qualify back to "yes".

Are you able to try different firmware or a different router to see if it makes any difference?

It is a curious problem - the evidence available does not point to any specific part of the connection being at fault. I would say the service provider, except that power cycling your modem fixes it. So I would say your Internet connection, except that your other servers still work. So I would say the router, except that power cycling the modem should make no difference to that.

Do you have any port forwarding set for SIP on the router?
Does Asterisk know it is behind NAT. If so, what settings are you using - STUN, externip, localnet, etc.
Are you using host=<IP-address> in the peer definition or host=name that has to be resolved by DNS? If the latter, could it be a problem with the DNS on your Asterisk server?
I will test it with a different router/firmware.

It is set to nat=yes

externip=xx.xx.xxx.xxx
localnet=192.168.0.0/255.255.255.0

I do not have port forwarding set for SIP on the router.

It has been set to host=name but I just tried it with host=<IP address> with no success.

The modem also has a NAT built in. That NAT still has the default settings. Could the double NAT be the problem? I would try setting the modem to bridge mode but I don't know what settings to make.
ASKER CERTIFIED SOLUTION
Avatar of Member_2_1968385
Member_2_1968385
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I am still testing it with a different router. It has been about 20 hours. I'll let you know tomorrow it it's still connected
It's still connected after 48 hours.I guess it was the dd-wrt causing it to disconnect. What now?
Keep testing for a bit longer to be sure. Then its up to you to decide. Can't you just run some alternative firmware such as the standard one provided by Netgear? What was the advantage of the dd-wrt firmware? If you really like dd-wrt then you'll have to contact the developers and report it as a possible bug.
OK it's still connected. Thank you for all your help. I am going to try and salvage dd-wrt, but I guess that will take some research.

Thanks again!