Current Location :Home > About Us > News Center > BLOG > SIP Keepalive and OPTIONS Ping: Detecting a Dead Trunk

SIP Keepalive and OPTIONS Ping: Detecting a Dead Trunk

Nov 27Source:RedstoneIntelligent Browse: 1
Background

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.

CheckWhat it provesWhat it misses
Registration stateA digest exchange completed and a binding existsWhether the path is open now
Registration timestampThe binding was refreshed recentlyInbound media and call acceptance
OPTIONS pingThe far end answers SIP on the pathMedia quality and number routing
Transport keepaliveA NAT or firewall session stays openApplication-level failures
Test callSignalling and media both workCost, and only at the moment it runs
Media statisticsRTP is arriving with usable qualitySignalling 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.

MechanismLayerTypical intervalPrimary purpose
Registration refreshApplication, SIPAt half the Expires valueRenew the binding at the registrar
OPTIONS pingApplication, SIPSeconds to tens of secondsVerify the path answers SIP
UDP keepaliveTransportShorter than the NAT timeoutHold the NAT or firewall session
CRLF keepaliveTransportShorter than the NAT timeoutKeep a TCP or TLS session warm
Test callApplication plus mediaScheduled, not continuousProve an end to end path
Media keepaliveMedia, RTPShorter than the NAT timeoutHold 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.

About Redstone

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.

Contact Us

Mobile Phonel

Email: globalmarketing@redstonesystems.com

Address: 12816 SE 75th Court, Newcastle WA 98059, USA

Contact Us
We will do our best to contact you as soon as possible. In the meantime, please contact us for more information.
  • First Name*

  • Last name*

  • Company Name*

  • Email*

  • Phone

  • Product*

  • Message

  • I have read and agreed Privacy Policy
Privacy_policy
×

Privacy Statement

Platform information submission - privacy agreement

● Privacy Policy

We are committed to protecting the privacy, personal data and personal data (collectively referred to as "personal data") provided by you when using this website. Make us comply with the highest standards in terms of collection, use, storage and transmission of personal data (laws and regulations related to privacy of personal data) and consumer protection. To ensure that you have full confidence in the handling of personal data on this website, you must carefully read and understand the provisions of the privacy policy. This website (hereinafter referred to as "us") respects and protects the privacy of users. In particular, once you use this website, you will be deemed to accept, agree, promise and confirm this privacy agreement; You disclose your personal data to us voluntarily with the required consent; You will abide by any modification of this privacy policy; You agree that our relevant business personnel will contact you regarding the products and services you may be interested in (unless you have indicated that you do not want to receive such messages). With your consent, we will collect, manage and monitor the types of personal data collected


1. Scope of application

It is our unremitting pursuit to provide users with better, better and more personalized services. We also hope that the services we provide will be more convenient for your needs. This privacy policy applies to all information collection services provided by this website. You can visit this website and use the services provided by this website using this privacy policy


2. What information do we collect

In order to provide you with our various services, you need to provide personal data information, including personal data and anonymous data, including but not limited to: personal data (your name, gender, age, date of birth, telephone number, fax number, address or mailing address, e-mail address, etc.)


3. How to use the collected information

The purposes and purposes of collecting personal data and anonymous data are as follows: to provide you with our services through this website; When you use our website, you can identify and confirm your identity; Let you get the service for you when you use this website; The relevant business personnel of this website can contact you when necessary; Make it more convenient for you to use this website; The personal data and anonymous data provided by you to us will only be retained until the collection purpose has been achieved, unless they are retained due to applicable laws and regulations. The ownership of personal data and disclosure of all data collected on our website are owned by us and will not be leased or sold to any unrelated third party

 

4. How do we protect information

For the protection of personal data, we implement appropriate physical, electronic and management measures to protect and guarantee the safety of your personal data. We try our best to ensure that any personal data collected through this website is free from any nuisance of a third party unrelated to us. The security measures we take are not limited to: physical measures: the records with your personal data will be stored in a locked place Electronic measures: the computer data with your personal data will be stored in the computer system and storage media subject to strict login restrictions Management measures: only employees authorized by us can access your personal data, These employees need to comply with our internal rules on the confidentiality of personal data. If you are aware of any security loopholes on this website, please contact us in time so that we can take appropriate actions as soon as possible; Despite the implementation of the above security measures, we cannot guarantee the absolute security of data transmission on the Internet, so we cannot absolutely guarantee that the personal data and anonymous data you provide to us through this website are safe at all times. We will not be responsible for any unauthorized access to your personal data, and we will not be responsible for any losses and damages incurred or caused in this regard.

 

5. Juvenile Protection Law

The minor has provided personal data to this website without the approval or consent of any parent or guardian. Please contact the public telephone number and customer service telephone number on this website in time to ensure that the data are removed

 

6. Revision and effectiveness of privacy policy

With the expansion of the service scope of this website, we may revise the Legal Statement and Privacy Policy from time to time, which forms a part of this Legal Statement and Privacy Policy. In order to prevent you from being informed of such revisions, please read this Legal Statement and Privacy Policy frequently. In any way, if you continue to use our services, you agree to be bound by the revised Legal Statement and Privacy Policy