Phone Quickstart
Incoming Phone Calls
Connect incoming calls to an AI agent in 6 minutes.
This guide walks you through connecting incoming Twilio calls 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
1
Set Up Your Project
Create a new directory for your project and initialize it:
2
Install Dependencies
3
Create Your Server
Create a new file called server.js
with the following code. This code can also be found on GitHub.
Note: Make sure to add your Ultravox API key.
Configure Twilio Webhook
1
Make Your Server Publicly Accessible
Use ngrok or a similar service to create a public URL for your local server:
2
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
Start the Server
Run the server:
Now, when someone calls your Twilio number, they’ll be connected to your AI assistant.
Next Steps
Ultravox Realtime provides telephony integrations for Telnyx, Twilio, and Plivo. Learn more here.
Additional Resources
- Twilio Documentation
- Express.js Documentation
- ngrok Documentation