---
title: "Send incoming calls to more than one PBX or site, with failover"
url: "https://enfonica.com/help/sip-trunking/load-balancing-failover"
summary: "Create a load balancer in your SIP domain, and add each PBX or site as an endpoint with a priority and weight. Add a failover destination, such as a voicemail flow or a mobile. Then point your phone numbers at the load balancer, and Cloud SIP tries each endpoint in turn."
type: how-to
audience: everyone
products: ["Cloud SIP", "Phone Numbers"]
works_with: ["Any SIP PBX, SBC or contact center platform"]
who_can_do_this: "Whoever manages your Enfonica project"
---

# Send incoming calls to more than one PBX or site, with failover

**Short answer:** Create a load balancer in your SIP domain, and add each PBX or site as an endpoint with a priority and weight. Add a failover destination, such as a voicemail flow or a mobile. Then point your phone numbers at the load balancer, and Cloud SIP tries each endpoint in turn.

**Applies to:** Cloud SIP, Phone Numbers  
**Works with:** Any SIP PBX, SBC or contact center platform  
**Who can do this:** Whoever manages your Enfonica project

## Before you start

- A Standard SIP domain in your project. A Teams Direct Routing SIP domain has one built-in load balancer for Teams, and you can't add your own.
- The public IP address or DNS name of each PBX or site, and the port it receives SIP on.
- A firewall at each site that allows Enfonica's signaling and media addresses.

## How a load balancer decides where a call goes

A load balancer is a list of places where Cloud SIP can deliver a call. It's kept inside your SIP domain, and it has its own address, such as `sip:main-office@example.sip.enfonica.com`. Your phone numbers send calls to that address instead of straight to one PBX (private branch exchange, your phone system).

Each place in the list is an endpoint. Two numbers decide the order in which Cloud SIP tries them:

- **Priority**. Endpoints with the lowest number are tried first. Higher numbers are backups.
- **Weight**. Among endpoints with the same priority, calls are shared in proportion to their weight. With weights of 20 and 10, the first endpoint is tried first for about two calls in three.

These examples show common setups.

| You want | Set your endpoints like this |
| --- | --- |
| A main site with a backup site | Main site priority 10, backup site priority 20 |
| Calls shared evenly between two PBXs | Both priority 10, both weight 10 |
| Two thirds of calls to one PBX, a third to the other | Both priority 10, weights 20 and 10 |

Cloud SIP moves on to the next endpoint when one doesn't respond, or answers with a server error, such as `500` or `503`. When a PBX answers that the line is busy, that the call is declined, or that the number isn't found, the answer is final. It goes back to the caller. If every endpoint fails, the call goes to the load balancer's failover URIs, such as a voicemail flow or a mobile.

## Create the load balancer

Add one endpoint for each PBX or site. Then add a failover destination for when none of them can take the call.

