3CX PBX in the Cloud
1 year FREE - no ties!
google cloud platform
3CX
Zero Admin
With the new Dashboard
3CX
Bulletproof Security
With SSL certs and NGINX
3CX
Install on $200 Appliance
Intel MiniPC architecture
3CX
New, Intuitive Windows Client
More themes, more UC
3CX
More CRM Integrations
Scripting Interface to add your own
3CX
Improved Integrated Web Conferencing
iOS and Android apps included
3CX
Run On-Premise or in the Cloud
Google, OVH, Windows & Linux
Fast & easy call management
With the 3CX Web Client

Failover

Configuring Failover with 3CX

The Failover feature in 3CX allows you to create a replica of your PBX. In the event that your PBX fails, your replica PBX will become active minimizing downtime and data loss. Below are the steps required in order to activate this functionality.

Licensing

One Enterprise (ENT) or one Professional (PRO) license key is required in order to enable the failover functionality. With an ENT license key the DNS TTL resolution for 3CX provided FQDN is set to 5 minutes thereby Pro license key uses an 6 hour TTL causing a much longer reconnect time for IP-Phones, 3CX Clients, 3CX SBCs or the 3CX WebClient in case of an Fail.

Failover Form

3CX uses an active - passive approach using build in replication of the configuration with a maximum offset of 24h. The active host processes calls and presence information where by the passive host acts as monitor of the active host. In case of a failure of the active host (independent of application, OS or hardware failure), the passive host stops its monitoring role and takes over the role as active host. It is depending on the configuration of the passive host in which state the master host shall be declared at fault and the switch shall be initiated, more to this later.

Topologies

The following network failover cases are covered by the failover process:

  • On Premise (NAT)
  • Scenario A: with only remote extensions
  • Scenario B: with local and/or  remote extensions
  • Cloud (Public Host)
  • Scenario C: with only remote extensions as STUN / SBC

A failover from an On Premise host to a Cloud host (and vice versa) is not supported. Documentation and processing is solely tested and supported while using 3CX provided public FQDNs. While theoretically it is possible to use custom public FQDN for the process, it is the administrator's obligation to control, update and manage all DNS entries on their own evaluation.

Pre-requisites

Before configuring or enabling 3CX failover on your 2 servers, the 3CX Installations need to have a specific configuration.

  1. One 3CX Cloud PBX (with Public IP) to another 3CX Cloud PBX (with it’s own Public IP) both installed with external FQDN
  2. Both Servers should each be installed with identical settings, including FQDN, SSL Certificate, SIP, Tunnel, web server ports and web server type.
  3. When you install 3CX, you need to select 3CX FQDN.
  4. The IP Phones Provisioning dropdown, need to have the Select interface set to the FQDN (NOT IP)

You can have other variants like Custom FQDN, with one server in the LAN and another in the Cloud. However, for these configurations you will need to add complex scripting to update your DNS and FQDNs when failover occurs. See bottom of this article for more info.  

“Overview of how it works:”

Configuring the Active and Passive Servers

Step 1: Configuring the  ACTIVE SERVER

  1. Go to Server 1. We will assume that this is your production server where 3CX V15 is already pre-installed, with a configuration on it.

  1. All Extensions need to be configured to provision using the FQDN. Configure IP Phone extension provisioning > Phone Provisioning > “Select Interface” >> Select from the drop down your FQDN.

Screen Shot 2017-02-21 at 12.15.39.png

  1. Go to Backup and restore > Location and select Google Drive as the backup location (you can also use other backup options). In this example we will store all backups in a Google Drive folder named “SIP3CXCOMBackups”.

 

  1. Click on Backup Schedule and configure what backup options you want to include in your backup and when the backup will be made. We recommend to do this daily and at night. In the above example, at 1:00 AM a backup will start and the backup will be uploaded to Google Drive named “3CXScheduledBackup.zip”. This is a hardcoded name for the latest backup. Press OK.

Screen Shot 2017-02-21 at 20.46.08.png

  1. Whilst still in the Backup and restore section, click the “Failover” button. Enable Failover checkbox and select “Active”. Press OK to save.

Active machine is successfully configured. Automatic backups will be made and stored in GDrive. Go to Step 2 to configure the Passive server.

Step 2: Configuring the PASSIVE SERVER

Important:  For scenarios where the Active and Primary Servers are behind different Public IP addresses, when you first complete the installation of the passive server and you run through the installation options, your Public FQDN will be rewritten to the Public IP of the failover server. To re-write your External FQDN to resolve back to the Public IP of the Active Server you will need to go to your primary server press to edit the license and then hit Apply so that the FQDN is switched back to the 3CX Active server and restart its services.

Failover Server Configuration

Go to Server 2 and install 3CX Phone System using the same configuration settings as your active server.

  1. Whilst on server 2 click on backup and restore > “Restore Schedule”. Enable Schedule Restore and set a time when the restore should be applied. Check the option “Do not start services after restore”. Press OK to save.

  1. Click on the “Failover” button, check “Enable Failover” and select the radio button “Passive”
  1. Enter the IP Address of the Active server - in this example 1.1.1.1
  2. Select which services you want to monitor: SIP Server, Web Server or Tunnel Server.
  3. Select the interval you want the heartbeat checks to be made, (default 30 seconds) and configure whether failover should occur if one or all tests fail.
  4. Press OK to save the configuration and start monitoring.

When the Active server fails, the passive will detect and take over. The backup would be already restored and the failover action will trigger the DNS Change on the 3CX DNS Servers updating the FQDN to the IP Address of the now new Active server.

It is important that the EX-Active server is shutdown because if some services are still running, these might conflict with the server that just took over.

Note: When it comes to Gateways (FXS/FXO) in a failover scenario, these are not supported as gateways are only supported when Local to your System (reachable via Local LAN). Even in cases where there is a site to Site VPN between NATed Servers, we cannot support Gateway Registration and failover to the Failover server as it depends on manufacturer/model/gateway capabilities.

For users that want to use custom FQDN, and LAN to LAN or LAN to CLOUD scenarios, you will need to make use of advanced scripting and services like Active Directory to allow powershell scripts to run with elevation.

You can find sample scripts for Windows based machines here.

Some scripts might need to run under impersonated user accounts. To achieve this you will need to follow additional steps documented here: https://www.3cx.com/docs/failover-script-user/

 

You might also be interested in:

Get 3CX Free for 1 Year Today
Download On-Premise Try in the Cloud