By Sagar Shankaran, Founder of CallSphere
Acknowledgments table, ladder configs, 120s timeout — built-in on CallSphere. On Vapi this is a from-scratch state-machine engineering project.
Key takeaways
Escalation ladders are the difference between a voice agent that detects an emergency and one that handles it. CallSphere ships ladders as a first-class primitive: acknowledgments table, escalation_ladder_config, 120-second per-position timeout, multi-channel ACK detection (SMS YES / voice DTMF / callback), and append-only audit logs. Vapi.ai is a voice runtime. None of the above exists. Building a production ladder on Vapi is a 6-12 week senior-engineering project that you also own forever. This post is the architectural deep-dive on why ladders are hard, the CallSphere data model that makes them easy, and a Mermaid state machine you can actually ship.
A ladder is a deterministic state machine that takes an event and a list of contacts and walks them in order until acknowledgment is received or the list exhausts. The state machine has to handle:
This is not "make a voice agent." This is distributed-systems engineering with hard real-time constraints during the most stressful moments your business has.
Vapi is excellent for what it does — call-level voice. But ladders are not call-level. They are session-level orchestration with multi-channel state. To build one on Vapi you assemble:
Every component has failure modes. The Twilio webhook can lag. Vapi can drop a call mid-state. The Redis lock can be released early. Each bug is a missed emergency.
Senior engineering teams have shipped this. It takes them 6-12 weeks. They then own it for the life of the application — every Vapi or Twilio API change risks breaking the ladder.
| Table | Purpose | Key Columns |
|---|---|---|
| escalation_ladder_config | Per-property, per-category ladder template | property_id, category, positions JSONB, default_timeout_s |
| on_call_rotations | Who is on-call when | property_id, contact_id, start_at, end_at, role |
| escalation_contacts | Contact directory | id, name, phone, role, active, pto_until |
| events | Emergency event | id, property_id, score, category, severity, status |
| acknowledgments | ACK records, append-only | id, event_id, contact_id, channel, received_at |
| escalation_logs | Append-only state transitions | id, event_id, position, action, payload, hash, prev_hash |
| admin_alerts | Cascade-exhausted last resort | id, event_id, property_mgr_id, sent_at |
Every state change writes to escalation_logs with cryptographic chaining (each row's hash includes the previous row's hash, making the log tamper-evident). acknowledgments is append-only with a unique constraint on (event_id, contact_id) so duplicate ACKs are absorbed safely.
| Capability | CallSphere | Vapi |
|---|---|---|
| First-class ladder model | Yes (escalation_ladder_config) | Build it |
| Multi-channel ACK | SMS + DTMF + callback | Build each |
| Race-condition safety | DB unique constraint | Build it |
| Append-only audit log | Hash-chained | Build it |
| Per-category ladders | gas/fire/water/medical/etc | Build it |
| PTO + rotation overrides | on_call_rotations | Build it |
| 120s default timeout (configurable) | Yes | Build it |
| Cascade-exhausted alert | admin_alerts | Build it |
| Idempotent SMS retry | Yes | Build it |
| Time to first production ladder | Days | 6-12 weeks |
| Long-term maintenance | CallSphere absorbs | You own it forever |
```mermaid stateDiagram-v2 [] --> EventCreated: score >= 0.6 EventCreated --> LadderBuilt: build_ladder() LadderBuilt --> PositionActive: position = 1 PositionActive --> Paging: fire voice + SMS Paging --> WaitingACK: start timer WaitingACK --> Acknowledged: ACK received (any channel) WaitingACK --> Timeout: 120s elapsed Timeout --> CheckLast: is last position? CheckLast --> PositionActive: no, advance CheckLast --> CascadeExhausted: yes Acknowledged --> Logged: write to acknowledgments Logged --> NotifyTenant: reply with ETA NotifyTenant --> [] CascadeExhausted --> AdminAlert: page property mgr AdminAlert --> [*] ```
The state machine is implemented as a Python coroutine in the HeadAgent that holds the event lifecycle. Every transition is guarded by a Postgres advisory lock per event_id, so two parallel ACKs cannot double-process. The lock release is on transaction commit, eliminating a class of race conditions.
Hear it before you finish reading
Talk to a live CallSphere AI voice agent in your browser — 60 seconds, no signup.
The most subtle bug in DIY escalation systems is double-paging. Twilio can dropping a webhook ack and re-fire it; the system advances twice; two contacts get paged for what should be one position. The fix is idempotency keys.
CallSphere uses a deterministic key: SHA256(event_id || position || channel || contact_id). The first request with a given key is processed; duplicates are absorbed. Twilio's outbound SMS API supports an idempotency header. Vapi's outbound call API does not natively, so you wrap it.
In a DIY system, idempotency keys are step 47 of the engineering plan and frequently the missed step. We have audited Vapi-based escalation systems where the same on-call rotation got paged 3-4 times for one event because of webhook retries.
A property manager wakes up at 4:01am to a phone call. The voice says: "Emergency at your property at 1234 Main. Gas leak reported by tenant. Maintenance was paged 14 minutes ago. Position 8 of 8. ACK by pressing 1."
The manager presses 1. Cascade exhausted, but they got it.
Behind the scenes, the ladder ran 8 positions × 120s minus utility-fallback parallel branch = 14 minutes. Every position log is in escalation_logs, hash-chained. The next morning's incident review pulls the entire audit trail in one query: who was paged, when, on what channel, and why no one ACK'd. The post-mortem reveals that 5 of the 7 prior contacts had silenced their phones and the on-call rotation needs phone-uptime checks. That insight comes free with the data model.
On a DIY Vapi system, the same retrospective is "the engineer pulls logs from Vapi, Twilio, Postgres, and Cloudwatch and stitches them together over two days."
Empirically 6-8 is the sweet spot. Below 6, exhaustion happens too often. Above 8, the cascade takes long enough that response time degrades. Default is Primary + Secondary + 6 fallbacks.
Yes. The positions JSONB supports parallel groups: e.g., gas events page maintenance + utility + property manager simultaneously, then advance the maintenance branch while utility and PM stay active. This is how the gas-utility-always rule is implemented.
escalation_contacts supports primary and secondary numbers. Both are dialed for that position with the same 120s timeout shared across them.
escalation_ladder_config keys on (property_id, category). Default categories: water, fire, gas, medical, security, hvac, other. Each category can have its own ladder template referencing roles (the role-to-contact mapping comes from on_call_rotations as of the event timestamp).
Still reading? Stop comparing — try CallSphere live.
CallSphere ships complete AI voice agents per industry — 14 tools for healthcare, 10 agents for real estate, 4 specialists for salons. See how it actually handles a call before you book a demo.
Yes. The platform has a "dry run" mode that walks the ladder and writes to escalation_logs with a mode='dry_run' flag, but does not fire SMS/voice. This is critical for testing ladder configs without waking your team.
The platform integrates outbound to Slack, Microsoft Teams, and PagerDuty as parallel channels alongside SMS and voice. Useful for staff who run their on-call from a chat tool. Vapi has none of this.
PagerDuty has excellent on-call rotation and ladders for IT incidents, but it does not handle live tenant voice triage, emergency-keyword scoring on email and voicemail, or after-hours window logic for property management. CallSphere bridges the tenant-side input with the operations-side output. We integrate with PagerDuty when an MSP or enterprise IT customer wants to keep PagerDuty as the routing layer downstream.
CallSphere maintains the ladder primitives. Vapi-based DIY systems require constant updates as upstream APIs change. We have audited Vapi escalation deployments that broke twice in the past 12 months due to upstream Vapi or Twilio API changes — each time, the customer lost emergency coverage for 4-22 hours during the fix.
This is one of the bug-magnets in DIY escalation systems. on_call_rotations stores all timestamps in UTC with property timezone metadata. The HeadAgent computes the active rotation as now_in_property_tz() which respects DST automatically. We handle the DST edge cases (the missing 2am hour in spring, the duplicate 1am hour in fall) by ensuring rotation handoffs do not occur within 1 hour of a DST transition, with a quiet alert if a configured rotation would fall there.
Yes. If position 1 ACKs but indicates "I need help — paging utility too," the system fires Fallback 1 (utility) in parallel without canceling. The branching is encoded in escalation_ladder_config.parallel_groups.
Deduplication runs on event creation. If a tenant emails about a water leak and then calls about the same leak within 10 minutes, the call's event is merged into the email's event. The ladder is not duplicated. Reduplication uses keyword + property + unit + category similarity.
Dry-run mode walks the ladder, writes escalation_logs with mode='dry_run', but does not page. Customers run dry-run quarterly as part of business continuity testing. Every dry-run is reviewed in the dashboard with full path visibility.
A rotation is who is on-call when (e.g., Jose primary every Tuesday 6pm-6am). A ladder is the ordered sequence of contacts paged for a single event (Primary → Secondary → Fallbacks). An incident is a grouping of multiple related events (e.g., 14 water leaks in one building during a freeze) that share coordination. CallSphere models all three. Vapi models none.
Yes. Once a contact ACKs, the system records them as the responding party. If they fail to act on the ACK (e.g., they ACK then go back to sleep), the property manager can flag a "no-show" in the dashboard, which triggers a follow-up event with a tighter ladder excluding that contact. This accountability layer is one of the operational refinements that separates a working system from a theoretical one.
Multiple commercial property insurers (Travelers, Chubb, Hartford) have begun offering 3-7% premium discounts to portfolios with documented automated emergency response systems. CallSphere customers receive a quarterly compliance certificate suitable for insurance submission, including: ladder configurations, dry-run test results, ACK rates, time-to-ACK distribution, and post-incident review summaries. We have helped customers save approximately $120,000-340,000 per year in insurance premiums on portfolios above 1,500 units.
If you are about to start a 12-week engineering project to build escalation on Vapi, talk to us first. Book a demo at /demo and we will show you the ladder running on your real on-call rotation, with full audit trail and dry-run testing. See pricing at /pricing.

