๐ 3CX and Multiple SIP Trunks: Failover Routing Setup
Summary: Business continuity depends on reliable phone connectivity. This guide shows you how to configure multiple SIP trunks and failover routing in 3CX. Learn active/active load balancing, active/standby failover, cost-based routing, and step-by-step outbound rule configuration to ensure your calls always get through โ even when a primary trunk fails.
๐ Table of Contents
- 1. Why Multiple SIP Trunks & Failover?
- 2. Failover Modes: Active/Active vs Active/Standby
- 3. Adding Multiple SIP Trunks in 3CX
- 4. Configuring Outbound Failover Rules
- 5. Cost-Based Routing with Multiple Trunks
- 6. Priority-Based Routing (Active/Standby)
- 7. Load Balancing (Active/Active)
- 8. Testing Your Failover Configuration
- 9. Best Practices
- 10. Frequently Asked Questions
- 11. Related Resources
๐ Why Multiple SIP Trunks & Failover?
Your phone system is the lifeline of your business. A single SIP trunk represents a single point of failure โ if that trunk goes down due to network issues, provider outage, or configuration errors, your business loses the ability to make or receive calls. Multiple SIP trunks with failover routing eliminate this vulnerability.
โ Key Benefits
- High Availability: Automatic failover ensures calls route through backup trunks.
- Redundancy: Protect against provider outages or network failures.
- Cost Optimization: Route calls through the cheapest provider for each destination.
- Load Balancing: Distribute call volume across multiple trunks.
- Business Continuity: Never miss a customer call, even during emergencies.
โ ๏ธ Common Failure Scenarios
- Provider outage: Your primary carrier experiences a regional outage.
- Network failure: Internet connectivity issues at your site.
- Registration issues: SIP registration expires or fails.
- Capacity overflow: Call volume exceeds trunk capacity.
- Security incidents: DDoS attacks or credential compromise.
โ๏ธ Failover Modes: Active/Active vs Active/Standby
3CX supports two primary failover strategies. Understanding the difference helps you choose the right approach for your business.
| Feature | Active/Active (Load Balancing) | Active/Standby (Failover) |
|---|---|---|
| Description | All trunks are active and distribute calls simultaneously | Primary trunk handles all calls; secondary trunk only used when primary fails |
| Call Distribution | Weighted distribution across trunks (e.g., 60% / 40%) | 100% of calls on primary when available |
| Redundancy Level | High โ all trunks share the load | High โ but secondary trunk is idle most of the time |
| Cost Efficiency | Can optimize based on provider rates | May incur idle costs for backup trunk |
| Failover Speed | Instant โ trunk failure removes it from rotation | Instant โ 3CX detects failure and switches |
| Ideal For | High-volume call centers, cost optimization | Mission-critical businesses needing guaranteed redundancy |
| 3CX Implementation | Multiple outbound rules with same dial pattern, different trunk weights | Single outbound rule with trunk priority order |
โ Adding Multiple SIP Trunks in 3CX
Before configuring failover, you need to add each trunk to 3CX. Here's how:
- 1 In the 3CX Management Console, go to Voice & Chat โ SIP Trunks.
- 2 Click "Add SIP Trunk" and configure your primary trunk (e.g., NetviaVoice Primary).
- 3 Repeat the process to add your secondary (backup) trunk (e.g., NetviaVoice Backup or another provider).
- 4 For each trunk, ensure authentication is properly set (IP-based or registration).
- 5 Assign DIDs to each trunk if inbound calls are needed on both.
- 6 Verify each trunk shows as "Registered" (green checkmark) in the SIP Trunks list.
๐ก Pro Tip: Use descriptive names like "Primary โ NetviaVoice" and "Backup โ NetviaVoice Secondary" to easily identify trunks in outbound rules.
๐ค Configuring Outbound Failover Rules
3CX outbound rules are the key to failover routing. Here's a step-by-step approach:
- 1 Go to Voice & Chat โ Outbound Rules.
- 2 Click "Add Outbound Rule".
- 3 In the "General" tab, give the rule a name (e.g., "Failover โ All Calls").
- 4 Define the Dial Pattern (e.g., "1XXXXXXXXXX" for US numbers, or "X." for all numbers).
- 5 In the "Trunk" section, select your primary trunk first, then add the secondary trunk.
- 6 Order matters: The first trunk in the list is used first. If it fails, 3CX tries the next trunk.
- 7 Click "OK" to save the rule.
โ ๏ธ Important: 3CX determines trunk failure based on SIP response codes (e.g., 503, 408) and registration status. If a trunk is unreachable, 3CX automatically fails over to the next trunk in the rule.
๐ฐ Cost-Based Routing with Multiple Trunks
You can create separate outbound rules based on destination to optimize costs. For example:
| Rule Name | Dial Pattern | Trunk (Priority Order) | Purpose |
|---|---|---|---|
| Local Calls | 1[2-9]XXXXXXXXX (US 10-digit) | Primary Trunk โ Backup Trunk | Route US calls through primary; failover to backup |
| International Calls | 011X. | International Trunk โ Primary Trunk | Use cheaper international provider first |
| Toll-Free Calls | 1800XXXXXXX | Toll-Free Trunk โ Primary Trunk | Use specialized toll-free provider |
| Emergency Calls | 911 | Primary Trunk โ Backup Trunk | Ensure 911 always routes (with failover) |
๐ก Pro Tip: Create multiple outbound rules with different dial patterns to take advantage of each provider's strengths. For example, use one carrier for US calls and another for international.
๐ Priority-Based Routing (Active/Standby)
For Active/Standby failover, configure a single outbound rule with trunks in priority order:
- 1 Create an outbound rule for your desired dial pattern.
- 2 In the Trunk section, add Primary Trunk as the first option.
- 3 Add Secondary Trunk as the second option.
- 4 (Optional) Add a third trunk as a tertiary fallback.
- 5 3CX will always try the first trunk; if it fails, it moves to the second, and so on.
โ Example: Active/Standby Setup
- Rule Name: "Failover โ All US Calls"
- Dial Pattern: 1XXXXXXXXXX
- Trunk 1 (Primary): NetviaVoice Primary
- Trunk 2 (Backup): NetviaVoice Backup
- Behavior: All calls use Primary trunk. If Primary is unavailable (registration fails, timeout), calls automatically route through Backup.
โ๏ธ Load Balancing (Active/Active)
For Active/Active load balancing, you need multiple outbound rules with the same dial pattern, each assigned to a different trunk, with distribution weights.
- 1 Create Rule A with your dial pattern, assign Trunk 1, and set a weight (e.g., 60%).
- 2 Create Rule B with the same dial pattern, assign Trunk 2, and set a weight (e.g., 40%).
- 3 Ensure both rules have the same Dial Pattern and Priority level.
- 4 3CX distributes calls based on the weight ratio.
โ ๏ธ Important: When using active/active load balancing, ensure that all trunks are properly registered and have sufficient capacity. Also, consider DID routing for inbound calls if you have separate DIDs on each trunk.
๐งช Testing Your Failover Configuration
After configuration, always test your failover setup:
๐น Test Method 1: Simulate Failure
- Temporarily disable the primary trunk (uncheck "Active" in the trunk settings).
- Place an outbound call โ it should route through the backup trunk.
- Re-enable the primary trunk and verify calls return to it.
๐น Test Method 2: Registration Expiry
- Change the registration timeout on the primary trunk to a very short value (e.g., 10 seconds).
- Wait for registration to expire, then place a call.
- Verify failover to the secondary trunk.
๐ก Pro Tip: Always test failover during off-peak hours to minimize business impact. Monitor the 3CX Activity Log for detailed failure and failover messages.
๐ Need Help with 3CX Failover Routing? NetviaVoice Can Assist
Our VoIP specialists can help you design and implement a robust multi-trunk failover strategy for your 3CX PBX โ ensuring maximum uptime and cost efficiency.
Visit NetviaVoice๐ Best Practices for Multi-Trunk Failover
๐น Provider Diversity
- Use trunks from different providers to avoid a single provider outage affecting all trunks.
- Consider one provider for primary and a different one for backup.
- Diversify by network path (e.g., different carriers, different geographic regions).
๐น Monitoring & Alerts
- Set up 3CX monitoring to alert you when a trunk fails.
- Use 3CX's built-in email notifications for trunk registration failures.
- Implement external monitoring tools (e.g., PRTG, Nagios) for proactive alerts.
๐น Regular Testing
- Schedule monthly failover tests to ensure backup trunks work.
- Document test results and update configurations as needed.
- Test both outbound and inbound failover (if you have DIDs on multiple trunks).
๐น Documentation
- Maintain a trunk inventory with provider details, credentials, and priority.
- Document outbound rules and their failover logic.
- Keep a runbook for manual failover procedures if automation fails.
โ Frequently Asked Questions
In the 3CX Management Console, go to Voice & Chat โ SIP Trunks and click 'Add SIP Trunk' for each provider. Configure each trunk with its own authentication (IP-based or registration) and DID numbers. Then create outbound rules to assign priority or distribute calls across trunks.
Failover routing ensures business continuity by automatically switching to a backup SIP trunk if the primary trunk fails. 3CX achieves this through outbound rules with multiple trunk selections โ if the first trunk is unavailable, calls route to the next trunk in the priority order.
Active/active distributes calls across multiple trunks simultaneously for load balancing and redundancy. Active/standby keeps the secondary trunk idle until the primary fails, then takes over automatically. 3CX supports both via outbound rule trunk ordering and weight-based distribution.
You can create separate outbound rules based on dial patterns (e.g., prefix for international, local, toll-free) and assign different trunks to each. This allows you to route calls through the cheapest provider for each destination, optimizing costs.
Yes, you can use trunks from different providers for failover. 3CX supports mixing providers โ for example, a primary trunk from NetviaVoice and a backup from another carrier. Just ensure each trunk is properly configured and registered.
๐ Related Articles & Resources (NetviaVoice)
Explore more guides to optimize your 3CX and SIP infrastructure:
โจ For personalized assistance with 3CX failover routing, multi-trunk setup, or VoIP migration, visit our Services page or contact our team directly.
๐ข Need a robust failover strategy for your 3CX phone system? Let NetviaVoice design it for you.