Twilio Voice Integration
This guide walks through connecting Twilio to Frona AI so agents can make and receive phone calls.
Prerequisites
Section titled “Prerequisites”- A Twilio account
- A Twilio phone number
- A publicly accessible URL for your Frona instance (or ngrok for development)
1. Get your Twilio credentials
Section titled “1. Get your Twilio credentials”From the Twilio Console:
- Account SID: found on the dashboard
- Auth Token: found on the dashboard (click to reveal)
- Phone Number: the number you purchased or were assigned
2. Configure environment variables
Section titled “2. Configure environment variables”Add these to your .env file:
FRONA_VOICE_TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxFRONA_VOICE_TWILIO_AUTH_TOKEN=your-auth-tokenFRONA_VOICE_TWILIO_PHONE_NUMBER=+15551234567FRONA_VOICE_CALLBACK_BASE_URL=https://your-public-url.comThe callback URL must be publicly accessible. Twilio sends call events to this URL.
3. Set up the callback URL
Section titled “3. Set up the callback URL”For production
Section titled “For production”Set FRONA_VOICE_CALLBACK_BASE_URL to your public domain:
FRONA_VOICE_CALLBACK_BASE_URL=https://frona.example.comFor development (using ngrok)
Section titled “For development (using ngrok)”The Docker Compose setup includes ngrok. Check your ngrok dashboard at http://localhost:4040 for the generated public URL, then set:
FRONA_VOICE_CALLBACK_BASE_URL=https://abc123.ngrok.io4. Restart the services
Section titled “4. Restart the services”docker compose restart frona5. Test it
Section titled “5. Test it”Start a conversation with the Receptionist agent and ask it to make a call:
Call +15559876543 and ask about their business hours.
The agent will:
- Read your memory for relevant context
- Initiate the call via Twilio
- Handle the conversation
- Report back with the results
Phone number format
Section titled “Phone number format”All phone numbers must be in E.164 format: + followed by the country code and number, with no spaces or dashes.
- Correct:
+15551234567 - Incorrect:
(555) 123-4567,555-123-4567
Troubleshooting
Section titled “Troubleshooting”- Calls not connecting: verify your Twilio credentials and that the phone number is active
- Callback errors: check that
FRONA_VOICE_CALLBACK_BASE_URLis publicly accessible - Agent not making calls: verify the Receptionist agent has the
make_voice_calltool enabled