AI Phone Assistant — Twilio + OpenAI Realtime + Cloudflare Workers

Template for deploying an AI voice assistant with Twilio, OpenAI Realtime API, and Cloudflare Workers

View the Project on GitHub jmoore2333/twilio-openai-voice-assistant-cloudflare-template

Inbound Smoke Test

Use this after your first deploy to confirm Twilio, the Worker, OpenAI Realtime, and your database are all wired correctly.

1. Set the Twilio webhook

In the Twilio phone number configuration:

2. Place one real test call

Make one short inbound call and give the assistant a simple name and reason.

Good example:

That makes it easier to confirm the structured intake fields were saved correctly.

3. Check the latest call row in D1

Replace the database name if needed:

npx wrangler d1 execute voice-assistant-template --remote --command "SELECT twilio_call_sid, from_number, to_number, caller_name, preferred_language, reason_summary, call_status, email_status, created_at, updated_at, length(COALESCE(transcript_text, '')) AS transcript_chars FROM intake_calls ORDER BY id DESC LIMIT 5;"

What you want to see:

4. Check transcript events

npx wrangler d1 execute voice-assistant-template --remote --command "SELECT twilio_call_sid, COUNT(*) AS transcript_events FROM call_transcript_events GROUP BY twilio_call_sid ORDER BY MAX(id) DESC LIMIT 5;"

You should see transcript events for the latest call SID.

5. Check debug events if something looks off

npx wrangler d1 execute voice-assistant-template --remote --command "SELECT twilio_call_sid, stage, event_type, message, created_at FROM call_debug_events ORDER BY id DESC LIMIT 20;"

Useful signs:

6. If the call did not connect

Check these first:

7. Cleanup for a disposable test deploy

npx wrangler delete <worker-name>
npx wrangler d1 delete <database-name>