Power Dialer — AI Voice Platform

A multi-tenant outbound calling platform where AI agents run campaign calls under human supervision, every lead has exactly one accountable owner, and the server, not the model, decides what may happen on a call.

Stack:
Laravel 12, React 19, TypeScript, Twilio, Node.js, OpenAI Realtime, Reverb, MySQL, Redis
Status:
In development; production rollout validation ongoing
Deep Dive:
Read Voice AI Control Planes Blog

Overview

The platform began as a conventional sales dialer: human agents called leads through a WebRTC browser softphone, with one AI helper attached. The goal was to evolve it into a concurrent AI sales fleet while keeping every existing human workflow, hybrid calling path, tenancy boundary, and billing ledger intact.

Outbound voice AI carries public, expensive failure modes: two agents dialing the same customer, a callee social-engineering an AI agent into an unauthorized discount or arbitrary transfer target, a dropped transfer, or a dashboard counting optimistic sales that never closed. The central engineering problem was not making a model speak; it was bounding what the model is allowed to trigger.

1,644 Hermetic PHPUnit tests (6,249 assertions, no Reverb/Redis needed)
3 Lanes Gather, ConversationRelay & OpenAI Realtime behind 1 engine
7.3x Cut Measured structural query token reduction via AST graphs
36 ADRs Documented decisions + read-only adversarial reviews per set

My contribution

Work progressed in structured packages (Sets 00 through 07 plus gap packages) against the live codebase, each followed by a separate read-only adversarial verification pass:

  • Fleet membership & deterministic allocation: Eligible contacts split across campaign agents deterministically (with preview-before-commit and audited reassignment).
  • Atomic claim & lease protocol: Conditional writes prevent concurrent executors from claiming the same lead, paired with lease renewal, expiry reaping, idempotent callbacks, and a dialer:reconcile drift checker.
  • Three interchangeable realtime audio lanes: Turn-based Twilio Gather, ConversationRelay, and full-duplex OpenAI Realtime audio via a stateless Node sidecar (:8091), switchable behind feature flags without a redeploy.
  • Append-only outcomes & QC verification: Canonical outcome taxonomy, review queue, and scoreboards that count only QC-reviewed sales, enforced by a static reward-hacking scanner.
  • Immutable per-call AI bundles: Versioned persona, playbook, knowledge, autonomy, and compliance guardrails pinned to each call record at creation time.
  • Server-authorized transfer resolver: Replaced three separate dialling paths with one typed destination resolver and a redacted context package that moves with the caller.
  • Supervisor fleet monitor & EU compliance as code: Live fleet snapshot with freshness tripwires, per-member pause, operator live-call nudges, Art. 50 AI disclosure, and transcript-only sentiment scoring.

Architecture

1. Three-Plane Control Model

Diagram 1: Separating Human Governance, Server Authority & AI Execution Model Recommends · Server Authorizes
Power Dialer Three-Plane Architecture Three horizontal planes: Top Human Control Plane sets campaigns, playbooks, reviews QC, and injects supervisor directives. Middle Server Authorization Plane enforces eligibility, deterministic split, atomic leases, typed transfer resolver, compliance floor, and append-only outcome ledger. Bottom AI Execution Plane listens and speaks over telephony or Node realtime relay and emits only bounded tool requests or transfer reasons. HUMAN CONTROL PLANE Campaigns · Playbook Versions · Fleet Monitor · QC Queue Supervisors pause agents, read live Reverb transcripts, inject live nudges, and approve verified sales. SERVER AUTHORIZATION Deterministic Code & Policy Enforcement Eligibility (DNC, Hours, Credit, Kill Switch) → Atomic Lease → TransferResolver → Append-Only Ledger Static scanner blocks model interest scores from reaching ranked, paid, or headline scoreboard surfaces. AI EXECUTION PLANE (UNTRUSTED BOUNDARY) 3 Voice Lanes (Gather / ConversationRelay / OpenAI Realtime) · Emits tool intents & transfer reasons only — never destinations or raw prices.
The AI model occupies only the bottom plane. Every external consequence passes through tested server authorization code in the middle plane.

2. Campaign Execution & Three Voice Lanes

Diagram 2: Lease-Protected Dial Flow & Swappable Audio Relay Feature-Flag Rollback · No Redeploy
Power Dialer Campaign Execution and Audio Lanes Shows campaign eligibility check, deterministic allocation split, atomic conditional contact lease, three swappable realtime lanes (Twilio Gather, ConversationRelay, and OpenAI Realtime via Node 20 relay on port 8091), and append-only outcome recording into the QC review scoreboard. 1. Eligibility Consent + DNC Hours + SpendCap 2. Atomic Lease Conditional write Renew / Expire / Reap 3. SWAPPABLE VOICE LANES Twilio Gather (Turn-Based) Twilio ConversationRelay OpenAI Realtime (u-law) Stateless Node Sidecar :8091 4. Verified Ledger Append-only outcomes QC Queue → Scoreboard Observability & Reconciliation • LatencyRecorder per-span timing (STT / LLM / TTS) • php artisan dialer:reconcile (drift check) Transfer Context Redacted summary + split closer credit
Switching voice transports or rolling back caller-heard behavior is controlled by global and per-agent feature flags behind a circuit breaker.