1. In the [Enfonica Console](https://console.enfonica.com/), go to **Cloud SIP**, and open your SIP domain.
2. Under **Load balancers**, select **Add load balancer**.
3. In **Alias ID**, enter a short name, such as `main-office`. Use lowercase letters, numbers, and hyphens. The alias becomes the load balancer's address, `sip:main-office@example.sip.enfonica.com`, and you can't change it later.
4. Optionally, add a **Display name** that your team will recognize.
5. Under **Endpoints**, select **Add endpoint**.
6. In **Endpoint URI**, after the `sip:` that's already shown, enter your PBX's address, for example `203.0.113.10` or `pbx.example.com`. The table after these steps shows each format.
7. Set **Priority** and **Weight**. Both start at 10.
8. Leave the **Enabled** checkbox selected, and then select **Add**.
9. Repeat steps 5 to 8 for each PBX or site, up to 10 endpoints.
10. Under **Failover URIs**, select **Add**, and choose where calls go if every endpoint fails. For the options, see [Choose a failover destination](https://enfonica.com/help/sip-trunking/load-balancing-failover#choose-a-failover-destination).
11. Select **Save**, and then select **Save Changes** on the SIP domain page. The load balancer isn't saved until you select **Save Changes**.

Use the **Endpoint URI** format that matches your PBX.

| Your PBX | Endpoint URI |
| --- | --- |
| Has a static public IP address, on port 5060 | `203.0.113.10` |
| Has a DNS name, including a dynamic DNS name | `pbx.example.com` |
| Receives SIP on another port | `pbx.example.com:5080` |
| Uses TLS (port 5061 by default) | `pbx.example.com;transport=tls` |
| Uses TLS and requires encrypted audio (SRTP) | `pbx.example.com;secure=true` |

Use an IPv4 address or a DNS name. IPv6 isn't supported.

Cloud SIP sends the number that was called in E.164 format, such as `+61255501234`, so set your PBX's inbound routes to match that format. For more information, see [Which number format should my PBX use?](https://enfonica.com/help/sip-trunking/number-formats)

Each site's firewall must accept SIP and call audio from Enfonica's addresses. For the list, see [Connect your PBX to Cloud SIP](https://enfonica.com/help/sip-trunking/connect-pbx-to-cloud-sip). A backup site that can't receive them won't take calls when you need it.

## Choose a failover destination

Failover URIs run inside Enfonica, so they keep working when your office, internet connection, or phone system is offline. They're tried in order. Most people need only one.

- **Voicemail or a message**. Select **Flow**, and then select a flow that takes a voicemail, plays a message, or both. To learn how to build one, see [Set up voicemail to email in Flow](https://enfonica.com/help/flow/voicemail-to-email). Our [voicemail failover video](https://enfonica.com/blog/configuring-voicemail-failover-for-a-sip-trunk/) also walks through it.
- **A mobile or another number**. Select **Phone Number**, and enter the number in E.164 format, for example `+61491570156`.
- **Another system**. Select **SIP**, and enter the system's SIP URI.

## Point your phone numbers at the load balancer

Each phone number that should use the load balancer needs it as its incoming call handler. One load balancer can serve as many numbers as you like.

1. Go to **Phone Numbers > My numbers**, and open the number.
2. Under **Call settings**, in **Incoming call handlers**, select **Add**, and then select **SIP**.
3. Select **Load balancer**, and then select your load balancer from the list.
4. If the number has another handler from before, delete it.
5. Select **Save Changes**.

A phone number can use only a load balancer in the same project.

Failover URIs run when calls reach the load balancer in one of these ways:

- From a phone number's handler, as in these steps
- Through a Flow **Load Balancer** step
- Through VoiceML

A Flow **Call** step that dials the load balancer's address tries its endpoints, but skips its failover URIs.

> **Warning:** Before you delete a load balancer, move its phone numbers to another handler. A number whose handler points at a deleted load balancer stops receiving calls.

## Check that it worked

1. Call one of your numbers from a mobile. It rings on the endpoint with the lowest priority number.
2. To test the backup, open the load balancer, and edit that endpoint.
3. Clear the **Enabled** checkbox, and then select **Update**.
4. Select **Save**, and then select **Save Changes**. Cloud SIP skips disabled endpoints.
5. Call again. The call rings at your next endpoint.
6. To test the failover destination, make each PBX reject a test call with a server error, such as SIP `500`. Or take them offline briefly at a quiet time. The call reaches your voicemail, message, or mobile.
7. On every endpoint you turned off, select the **Enabled** checkbox again, and save.

If a test call doesn't arrive where you expect, open it in **Cloud Voice > Calls**. Its **SIP Insights** show the answer your PBX sent. To learn what the common answers mean, see [Calls aren't reaching your PBX](https://enfonica.com/help/call-troubleshooting/inbound-calls-not-arriving).

## Questions

### My PBX's public IP address changes. Can I still use a load balancer?

Yes. Give your PBX a dynamic DNS name that follows its address, and use that name as the endpoint URI. Cloud SIP looks up the name to find your PBX. If you can, host the PBX in the cloud with a static IP address instead. It's simpler to run.

### Several PBXs share one IP address. How do I send calls to the right one?

Give each PBX its own SIP port, and include the port in each endpoint URI, for example `203.0.113.10:5070`. Some hosted PBXs offer this as a dedicated port for each trunk.

### Can my 1300 or 1800 numbers go straight to my phone system?

Yes. Point the 1300 or 1800 number's handler at your load balancer, the same way as any other number. With no DID (direct inward dialing number) in between, there's no forwarding charge, the audio takes a shorter path, and there's no DID that could fail.

### Can I take a PBX out of service for maintenance?

Yes. On its endpoint, clear the **Enabled** checkbox, and save. Calls go to your other endpoints until you select the checkbox again.

## What to send us

Include these and we can find the call straight away.

- The number that made the call and the number it called, in full international format (for example +61255501234).
- The date and time of the call, with your timezone.
- Whether the call was inbound or outbound.
- The call ID, if the Console shows the call.
- What happened: an error message, silence, a busy tone or a dropped call.

[Contact support](https://enfonica.com/contact-support?article=%2Fhelp%2Fsip-trunking%2Fload-balancing-failover&topic=call-fault)

## Related

- [Connect your PBX to Cloud SIP](https://enfonica.com/help/sip-trunking/connect-pbx-to-cloud-sip.md)
- [Calls aren't reaching your PBX](https://enfonica.com/help/call-troubleshooting/inbound-calls-not-arriving.md)
- [Set up voicemail to email in Flow](https://enfonica.com/help/flow/voicemail-to-email.md)
- [Configuring voicemail failover for a SIP trunk (video)](https://enfonica.com/blog/configuring-voicemail-failover-for-a-sip-trunk/)
- [Implementing a business continuity plan for your call center](https://enfonica.com/blog/implementing-a-business-continuity-plan-for-your-call-center/)
- [Load balancing with Cloud SIP (docs)](https://enfonica.com/docs/cloud-sip/load-balancers/)

---

Web version: https://enfonica.com/help/sip-trunking/load-balancing-failover
