πŸ† 2026 MSP 501 Winner β€” Two Years Running β€” Ranked among the world’s top managed service providers. Learn more

Back to Blog

Network Engineers: Prove SIP Trunk Failover in Seconds With a Runbook

Network Engineers: Prove SIP Trunk Failover in Seconds With a Runbook

Network Engineers: Prove SIP Trunk Failover in Seconds With a RunbookSIP trunk failover is the automatic rerouting of voice traffic to a backup carrier, path, or endpoint when a primary SIP trunk stops responding. The most reliable setup combines two or more independent carriers, active SIP OPTIONS health checks, tuned PBX or SBC retry logic, and a PSTN fallback as a last resort. Done right, calls reroute in seconds with no busy signals and minimal duplicate ringing.


TL;DR:

  • Using multiple geographically separate carriers with independent infrastructure is essential, as sharing the same provider can result in simultaneous outages.
  • Setting lower qualify timeouts and combining proactive OPTIONS checks with DNS SRV lookups speeds up failure detection without causing false positives.
  • Failover configuration must include clear triggers based on SIP response codes and proper prioritization, especially on SBCs and in dialplans, to prevent unnecessary call bouncing.
  • Regular testing of failover processes, including simulating outages and measuring switch-over times, is critical to ensure reliability during actual incidents.
  • PSTN fallback should be reserved as a last resort, only used after all SIP paths have failed and thoroughly tested to avoid increased costs and call quality issues.

Table of Contents

How Does SIP Trunk Failover Actually Work?

Failover depends on how a SIP endpoint locates and chooses a destination when the first one fails. RFC 3263 defines how DNS SRV and NAPTR records let a provider publish multiple targets with priority and weight values, so a PBX can try a secondary server automatically without a human touching a config file. Lower priority numbers get tried first; among equal priorities, weight distributes load.

Underneath DNS, most modern stacks (Asterisk PJSIP, OpenSIPS, FreeSWITCH) support multiple contacts on a single Address of Record (AOR). If the first contact times out or returns a failure, the dialplan or router walks to the next one in the list. Not every SIP response should trigger that walk, though. A 503 Service Unavailable or a timeout is a clear retry signal. A 486 Busy Here or 603 Decline is a final answer. Treating those as failover triggers just multiplies ringing on a line that was never actually down.

Where the decision gets made matters too. It can happen in provider DNS, on your session border controller, or inside the PBX dialplan. Each layer sees a different slice of the failure, so the real question isn't which one owns failover. It's making sure they don't fight each other.

What Are the Core Building Blocks of SIP Redundancy?

Reliable SIP trunk redundancy starts with carrier diversity, not just connection count. Two SIP trunks pointed at the same carrier's infrastructure share the same failure modes, so a routing issue or outage on their end takes both down simultaneously. A genuine multi-carrier setup with geographic diversity, ideally through separate points of presence, is the baseline every serious design starts from.

Network-level redundancy comes next: dual-ISP circuits with SD-WAN steering voice traffic away from a degraded path in real time, not just data. SBCs sit in the middle of all this, normalizing signaling between carriers, enforcing trunk priority, and often running in active/standby or active/active high-availability pairs so the SBC itself isn't a single point of failure.

Three design patterns dominate in practice. Active/standby keeps one trunk live and one idle, simple but slower to recover. Active/active load-balances across trunks continuously, so failure just means fewer active paths instead of zero. Multi-POP spreads SBCs and carriers across regions entirely, the choice for organizations that can't tolerate a regional outage taking down voice everywhere at once.

Three SIP redundancy architecture patterns

How Do You Configure SIP Failover in Asterisk PJSIP and on an SBC?

Configuration is where failover theory turns into something that either works during an outage or doesn't. Start with an AOR carrying multiple contacts and qualify settings tuned for fast detection without false positives:

[trunk-aor]
type=aor
contact=sip:primary.carrier.com
contact=sip:backup.carrier.com
qualify_frequency=30
qualify_timeout=3

The dialplan needs to react to ${DIALSTATUS} so a failed attempt on the primary rolls to the backup instead of just dropping the call:

exten => _X.,1,Dial(PJSIP/${EXTEN}@primary,20)
 same => n,GotoIf($["${DIALSTATUS}"="CHANUNAVAIL"]?trybackup)
 same => n,Hangup()
 same => n(trybackup),Dial(PJSIP/${EXTEN}@backup,20)

On the SBC side, most enterprise platforms support register-with-priority and grouped trunk priorities, letting you define a primary trunk group and a backup group that only takes traffic once the primary fails heartbeat checks. Vendor SBC documentation covers this pattern in detail for SRV-based trunk registration. A DNS SRV record for the same setup looks like:

_sip._udp.example.com. 300 IN SRV 10 60 5060 primary.carrier.com.
_sip._udp.example.com. 300 IN SRV 20 40 5060 backup.carrier.com.

