SIP Trunk Health: Monitoring the Line to the Outside World
It is nine in the morning and nobody can call out. Inside the building, extension to extension works perfectly — which is exactly why nobody noticed that the trunk quietly stopped registering overnight. The phone system did not crash. Nothing rebooted. The line to the outside world simply went away, and the first monitoring system to notice was the receptionist.
A SIP trunk is the modern phone line, and like the old copper one it fails silently, in ways that only show up when somebody tries to use it. Worse, a whole class of its failures is invisible from the inside. When outbound calls break, your users tell you within minutes. When inbound calls break, your customers get a busy tone and tell nobody.
This guide shows you how to watch a trunk properly. It covers its heartbeat, its capacity, and the path to the provider. It covers the failover trunk you have never tested, call failures in plain language, and alerts that page you for the right reasons. If you have not read What Makes VoIP Different, the short version is that SIP sets calls up and RTP carries the audio; both matter here.
In this guide
- What a SIP trunk actually is
- The heartbeat: registration and keepalives
- Capacity: the ceiling you cannot see
- Reachability and latency to the provider's edge
- Failover trunks, and proving they work
- Call failures in plain language
- Inbound versus outbound: two different failure worlds
- Alert design for trunks
- The trunk health checklist
- Where to go next
What a SIP trunk actually is
In the old world, the phone company ran physical lines into your building. There was one analog pair per simultaneous call, or a digital circuit carrying a fixed bundle of channels. A SIP trunk replaces all of that with a logical connection over IP. It connects your PBX (Private Branch Exchange) and a provider who connects you to the PSTN (Public Switched Telephone Network). The PBX is the switchboard computer that owns your extensions. The PSTN is everyone else's phones. No wire belongs to the trunk. It rides across your internet connection as ordinary SIP and RTP packets.
What the provider actually hands you is a short list. It includes an address to send calls to (their edge, behind a DNS name), a way to prove who you are, and a block of phone numbers. It also includes a channel count, the maximum number of simultaneous calls the trunk will carry. The trunk is the bundle of lines between your switchboard and the phone company. The channel count is how many lines are in the bundle. The numbers are usually called DIDs (Direct Inward Dialing numbers): what the outside world dials to reach an extension directly.
Proving who you are comes in two flavors, and the flavor decides how you monitor. A registration-based trunk works like a phone. Your PBX registers to the provider with a username and password. The provider learns your current address from that registration. A static (IP-authenticated) trunk skips registration: the provider trusts calls from your fixed public IP and sends inbound calls to it. Simpler, but with no registration state to watch, so you must create your own heartbeat.
The heartbeat: registration and keepalives
On a registration-based trunk, the PBX periodically sends a SIP REGISTER message. The provider answers with success and an expiry time, and the PBX re-registers before it runs out. The expiry is typically minutes. If a re-registration fails, the trunk expires. That could be because the password changed, the provider's edge is down, DNS stopped resolving, or a firewall rule ate the packet. The first thing to break is inbound, because the provider no longer knows where you are. Outbound often keeps working for a while, which is how a dead trunk stays hidden.
The keepalive that works on both flavors is the OPTIONS ping. SIP OPTIONS is a message that simply asks "are you there, and what can you do?" The PBX sends one to the provider every few seconds or minutes and expects a response. Any response counts as proof of life, even an error, because it proves the path is open and something at the far end speaks SIP. Most providers also send OPTIONS toward you; on a static trunk their pings are the only sign they can reach you. And the traffic keeps firewall pinholes open between calls.
Together these give you three heartbeat measurements. One is registration state, plus time since the last success. Another is OPTIONS state, plus round-trip time and consecutive misses. The third is a change history, because a trunk that fails and re-registers every ninety seconds is not healthy just because it is registered right now. Most PBXs expose all of this on a status page, in a command, or as log lines:
Trunk State Last register OPTIONS Channels Failures (24h) provider-main Registered 38 s ago 21 ms OK 7 / 30 2 provider-backup Registered 44 s ago 29 ms OK 0 / 10 0 site2-legacy UNREGISTERED 6 h 12 m ago no reply 0 / 8 144
The main trunk is fine: fresh registration, quick keepalive, a quarter of its channels in use. The backup is alive and idle, which is what a backup should look like. The third trunk has been down for six hours. Nobody noticed because its numbers belong to a site that rarely gets calls. That is precisely the kind of trunk that dies quietly.
Tip: read the heartbeat from the PBX's own trunk status rather than pinging the provider from a monitoring server on a different network. Calls follow the PBX's path through your firewall and internet link; a check from anywhere else proves the provider is up without proving the trunk is.
Capacity: the ceiling you cannot see
A trunk with thirty channels carries thirty simultaneous calls. The thirty-first fails, with a response that looks like "busy" or "service unavailable," even though nothing is broken. Users report it as "the phones are flaky at lunchtime," which is a capacity problem wearing a disguise. The channel count is a ceiling you cannot see on any dashboard unless you put it there.
The measurement is simple: concurrent calls on the trunk, sampled frequently, against the channel count. Track the peak for each hour, because averages hide busy hours completely. A trunk that averages five calls and peaks at twenty-nine every day at eleven is one busy morning away from failing calls. Alert when peaks sit within a few channels of the ceiling for several days running. That is a growth signal, not an emergency, so send it as a ticket. Count capacity rejections too; that is the ceiling actually being hit.
Channels are not the only ceiling. The PBX may license a maximum number of external calls, a border controller may cap sessions, and your internet link has bandwidth. The arithmetic is worth doing once. The common uncompressed codec carries 64 kbps of audio in each direction. Packet headers push that to roughly 90 kbps on the wire. So thirty simultaneous calls need close to 3 Mbps in each direction. Mind the upstream: business internet links are often far slower upstream than downstream, and every call's outgoing audio goes that way. A trunk sized for sixty channels on a link with a small upstream will sound terrible long before it hits its channel ceiling.
Reachability and latency to the provider's edge
The provider's edge is where your trunk terminates: one or more addresses, almost always behind a DNS name. That name is a hidden dependency. Many providers publish SRV records (DNS entries listing several servers with priorities) so your PBX can fail over between their edges automatically. If your resolver cannot answer, the trunk fails without a single packet reaching the provider. Monitor that the provider's SIP name resolves, from the DNS server the PBX actually uses.
Once the name resolves, you want two things: can the edge be reached, and how long does the round trip take? Ordinary ICMP ping is often blocked at provider edges, so never read a ping timeout as an outage. The OPTIONS round-trip time is the honest measurement, because it travels the same ports and path as real calls. Record it continuously and baseline it. A round trip that sits at 20 ms for months and then wanders between 20 and 180 ms is telling you the path changed. It is also telling you external calls are about to sound worse.
Latency to the edge matters more for a trunk than for most services because the media goes there too. For an external call, every RTP packet from your phone travels through the PBX, out your internet link, and to the provider's edge. Whatever happens on that path happens to every external call at once. So watch the internet link's utilization, error counters, and the QoS policy that protects voice on it; QoS for Real-Time Traffic covers how that policy should work.
Failover trunks, and proving they work
A second trunk is cheap insurance: a second edge at the same provider, a second provider, or the same provider over a second internet connection. Outbound failover is a PBX setting, an ordered list of routes, so that when the first trunk fails to complete a call the PBX tries the next. Inbound failover is harder, because the provider decides where to send calls. It usually means a forwarding rule on their side that diverts your numbers when your primary is unreachable, or splitting your numbers across two providers.
Then comes the spare-tire problem. A backup trunk that has not carried a call since the day it was installed is a backup you believe in, not one you have. Prove it, on a schedule:
- Monitor the backup continuously, exactly like the primary. Its normal state is "alive and idle," and "unregistered" is a ticket even though nothing is broken today.
- Force a real call through it regularly. Most PBXs let you prefix a number to select a specific trunk. Once a week, place a call over the backup, confirm it connects, and note the date and the quality. Put it on the calendar; it will not happen otherwise.
- Test outbound failover for real in a maintenance window by disabling the primary and placing calls. Watch how long the PBX takes to give up on the dead trunk; a long timeout before failover feels like an outage to the caller.
- Test inbound failover with the provider. Ask them to simulate your primary being unreachable, and call your main number from a mobile. If it lands on voicemail somewhere unexpected, better to learn that now.
Call failures in plain language
Every SIP call attempt ends with a response code, and your PBX records it for every call. You do not need to memorize the codes. You need the handful of classes they fall into, because the class tells you whose problem it is. Broadly, the two-hundreds are success, the four-hundreds say the request could not be completed as asked, and the five-hundreds say the far side failed. In practice, the useful classes look like this:
| Class | What it means | Whose problem | Monitoring reaction |
|---|---|---|---|
| Busy or declined | The far end is on another call or pressed reject | Nobody's | Count it; never alert on it |
| Not found or unavailable | The number does not exist, was misdialed, or the route to it is broken | The caller, or the provider's routing | Alert on a sudden rise, especially toward known-good numbers |
| Rejected or forbidden | Authentication failed, account locked or suspended, caller ID not permitted, fraud controls tripped | Your credentials or your account | Alert on any run of these; they rarely fix themselves |
| Provider failure | The provider's side failed or is overloaded | The provider | Alert on a spike; open a ticket with call IDs |
| No response | Nothing answered at all | The path: internet link, firewall, NAT, or a dead provider edge | Alert immediately; correlate with the heartbeat |
| Capacity | All channels or licenses in use | Yours, by design | Ticket when it recurs; feed the capacity trend |
A single failure means nothing; real numbers are busy and misdialed all day. What you alert on is change. That can be a spike in the failure rate against the trunk's normal, or a change in the mix. An example is "provider failure" going from almost never to a third of all attempts in ten minutes. A useful single number to baseline is the answer rate, the share of outbound attempts actually answered. Its hourly value is remarkably steady for a given business, and a sudden drop is the earliest trunk alarm real traffic will give you.
Each attempt in the PBX's call log looks something like this:
09:02:14 OUT ext 204 -> +1555xxx0142 provider-main 200 OK answered 4m12s 09:02:31 OUT ext 318 -> +1555xxx7710 provider-main 486 Busy busy -- 09:03:05 OUT ext 211 -> +1555xxx3390 provider-main 503 Unavail failed -- 09:03:06 OUT ext 211 -> +1555xxx3390 provider-backup 200 OK answered 2m40s 09:03:40 IN +1555xxx0080 -> DID 5500 provider-main 200 OK answered 0m55s
Notice the third and fourth lines: the main trunk refused a call with a provider-side failure and the PBX immediately retried on the backup. One of those is fine. Fifty in an hour means the primary is degrading and the backup is carrying the business, which you want to know before the backup fills up too.
Inbound versus outbound: two different failure worlds
Outbound failures are loud. Someone dials, hears a fast busy tone or an error announcement, and calls the helpdesk. The causes are mostly on your side. They include expired credentials, a full trunk, a dial-plan rule that mangles the number format, a caller-ID setting the provider refuses, and a firewall change. The call log tells you which class it was.
Inbound failures are silent, and that is what makes them dangerous. The customer dials your number, hears ringing that never answers or a message saying the number is unavailable, and moves on. Nobody inside sees anything, because nothing inside was involved. The causes live at the boundary and beyond. One is a lapsed registration, so the provider cannot find you. Another is a DID routing mistake, so a number points at the wrong trunk or PBX. Another is a firewall dropping the provider's inbound call setup on a static trunk. And there is the classic, a number porting mishap. A number moved between providers and some carriers still route it to the old one. So callers on certain networks hit a dead end while everyone else gets through.
You cannot monitor inbound from the inside, so create an outside. Three approaches, best combined:
- A synthetic inbound test call. Something outside your network calls your main number regularly and must reach an answer. That could be a mobile on a schedule, a second trunk from a different provider, or an external test service. A script dialing through the backup trunk into a DID on the primary counts.
- Silence detection. Count inbound calls per hour and compare with the same hour on a normal day. Zero inbound calls at ten on a Tuesday is an alarm for any business that normally gets dozens.
- Per-number spot checks after changes. After any port, DID change, or provider-side reconfiguration, call every affected number from outside, on a different carrier than your own. Porting problems are famous for being invisible from the network that did the port.
Alert design for trunks
Trunk alerts go wrong in two directions: too quiet, so the trunk dies unnoticed overnight, or too loud, so every internet blip pages three people. The fix for both: confirm before paging, separate "page now" from "ticket for tomorrow," and use dependencies so one root cause raises one alert.
| Condition | Severity | Why |
|---|---|---|
| Primary trunk unregistered, or OPTIONS unanswered for two or three consecutive checks | Page, any hour | Inbound calls are already failing; the confirmation avoids paging on one dropped packet |
| Inbound calls at zero in business hours, or the synthetic inbound test fails twice | Page, business hours | The only signal you get for silent inbound failure |
| Failure rate or answer rate moves sharply from its hourly baseline | Page in business hours, ticket otherwise | Real traffic is the truest probe; a spike is a real event |
| A run of "rejected" or "forbidden" responses | Page | Credential and account problems do not resolve themselves |
| Concurrent calls near the ceiling, or capacity rejections | Ticket | A sizing problem, not an outage |
| Backup trunk unregistered | Ticket | Nothing is broken today; the spare tire is flat |
| TLS certificate on the trunk expiring soon | Ticket, weeks ahead | Encrypted trunks stop registering the day it expires |
Two dependency rules do most of the noise reduction. If the internet link or edge firewall is down, suppress every trunk alert behind it. If the PBX itself is down, do the same. You already know about the real problem. The broader craft of alerts people trust is covered in the Alert Design topic.
If your PBX is hosted, trunk state is the provider's job and you will not see it. What remains yours is the path — internet link, firewall, latency to their edge — and the inbound test call. In practice, that is still most of the failures.
The trunk health checklist
| Check | Healthy looks like | How often | Where it comes from |
|---|---|---|---|
| Registration state | Registered; last success within the expiry window; no flapping | Every minute | PBX trunk status |
| OPTIONS keepalive | Answered; round trip near baseline; no consecutive misses | Every check interval | PBX trunk status or a SIP-aware probe |
| Provider DNS name | Resolves to the expected addresses from the PBX's resolver | Every few minutes | DNS check |
| Concurrent calls vs channels | Hourly peak comfortably below the ceiling | Continuous; reviewed weekly | PBX active-call count |
| Failure and answer rates by class | Steady against the hourly baseline | Hourly | Call log |
| Inbound call volume | Follows the normal daily shape; never zero in business hours | Hourly | Call log |
| Synthetic inbound test call | Connects and is answered | Several times a day | An outside phone or a second trunk |
| Internet link utilization and errors | Upstream headroom; no error growth | Continuous | Router and firewall over SNMP |
| Backup trunk state | Alive and idle | Every minute | PBX trunk status |
| Trunk certificate expiry | Weeks of validity remaining | Daily | Certificate check |
Where to go next
A SIP trunk is the phone line you cannot see, and this guide gave it a pulse. It covered registration and OPTIONS keepalives as the heartbeat, channels against the ceiling, and DNS and latency to the provider's edge as the path. It also covered a failover trunk that is only real once you have made it carry a call. The alert worth building is on change, not on any single failed call. Above all, inbound breaks silently, so build an outside view.
When a trunk is up but calls through it sound bad, Proving Where Call Problems Live walks through separating your network from the provider's. For turning call records into an ongoing quality routine, see Building a Call-Quality Monitoring Program. Both live in VoIP & Call-Quality Monitoring.
Put this into practice with SysPeep Monitor
Trunk state comes from your PBX. But the path the trunk rides on is network monitoring, and that is what SysPeep Monitor does. The path includes the internet link, the edge router, the firewall, and the latency to your provider. SysPeep Monitor watches those devices over SNMP and similar collectors, and keeps the latency history. It uses dependency rules so a dead internet link raises one alert instead of twenty. The free trial installs on a Windows machine in minutes.
Download Free TrialLearn About SysPeep