Project · Telephony automation

Missed-Call Recovery

A caller rings a plumber. Nobody picks up. Sixty seconds later they have a text, and twenty minutes later the job is on the calendar — without a person touching it.

The problem it solves

Home-services businesses buy leads, then miss roughly a quarter of the calls those leads produce. Fewer than 3% of those callers leave a voicemail. Most simply ring the next company on the list, and the business never finds out the lead existed.

The money is already spent by the time the phone rings. Recovering even half of those calls is the cheapest revenue a trade business can buy.

What happens after the missed call

01

The caller gets a text from the business, by name, asking what they need.

02

A conversation over SMS collects the job, the address, and when suits them.

03

Real calendar slots are offered. The one they pick is booked.

04

The owner gets a text with the qualified lead, and a dashboard of what was recovered.

The business keeps its published number. Conditional call forwarding sends only unanswered calls into the system, so answered calls never touch it and cost nothing. That one decision took the telephony bill for a small plumber from about $17.78 a month to $3.09, and it means there is no new number to re-advertise on the van.

The engineering that actually matters

The AI is the least interesting part. What makes it safe to point at real customers is that the model is never first and never last.

INBOUND Reply CODE Triage MODEL Drafts CODE Output guard OUTBOUND Caller no rule hit proposal approved life-safety match Emergency script veto Handed to a human
Order of authority. Deterministic code runs before the model and again after it. A message matching life-safety rules never reaches the model at all, and a proposal the guard rejects never reaches the caller.

Triage runs above the model

Gas leaks, carbon monoxide, fire and electric shock are matched in code and answered with leave the property and call emergency services — never with an appointment offer. A model that misses “I smell gas” is not an acceptable failure mode, and no wording of a prompt makes it impossible.

A guard vetoes the model

Prices, invented appointment times and guarantees are blocked before anything is sent. Tested against a deliberately rogue model that returns:

“That will be $150”
“we'll be there tomorrow at 9am”

Neither reaches the customer.

The database settles collisions

Two callers can be offered the same slot seconds apart, and there is no lock between the offer and the reply. A UNIQUE constraint on the slot makes the database the arbiter: one booking succeeds, the other caller is re-offered rather than double-booked.

Deduplication has to survive multiple processes

Shared hosting runs several copies of an app at once, so anything held in memory is unreliable — and the failure mode is texting the same person twice. I tested this with eight real OS processes racing the same inbound webhook.

In-memory guard

8

duplicate texts to one caller. Each process believed it was the first.
Database as arbiter

1

An atomic insert decides the winner. The other seven find the row and stop.

The same argument applies to opt-outs. “Permanent, enforced across every future campaign” is a uniqueness constraint, not application logic — because application logic is exactly what has a race condition in it.

Build

Runtime
Node.js and Express. Three dependencies, no build step.
State
PostgreSQL, with an in-memory store behind the same interface for tests.
Telephony
Twilio and Telnyx behind one adapter, so the provider is a config value.
Model
Any OpenAI-compatible endpoint — the provider is a URL, not a rewrite.
Calendar
Google Calendar, with local availability as the fallback.
Tests
54, covering signature verification, rate limits, opt-out handling, emergency escalation, guard vetoes, booking races and multi-process safety. The suite runs against both storage backends to prove they behave identically.

See the owner's dashboard

The view a business owner opens on a Monday morning: what came in, what got booked, and what it was worth. Running on generated sample data for a fictional plumbing business.

Open the live demo