Solved

VOIP / Asterisk Fail-Over Possibilities?

Posted on 2009-05-20
8
1,340 Views
Last Modified: 2013-11-12
I am wondering about fail-over capability with VOIP, in an asterisk environment and SIP peers or UA devices, across the WAN or internet.

I want to eventually have fail-over in case the main internet connection that my asterisk server is on, goes down.

I was hoping to do this through some sort of dynamic DNS with my domain through Godaddy but apparently they do not support dynamic DNS.

I have my domain setup through godaddy, and I created an A record for voip.mydomain.com, pointed it to my asterisk WAN IP and thought about using that address in my UA or sip peers, instead of the IP address.

Is there a way to have a solid fail-over with sip peers in an asterisk environment?  I think the solution has something to do with DNS SRV, but I am not too familiar with how it works.  Does using DNS SRV cause more problems with things like, 1 way audio etc?  

Thanks!
0
Comment
Question by:jkockler
  • 4
  • 2
  • 2
8 Comments
 
LVL 25

Expert Comment

by:Ron M
Comment Utility
Asterisk supports failover in a simple way...and others have taken it further, with load balancing techniques that i've never tried myself...

Use multiple dial statements in order of preference.

example...

exten => _NXXNXXXXXX,1,Dial(zap/g2/${EXTEN},30)
exten => _NXXNXXXXXX,1,Dial(${EXTEN}@tosipprovider,30)

If the voice circuit was down, then the first dial command would fail and the second dial command would be tried, sending the call to a sip provider (your other asterisk box used for failover).
0
 
LVL 25

Expert Comment

by:Ron M
Comment Utility
Priority typo corrected...

exten => _NXXNXXXXXX,1,Dial(zap/g2/${EXTEN},30)
exten => _NXXNXXXXXX,n,Dial(${EXTEN}@tosipprovider,30)
0
 
LVL 4

Author Comment

by:jkockler
Comment Utility
Okay thanks for that side of it, but I am wondering about the other side of it.

You explained how asterisk could go to a different service provider if possibly the service provider went down.

My question pertains more to how the sip peers can always find the asterisk server.  So for example, I have a Linksys ip phone at a remote site.  It connects to asterisk at Public IP address 22.222.22.222.  If the ISP hosting the ip address 22.222.22.222 goes down, I am looking for a way for the linksys phone to still be able to contact the asterisk box.  The Asterisk box stays online, because I can have a dual WAN port firewall, that rolls over to a secondary ISP.  In the event that it rolls over to the secondary ISP, the PUBLIC IP of asterisk would change to for example 33.333.33.333.  

How can I make sure the Linksys IP phone will always find the asterisk server, even on the alternate IP address??
0
 
LVL 19

Accepted Solution

by:
feptias earned 250 total points
Comment Utility
If you want to protect against the possibility of your main Internet connection failing, then you must consider the following:
a) which elements of your service will be affected
b) what options are available to you to provide an alternative solution
c) what level of service you want to be able to provide under those circumstances.

Any remote IP phones that were registered with your Asterisk PBX will lose service, but any IP phones being used as extensions on the LAN will be ok; Any SIP trunks or similar VoIP based PSTN connections will be out, but any analogue or ISDN connections will still work.

The only direct alternative to a broken Internet connection is to a second Internet connection through a different provider and on different cables. Many business grade firewalls/routers can accommodate dual WAN connections and the failover would be transparent for outbound connections but for inbound all your IP addresses will change (unless you are using some serious commercial equipment with BGP). To overcome the problem of your IP addresses changing, remote IP phones would need to use DNS-SRV or failover DNS. GoDaddy don't do failover DNS, but DNSMadeEasy and Netriplex do. However, there will be latency in the phones detecting that the old registration has failed before they re-register using the new addresses. DNS-SRV does not cause problems of 1-way audio.

What is the minimum level of service that must be maintained? Perhaps remote users would be ok provided they can still make calls to the PSTN, in which case a prepay VoIP account configured on one of the spare line keys might be adequate. If they need to maintain connectivity with the Asterisk PBX then you'll need the backup Internet route and the DNS-SRV or failover DNS.

What about incoming calls to the PBX? If they are all delivered over VoIP then you will have problems. If Asterisk registers with the service provider then it may not re-register itself (using the new IP address) until the normal registration expire time is reached - that can be half an hour or more. If your VoIP service provider connects to you by IP address then they will have to operate some kind of failover to reach you on the alternative IP address. Some VoIP service providers will be able to offer failover routing for your inbound calls, provided you have an alternative path that they can deliver to - that could be via conventional ISDN or analogue trunks.

What I've mentioned there just relates to failure of your Internet connection. Have you also considered failure of the Asterisk server, your router, firewall or LAN switch?
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 25

Assisted Solution

by:Ron M
Ron M earned 250 total points
Comment Utility
In this case, you have a few options...all of which require having two internet connections.

1, get your DNS hosted with someone who supports dns failover and server monitoring, so if your server shows offline it will update the host record to the failover ip address connection.  In this case you would have clients registering to a hostname... for example    voip.yourdomain.com, rather than having them register to an IP address.  There could potentially be a short outage in service however...which is always the case when you are dealing with dns record changes.

2, you could put the voip traffic through a vpn,....and on many firewalls/routers you can use a vpn failover IP address.  In this case your clients wouldn't be registering to a public ip, but rather the internal , local ip address of your asterisk server and they would have to have vpn capability.

3, On the Linksys phones you have the ability to assign multiple extensions to different sip proxies.  In this case you would create identical settings for extensions 3 and 4 as you would 1 and 2, but with the failover address as the IP address.  You could also use 3 extensions on the main IP and one extension as a backup if you chose.  In this case I would leave the secondary failover connection in a down state, and it would be a manual intervention to restore service by bringing it up.  This would eliminate 1 or 2 extensions however on phones that support 4, also the phones would experience a delay in re-registering, depending on how fast your response time is and the registration interval you setup..
0
 
LVL 25

Expert Comment

by:Ron M
Comment Utility
Worth noting, is that calls that were in progress at the time of the failover would be terminated immediately, no matter which option you choose.  These are options to failover the registration of the phones and the connection path.
0
 
LVL 19

Expert Comment

by:feptias
Comment Utility
Another note - you will not be able to use the externip parameter in sip.conf. Instead you must use externhost and externrefresh. Set externhost to the host name used in your failover DNS A record and set externrefresh to something greater than the default 10 which is too low. I think 120 is ok for the refresh interval.
0
 
LVL 4

Author Closing Comment

by:jkockler
Comment Utility
Thanks for all the information !!! Very helpful.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Join & Write a Comment

So you think no one can listen in on your VOIP conversations, eh? Well... if you haven't setup Secure Real Time Transport (SRTP), your voice communications can be hacked into by just about anyone! First, let's talk about the intended audience for…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now