Written by
Sagar Shankaran· Founder, CallSphere
LinkedInSagar Shankaran is the founder of CallSphere, where he builds production AI voice and chat agents deployed across healthcare, hospitality, real estate, and home services. He writes about agentic AI, LLM engineering, and shipping voice agents that handle real calls in production.
See how AI voice agents work for your industry. Live demo available -- no signup required.
A 2026 market read on financial services and fintech SMBs across Singapore, Malaysia, the Philippines, and Indonesia — and how CallSphere AI voice and chat agents deliver multilingual, compliant, 24/7 customer conversations.
Ethiopian coffee exporters and cooperatives lose buyer enquiries across time zones. See how a CallSphere AI voice and chat agent answers international coffee buyers 24/7 in Amharic and English.
Hotels, event venues, and professional-services firms in Erbil serve guests and clients in Kurdish, Arabic, and English. CallSphere answers every call and message 24/7 and books directly.
Equatorial Guinea shops, restaurants and hotels serve a mix of local and international customers who call at all hours in several languages. See how CallSphere answers every one 24/7 and books the sale or table.
A step-by-step guide for Moroccan retail and e-commerce businesses to cut COD returns, recover abandoned carts, and answer buyers in Darija, French, and English with a CallSphere AI agent.
Grenada businesses serving St George's University students and families, from rentals and clinics to tutoring and professional services, use CallSphere AI voice and chat agents to answer enquiries across every time zone and language, 24/7.
© 2026 CallSphere Inc. All rights reserved.
Made within San Francisco
Watch how CallSphere handles real customer calls, schedules appointments, and processes payments — live.
Try Live DemoBook a DemoCalculate Your ROI