Inbound Phone Calls
Connect inbound phone calls to an AI agent in 6 minutes.
This is the full example of the Inbound Call Quickstart.
This guide walks you through connecting inbound phone calls using Twilio to an Ultravox agent.
Prerequisites
- Node.js 20 or higher
- A Twilio account with:
- Account SID
- Auth Token
- Phone Number
- An Ultravox API key
- For incoming calls: A publicly accessible URL for your webhook (e.g., using ngrok)
Set-up and Installation
Get the Source Code
Copy all the code locally from the twilio-inbound-quickstart-js
example.
Install the Required Dependencies
or
Configure Twilio Webhook
Make Your Server Publicly Accessible
Use ngrok or a similar service to create a public URL for your local server:
Set Up Webhook
- Go to your Twilio Console
- Navigate to your phone number’s configuration
- Under “Voice & Fax”, set the webhook URL for incoming calls to:
https://your-ngrok-url/incoming
Update Configuration
The AI assistant will introduce itself as Steve and have a conversation with the recipient. You need to update the variable for the Ultravox API key. You may also (optionally) update the system prompt.
ULTRAVOX_API_KEY
: Your Ultravox API keySYSTEM_PROMPT
: Instructions for the AI agent’s behavior
Start the Server
Run the server:
or
Now, when someone calls your Twilio number, they’ll be connected to your AI assistant.
Next Steps
- Check out the Outbound Phone Call example.
- Ultravox Realtime provides telephony integrations for Telnyx, Twilio, Plivo, and Exotel. Learn more here.