SIP Keepalive and OPTIONS Ping: Detecting a Dead Trunk
The most awkward trunk fault is the one where the registration light is green and every call still fails. Registration proves that a digest exchange succeeded at some point; it does not prove that the signalling path is open now, that media can reach the far end, or that the provider will accept a new INVITE. A monitoring design that watches only registration state will report a healthy trunk right up to the moment users report that they cannot call out.
Registered Is Not the Same as Reachable
Registration is a one-time transaction with a refresh timer. It establishes a binding at the provider, but the network path that carried the REGISTER can change afterwards. A NAT mapping can expire, a firewall session can age out, a carrier node can be replaced behind the same hostname, and the registration can remain nominally valid while nothing gets through. The platform sees a timestamp, not a working call path.
This is why a health check needs to exercise the path rather than read a state field. An OPTIONS request sent to the trunk target is the standard method. It is lightweight, it does not create a call or a charge, and the response confirms that the far end is alive and willing to answer SIP at that moment.
| Check | What it proves | What it misses |
|---|---|---|
| Registration state | A digest exchange completed and a binding exists | Whether the path is open now |
| Registration timestamp | The binding was refreshed recently | Inbound media and call acceptance |
| OPTIONS ping | The far end answers SIP on the path | Media quality and number routing |
| Transport keepalive | A NAT or firewall session stays open | Application-level failures |
| Test call | Signalling and media both work | Cost, and only at the moment it runs |
| Media statistics | RTP is arriving with usable quality | Signalling reachability |
OPTIONS Ping and the CSeq Question
An OPTIONS ping is a SIP request like any other, with its own Call-ID and CSeq. It is not part of the registration dialog, and it should not reuse the registration Call-ID. A provider that sees OPTIONS arriving inside a registration dialog with a colliding CSeq may treat it as a malformed retransmission. Each ping should therefore be a separate transaction with a monotonically increasing CSeq for its own Call-ID.
The response matters more than the request. A 200 OK with a normal set of supported methods indicates a live endpoint. A 405 Method Not Allowed is not necessarily a failure, because some providers decline OPTIONS while still accepting INVITEs. A 401 or 407 means the ping is reaching the provider but is not authenticated, and a timeout points at the transport path. Recording which response class was seen turns the check from a binary flag into a diagnostic.
Authentication and Timing
Some carriers require OPTIONS to be authenticated, which makes the check more expensive in configuration but still worthwhile. The interval should be short enough to detect a failure before users do, and long enough that it is not mistaken for abuse. A ping every few seconds toward a provider that rate limits unauthenticated requests will create the very failure it was meant to detect.
- Send OPTIONS as its own transaction, not inside the registration dialog
- Use a fresh Call-ID per ping series and increment CSeq correctly
- Treat a 405 as a soft result and confirm with another health signal
- Authenticate pings if the provider requires it
- Choose an interval that does not trip provider rate limits
- Classify results by response code rather than a single up or down flag
Registration Refresh Versus Transport Keepalive
These two mechanisms are often confused. Registration refresh renews a binding in the provider's registrar. Transport keepalive keeps a NAT or firewall session alive on a particular socket. Refreshing registration over a new source port does nothing for the old UDP mapping that an inbound INVITE will try to use, and sending keepalives on the media socket does not renew the registration.
The practical rule is to keep signalling traffic on one consistent socket and send a small keepalive on that same socket often enough to hold the NAT binding. Registration can then refresh at its own, slower pace. Where a provider supports keeping the NAT binding open by sending traffic back toward the registered contact, that is preferable, because it guarantees the path is open in the direction that matters for inbound calls.
| Mechanism | Layer | Typical interval | Primary purpose |
|---|---|---|---|
| Registration refresh | Application, SIP | At half the Expires value | Renew the binding at the registrar |
| OPTIONS ping | Application, SIP | Seconds to tens of seconds | Verify the path answers SIP |
| UDP keepalive | Transport | Shorter than the NAT timeout | Hold the NAT or firewall session |
| CRLF keepalive | Transport | Shorter than the NAT timeout | Keep a TCP or TLS session warm |
| Test call | Application plus media | Scheduled, not continuous | Prove an end to end path |
| Media keepalive | Media, RTP | Shorter than the NAT timeout | Hold the RTP pinhole open |
Detection Time, Failover, and Flapping
Detection time is a product of the ping interval and the number of consecutive failures required before declaring a trunk down. A short interval with a single missed reply gives fast detection but produces false alarms when a ping is simply lost. A longer window is stable but leaves users to discover the outage first. Most deployments settle on a small number of consecutive misses, with the product of interval and misses treated as a stated detection budget.
Failover should follow detection, not race it. Switching to a backup carrier on a single missed OPTIONS response can cause a flapping condition where calls alternate between two paths and both look unreliable. A hold-down period after a failover prevents the system from returning to a recovering primary too early. The aim is a decision that is a few seconds slow rather than one that changes its mind every ping.
Designing Monitoring and Alerts That People Trust
An alert that fires on every transient loss will be ignored within a week, and then the genuine outage will be ignored too. The signal worth alerting on is a sustained change: consecutive failures over the detection window, a pattern of registration refresh failures, or a rise in call setup failures alongside a healthy ping. The last of these is important, because a path that answers OPTIONS but rejects INVITEs needs a different response.
Dashboards should separate the three dimensions rather than collapse them into one colour. Registration state, path health, and call setup success answer different questions, and a single composite status hides which one is broken. Keeping them separate also makes a provider conversation much shorter, because the engineer can say exactly which check failed and when.
What to Keep in the Record
Retain the outcome of each check with its response class and timestamp. A graph showing that a trunk returned 408 responses for four minutes before recovering is more useful than a note that said intermittent fault. Where failover occurred, the record should show which path carried which call, because a post-incident review will ask whether the backup actually took the load.
- Alert on sustained failure over the detection window, not on a single missed ping
- Show registration, path health, and call setup success as separate signals
- Add a hold-down period after failover to stop paths flapping
- Record response classes and timestamps, not just up or down state
- Confirm the backup path carries calls during a failover test
- Review the detection budget against how quickly users notice a fault
Separating a Signal From a Symptom
A single health signal is never enough to decide that a trunk is dead. The useful discipline is to ask which of the independent checks disagrees with the others, because that disagreement identifies the layer at fault. A healthy registration with failed OPTIONS points at the path. A healthy OPTIONS with failed call setup points at routing or number handling. Keeping the signals separate in the dashboard is what makes this reasoning possible at three in the morning.
- Treat a disagreement between signals as the main diagnostic clue
- Correlate health-check failures with the exact time of reported call failures
- Classify each failure by response code before changing any setting
- Check the carrier's status when several trunks fail at once
- Keep a record of detection and failover times for every incident
- Review thresholds after each incident rather than leaving them untouched
Redstone Approach
Redstone RGW gateways and REX series IP-PBX platforms support trunk keepalive and OPTIONS-based health checks with configurable intervals and failure thresholds, alongside registration refresh and transport keepalive settings. Failover routes can be defined across carriers with a hold-down period, and the management system records registration state, health-check results, and call setup outcomes separately so that a dead trunk is identified before users report it.
Redstone Systems, Inc. founded in Delaware, USA in December 2002, has been the ODM vendor for many well-known communications companies, serving the Southeast Asian market. In 2020, Redstone Systems will begin to return to the North America market with its self-developed brand.
Redstone has a complete product line of intelligent voice gateways, providing IP-PBXs, analog VoIP gateways (FXS/FXO), digital VoIP gateways (E1/T1), border appliances, and session boundary controllers (SBCs).
With advanced technology in digital signal processor (DSP), speech coding and speech processing, as well as efficient operational tools such as cloud remote management, auto provisioning, Redstone gateways are widely used in markets of enterprise communications, cloud communications, call centers, operators’ IMS/SIP trunks, bringing users friendly, efficient and reliable communication experience.
For more information about Redstone, You can follow us on Facebook, Linkedin, and Youtube to be the first to get the latest news.

Current Location :

