SIP failover — Redundancy and high availability
SIP failover helps ensure the continuity of your calls by automatically switching to a secondary trunk when the primary becomes unavailable.
How failure detection works
Your PBX/SIP equipment detects the unavailability of the primary trunk through:
- SIP registration failure: No 200 OK response to REGISTER (30-60 s timeout)
- Consecutive errors: N 503 Service Unavailable or 504 Gateway Timeout responses
- OPTIONS keep-alive: Periodic SIP pings with no response (fastest method)
Types of failover
1. Registration-based failover
Primary: sip.provider1.com:5060 → Active Secondary: sip.provider2.com:5060 → Standby Switchover time: 30 – 60 seconds
The equipment maintains an active registration with the primary trunk. If it fails, it registers with the secondary. Delay of 30 to 60 seconds during the transition.
2. IP-based failover (recommended)
Route 1 (priority 10) : 203.0.113.10 — Provider A Route 2 (priority 20) : 203.0.113.20 — Provider B Switchover time: < 1 second
No registration required. The PBX sends the INVITE to Provider A, and on timeout → Provider B immediately.
Asterisk configuration (pjsip.conf)
[webtic_primary] type = endpoint transport = udp aors = webtic_primary_aor context = from-trunk [webtic_secondary] type = endpoint transport = udp aors = webtic_secondary_aor context = from-trunk
# Dial plan with failover
exten => _X.,1,Dial(PJSIP/${EXTEN}@webtic_primary,20)
exten => _X.,n,Dial(PJSIP/${EXTEN}@webtic_secondary,20)
exten => _X.,n,Hangup()
3CX configuration
In Admin → SIP Trunks:
- Create the primary WebTic trunk with priority 1
- Create the secondary WebTic trunk with priority 2
- Enable Outbound Rules with automatic failover
- Enable OPTIONS keepalive for fast detection (< 5 s)
Failback strategy
When the primary trunk comes back, the reverse switchover (failback) takes place after 10 consecutive successful calls to avoid flapping (repeated oscillations).
Best practices
- Use two different carriers (geographic and ISP diversity)
- Keep the secondary trunk active with periodic test calls
- Configure alerts on switchover for immediate investigation
- Document the manual fallback procedure in case of a prolonged incident
WebTic offers two SIP points of presence (Paris and Marseille) for native geographic failover. Contact support to enable this option.