Delivery record¶
A pager is only as good as the last page that reached a phone. The delivery canary checks that
continuously: every few hours the server sends a test SMS and a test call to phones you own, through the
same path as real pages, and keeps what the phone network reported. The results are published as a public
page at /delivery and as JSON at GET /api/v1/public/delivery-record.
The record only ever contains what was measured. Until you point the canary at real phones it is empty, and the page says so.
Turn it on¶
You need SMS and calls set up for paging, with delivery reports:
- your own Twilio account (
TWILIO_ACCOUNT_SID,TWILIO_AUTH_TOKEN,TWILIO_FROM_NUMBER) and its public callback address (TWILIO_CALLBACK_BASE, or an httpsFRONTEND_ORIGIN), or - Telnyx (
TELNYX_*, see phone providers) with its callback address, or - a relay (
RELAY_URL,RELAY_KEY) and its callback address (RELAY_CALLBACK_BASE, or an httpsFRONTEND_ORIGIN).
Without a callback address there are no delivery reports, so the canary stays off and the server logs why.
CANARY_NUMBERS=us-att:+14155550100,uk-ee:+447700900100
CANARY_EVERY=6h
CANARY_NUMBERS: up to 10 numbers in international format, separated by commas. Each can carry a label before a colon (letters, digits, dots, dashes and underscores, up to 32). A number without a label is calledphone-1,phone-2and so on by its position. Use labels that say where the phone is and which carrier it uses; they are public.CANARY_EVERY: how often to send. The default is6h; the shortest allowed is10m. Each send costs one SMS and one call per number on your Twilio bill.
Use phones that nobody depends on for real pages. A call counts as delivered only when a person (or a keypress) answers it, exactly like a page: voicemail counts as not delivered. A phone that is set to answer calls automatically and then press a key, or one a person answers, gives a true voice figure.
What is sent¶
For each number, once per interval: one SMS and one call. They go through the notifier that sends real pages, as a page message, over the same SMS and call channel (Twilio or the relay):
- The SMS reads "Argavon delivery test. No action needed."
- The call is a page call with voicemail detection and the keypad. It says it is a test. Pressing any key records that a person answered and ends the call.
- The signed delivery reports come back to the same callback address real pages use. Forged reports are refused.
- A test call that is not answered rings again from the same number 75 seconds later, at most twice, the same as an unanswered urgent page.
The canary has no workspace, user or contact method. It never pages anyone and never uses a workspace's SMS or call allowance.
With several servers, each interval is sent once: the first server to claim it sends, the others skip it.
With both Twilio and Telnyx set up (see phone providers), the SMS and the call go out through each provider on its own: two SMS and two calls per number and interval. Each run records its provider, and a repeat call goes through the same provider as the call it repeats.
What is measured¶
Every send is one row in the canary_runs table: when it was sent, the channel, the phone's label and the
last two digits of its number, and what the phone network reported. Full numbers are not stored.
| Outcome | Meaning |
|---|---|
| Delivered | The network reported the SMS delivered to the handset, or a person answered the call. |
| Not delivered | The network reported a failure (undelivered SMS, busy, no answer, voicemail), or Twilio refused the message. The carrier or Twilio error is kept. |
| No report | No final report an hour after sending. |
A send younger than an hour with no final report is waiting and is not counted yet.
Time to the phone is from the moment the server sent the message to the report that it arrived.
The public record¶
GET /api/v1/public/delivery-record needs no sign-in. It is cached for a minute and limited to 60 reads a
minute per client address. It covers the last 90 days and returns, for SMS and for calls:
runs: how many test messages the figures are based on (first calls only; repeat calls are counted on their own underrepeat_calls),delivered,not_delivered,no_reportanddelivered_pct(delivered out of runs),median_secondsandp95_secondsto the phone, over delivered runs,last_failurewith the carrier error,- the same per phone label in
labels, withnumber_ending, the last two digits, daily: one entry per day of the 90, oldest first.
It also returns failures, the 20 most recent sends that did not reach the phone (each with its
provider), enabled, numbers and every_seconds (what the server sends now), and empty: true with
runs: 0 when nothing has been measured.
The top-level figures cover every provider together. providers has the same figures for each provider on
its own (provider, runs and channels). Runs from before providers were recorded count only in the
top-level figures.
outages lists the times a provider failed again and again over the 90 days (provider, started_at,
ended_at, which is null while it lasts), newest first. These are the same outages that skip a provider
for Enterprise pages and notify admins.
The page at /delivery shows the same figures: a line saying exactly what is measured, the delivered share
and times per channel, a bar per day, each phone, a row per provider when there are two, every failure
listed, and any provider outage. It follows the reader's light or
dark setting. Numbers appear as "ending 42" and never in full.
Checking it¶
- No rows at all: check the server log for "delivery canary" at start. It says how many numbers it uses, or why it is off.
- Every run "no report": Twilio or the relay cannot reach the callback address. The same problem stops receipts for real pages.
- Calls "not delivered" with the status
in-progressorcompleted: voicemail picked up (theanswered_bycolumn ofcanary_runssaysmachine_startor similar). Turn voicemail off on the test phone, or have it answer and press a key.