Engineering decisions

One accountable owner per contact, taken atomically

Problem: Concurrent AI executors racing on a contact table will double-dial leads if ownership checks use read-then-write queries, while crashed workers can lock leads indefinitely.

Approach: Allocation assigns deterministic splits upfront; execution claims a lease using a conditional write with scheduled renewal, expiry, and reaping. Launch, claim, provider webhooks, and outcome finalization are idempotent, backed by a dialer:reconcile invariant checker.

Tradeoff: More explicit state transitions than a simple queue, requiring real concurrency load tests rather than hand-waved reasoning.

The model recommends; the server authorizes

Problem: Anything an LLM can be convinced to output, a caller on the phone can persuade it to output, including arbitrary transfer phone numbers or unauthorized prices.

Approach: Enforce an autonomy matrix and non-disableable compliance floor (Art. 50 AI disclosure, DNC, consent, calling hours, spend caps, kill switch) at the server tool boundary. For transfers, the LLM emits only a reason; TransferResolver maps it to a typed destination registry.

Tradeoff: Adding a new transfer target or pricing rule requires a code change rather than a prompt tweak, which is the right safety posture for systems that dial strangers.

Count verified sales, not claimed ones

Problem: If a scoreboard measures what the AI agent claims happened on a call, the dashboard rewards model optimism and specification gaming.

Approach: Store canonical outcomes in an append-only ledger, route claims through a QC review queue, keep transcript-only sentiment (-1 to +1) separate from purchase interest (0 to 1), and enforce a static build scanner that fails CI if model scores touch ranked or paid surfaces.

Tradeoff: Verified metrics trail call completion until QC reviews complete, avoiding flattering but false telemetry.

Tips & tricks from building Power Dialer

TIP 01 · VOICE SECURITY

Assert injected strings are escaped, not merely absent

Testing prompt injection only by checking a keyword is missing can pass by accident if the parser simply dropped the field.

Rule: Write transfer and tool tests asserting injected payloads are escaped or rejected cleanly at the resolver boundary.

TIP 02 · WEBHOOK AUTH

Verify per-call Twilio signatures against the right tenant

Live test calls on 7 September 2026 immediately exposed a webhook validation bug caused by token/tenant lookup mismatch.

Rule: Resolve tenant credentials per call SID and verify signatures fail-closed before processing any status callback.

TIP 03 · SILENT BUGS

Keep a living KNOWN-TRAPS document

Mass-assignment discarding AI summaries, wrong STT language defaults (DE/TR transcribed as English), and out-of-vocabulary statuses recur across teams.

Rule: Codify fixed defect classes in a required-reading trap register so later sessions and coding agents never reintroduce them.

TIP 04 · AGENT WORKFLOW

Pair AI-assisted implementation with read-only reviews

Each implementation set ran on an isolated branch followed by a read-only adversarial review session plus AST code graph queries.

Rule: Never trust a builder's self-reported "done"; separate verification downgraded incomplete claims and cut structural query tokens 7.3x.

Validation

  • 1,644 hermetic PHPUnit tests (6,249 assertions) running without Reverb or Redis, plus Node relay unit tests and TypeScript strict checks across 151 React/Inertia pages.
  • Atomic contact leases were concurrency load-tested, backed by dialer:reconcile to detect drift between call state and ledgers.
  • Browser walks verified the agent workspace, start-call gate, fleet monitor, and live inspector with screenshot evidence.
  • First real AI calls ran on 7 September 2026 on an allow-listed number, surfacing and fixing a webhook token defect.

What is not yet proven. Per-span latency instrumentation exists, and there is an internal SLO target, but caller-heard latency, call capacity, and sales uplift have not been measured under production load. Since September 2026, delivery has run implementation-first with deferred assertions tracked explicitly while seven core correctness invariants (tenant isolation, single dial authority, status transitions, append-only evidence, no unintended live calls, non-destructive migrations) remain mandatory.

Outcome

  • Concurrent AI fleet capabilities integrated alongside existing human and hybrid calling paths with zero destructive database migrations.
  • Feature-flagged voice lane rollback without code redeploys.
  • Live supervisor monitor with per-agent pause, live transcript drill-in, and operator call nudges.
  • Unified transfer resolver replacing three duplicated dialling paths with split opener/closer attribution.

Current status and limitations

  • Not in production: Staged rollout (sandbox, staged internal calls, shadow, canary) has not yet executed.
  • The QC-gated learning loop requires explicit human approval before promoting any prompt or playbook change, and that gate is not yet exercised in production.
  • Live human takeover of an active AI call and AI-to-AI media handover are specified and deferred.
  • Interest thresholds are not calibrated across DE/EN/TR locales and are not trusted for autonomous triggering.
  • Non-engineering compliance sign-offs (B2C consent provenance, emotion boundaries, works-council scoreboard agreements) remain open.

Private repository; no public demo. I can walk through the lease protocol, transfer resolver, or reward-hacking static checks in an interview.

Related reading & case studies

Email Sunny.work70@gmail.com or connect on LinkedIn.

Back to selected projects Download resume (PDF)