Pro Tip: Set qualify_timeout lower than your dial timeout. If they're equal, you risk the PBX trying to place a call through a contact it hasn't finished marking dead yet.

How Fast Should OPTIONS Pings and Qualify Timers Run?

Detection speed is a balancing act, not a dial you crank to maximum. Active SIP OPTIONS probing with PJSIP's qualify feature marks a contact unreachable before a real call ever tries it, which is the difference between instant failover and a caller hearing dead air for twenty seconds first.

A few tuning guidelines that hold up in production:

  • Run OPTIONS checks periodically at intervals that balance detection speed and network load to avoid unnecessary trunk chatter.
  • Set qualify_timeout to a brief value, shorter than your dial timeout, to enable timely detection of failures.
  • Treat certain SIP response codes like 408 and 503 as retry triggers while respecting others like 486 and 603 as final call outcomes, not for failover.
  • Combine per-call DNS SRV lookups with pre-emptive OPTIONS checks. One catches failures at dial time, the other catches them before dial time.

Push detection too aggressively and you get flapping, where a trunk under momentary load gets marked dead and calls bounce back and forth between carriers. That's often worse for call quality than a slower, deliberate failover.

How Do You Test and Prove Failover Actually Works?

Untested failover is a theory, not a safeguard. A working test plan includes:

  1. Simulate a provider outage by blocking SIP signaling at the firewall and confirming automatic reroute.
  2. Force a network partition on one ISP link and watch SD-WAN steering respond.
  3. Deregister a trunk manually and time how long calls take to shift.
  4. Trigger PSTN fallback and verify inbound reachability end to end.

Track failover time, call completion rate, and duplicate-call incidents on every run. Monthly smoke tests paired with quarterly full disaster-recovery drills are common practice, and each drill should end with a short post-mortem noting what took longer than expected.

Pro Tip: Log the exact second a probe first detects failure and the second the first call completes on the backup path. That gap is your real recovery time, not whatever your qualify timers say on paper.

Mitel, ShoreTel, FreePBX SIP Trunk Failover

When Should PSTN Fallback Kick In?

PSTN fallback exists for the scenario where every SIP path is gone. It should be configured as the last line of defense, not a routine failover step, since it usually costs more per minute and changes caller experience noticeably.

  • Forward DIDs to a mobile number or answering service only after all SIP paths have failed.
  • Mark PSTN routes as lowest priority in your dialplan so they never intercept traffic prematurely.
  • Validate E911 behavior specifically after failover, since location data doesn't always travel cleanly across a PSTN handoff.
  • Test the fallback path itself on a schedule, since a rarely used route can silently break without anyone noticing.

What Should You Monitor to Catch Failover Before Callers Do?

Monitoring turns failover from a hope into a measured system. Watch OPTIONS failure counts, registration state per trunk, consecutive call failures, and RTP quality metrics like jitter and packet loss.

SignalExample alert threshold
OPTIONS failures3 failures within 60 seconds pages the on-call engineer
Trunk registrationAny unregistered state over 30 seconds
Consecutive call failuresfailed attempts on one trunk in a few minutes
Return-to-primaryRequire 3 consecutive healthy checks before switching back

Return-to-primary needs its own hysteresis. Switching back the instant the primary answers one health check invites flapping. Export these metrics to Prometheus, a NOC dashboard, or AMI event hooks so the alert isn't the first place anyone learns about the outage.

What Do Managed Providers Get Right That DIY Setups Miss?

The gap I keep seeing isn't in the SIP configuration itself; following a detailed VoIP provider review checklist voor het mkb helps ensure robust redundancy and carrier diversity. It's in the assumption that one carrier plus a backup contact equals redundancy. Real resilience requires geographic and carrier diversity most single-provider deployments never budget for, and most internal teams don't have the bandwidth to run quarterly DR drills on top of everything else on their plate. Managed network providers exist precisely because sourcing from dozens of carriers and running 24/7 detection is a full-time job, not a side project bolted onto a PBX admin's other duties.

β€” Jim

Ready to Stop Guessing About Your Failover Coverage?

Most businesses discover their SIP trunk failover has a gap during an actual outage, which is the worst possible time to find out. It's a monitored system with someone watching it around the clock.If you're running SIP trunking today and aren't sure your failover would actually hold up under a real provider outage, a technical consultation walks through your current setup, tests it against realistic failure scenarios, and shows exactly where the gaps sit. Explore UCaaS and hosted PBX options built with carrier sourcing and failover included, or request a free consultation to get a proof-of-concept started this quarter.

Sources

For deeper technical grounding, consult RFC 3263 on SIP server location, the NIST Cybersecurity Framework for continuity documentation, and provider SBC configuration guides for real-world trunk registration patterns.

Recommended

Ready to Get Started?

Talk to our team about how California Telecom can help your business with enterprise-grade solutions.

Get a Free Network Assessment