This is the full example of the Inbound Call Quickstart.
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
Get the Source Code
Copy all the code locally from the
twilio-inbound-quickstart-js
example.2
Install the Required Dependencies
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
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
Configuring Variables
Start the Server
Run the server:Next Steps
- Check out the Outbound Phone Call example.
- Ultravox Realtime provides telephony integrations for Telnyx, Twilio, Plivo, and Exotel. Learn more here.