Skip to main content
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

1

Get the Source Code

Copy all the code locally from the twilio-inbound-quickstart-js example.
2

Install the Required Dependencies

or

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

  1. Go to your Twilio Console
  2. Navigate to your phone number’s configuration
  3. 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 key
  • SYSTEM_PROMPT: Instructions for the AI agent’s behavior
Configuring Variables

Start the Server

Run the server:
or
Now, when someone calls your Twilio number, they’ll be connected to your AI assistant.

Next Steps

  1. Check out the Outbound Phone Call example.
  2. Ultravox Realtime provides telephony integrations for Telnyx, Twilio, Plivo, and Exotel. Learn more here.

Additional Resources