04 / 04Case study · 2024 · CRM · Telephony
Campaign CRM with smart dialer, AI voice, and finance data explorer

Overview
This platform combines contact intelligence (CRM) with a smart dialer, optional AI voice assistance, and donor finance data exploration. Built for political campaigns, consultants, and nonprofits, it handles contact operations (activities, tasks, tags, lists), compliant calling (progressive + power dialer, DNC management, call recording), email outreach (Resend), file management (cloud sync), and subscriptions (Stripe). The system uses Twilio for telephony, ElevenLabs for AI voice, and WebSocket media servers for real-time audio processing.
The Challenge
Campaign teams juggle dozens of tools: a CRM for contacts, a dialer for calls, a spreadsheet for donor tracking, and manual research for giving history. Most dialers are clunky, require VoIP setup, and don't integrate with modern web apps. AI voice is promising but often violates compliance rules (TCPA, state-level consent laws). The goal was to build an all-in-one platform with a built-in dialer, optional AI voice (with human handoff), integrated finance data, and multi-tenant support for campaign teams and consultants.
Approach
Technical Architecture
Key Features Built
Platform Screenshots



Dialer & Voice AI Flow
The dialer supports two modes: progressive (agent-paced) and power (automated queue). Progressive: agent clicks 'Ready', system fetches next contact from queue, dials, and transitions agent to ON_CALL; after call ends, agent enters post-call workflow (disposition, notes, schedule follow-up), then buffer countdown before next call. Power: system dials multiple contacts in parallel, connects answered calls to available agents. For AI voice: ElevenLabs ConvAI triggers outbound call, system updates call queue and agent state, and handles human handoff via webhook. Inbound calls use Twilio TwiML for IVR (4-digit extension), then either dial a configured number or stream audio to WebSocket media server for AI bridge. All calls are recorded, transcribed (via Twilio Intelligence), and cached in Supabase Storage.
Technical Implementation


Hard problems
Agent state race conditions (multiple calls updating state).
Used database-level locking with SELECT FOR UPDATE and idempotent state transitions.
Twilio Media Streams audio buffering causing latency.
Tuned WebSocket server buffer sizes and added heartbeat pings; reduced latency from 2s to <500ms.
AI voice compliance (TCPA requires consent).
Added opt-in/opt-out tracking, DNC screening, and human handoff button in UI; logged all consent events.
Large contact exports (100K+ rows) timing out.
Moved export to background worker (Railway) that writes to Blob and emails download link via Resend.
Multi-tenant isolation for campaign teams.
Added org_id to all tables, enforced RLS policies, and scoped all queries via Supabase helpers.
Results
Learnings & Tradeoffs
This project taught me the complexity of real-time telephony. Twilio's Media Streams API is powerful but requires careful buffer management and heartbeat tuning to avoid audio dropouts. I also learned to treat agent state as a finite state machine—early designs allowed invalid transitions (e.g., READY → BUFFER without ON_CALL), which caused bugs. Adding idempotent state transitions and database-level locking fixed this. The AI voice feature was high-risk: compliance teams were concerned about TCPA violations, so we added explicit opt-in tracking, DNC screening, and human handoff. The tradeoff was reduced automation (agents still had to manually approve calls), but it was necessary for legal reasons. If I rebuilt this, I'd invest in more robust WebSocket health checks and add feature flags to toggle AI voice per org.