Skip to content

Ultravox Integration

Set up outbound calls using Ultravox and Vobiz SIP infrastructure.

Overview

To set up outbound calls using Ultravox and Vobiz, the flow is straightforward: you tell Ultravox to "start a call," and you give it the Vobiz credentials so it can act as your phone system.

Step 1: Gather Your Credentials

You need three pieces of information to "handshake" the two systems.

SourceItemWhere to GetValue / Description
UltravoxAPI KeyUltravox KeysYOUR_API_KEY
UltravoxAgent IDAgent DashboardYOUR_AGENT_ID
VobizSIP DomainVobiz TrunksYOUR_DOMAIN.sip.vobiz.ai
VobizUsernameVobiz TrunksYOUR_USERNAME
VobizPasswordVobiz TrunksYOUR_PASSWORD
VobizFrom NumberVobiz Numbers+91XXXXXXXXXX

Step 2: The Outbound Call Flow

Unlike inbound calls, you don't need to "add a URI" to Vobiz. Instead, you send a POST request to Ultravox, and Ultravox pushes the call to Vobiz.

The API Call (CURL)

This command initiates the call. It tells Ultravox: "Use my agent, connect to Vobiz with these credentials, and dial this person."

Initiate Outbound Call
curl -X POST "https://api.ultravox.ai/api/agents/YOUR_AGENT_ID/calls" \
     -H "X-API-Key: YOUR_API_KEY" \
     -H "Content-Type: application/json" \
     -d '{
       "medium": {
         "sip": {
           "outgoing": {
             "to": "sip:+919XXXXXXXXX@YOUR_VOBIZ_DOMAIN.sip.vobiz.ai",
             "from": "YOUR_VOBIZ_NUMBER",
             "username": "YOUR_VOBIZ_USERNAME",
             "password": "YOUR_VOBIZ_PASSWORD"
           }
         }
       },
       "firstSpeakerSettings": {
         "user": {}
       }
     }'

Step 3: Critical Parameters Explained

  • to: This is the destination URI. Format: sip:NUMBER@VOBIZ_DOMAIN.
  • from: This is your Caller ID. Most SIP providers (like Vobiz) will reject the call if this doesn't match a number you actually purchased from them.
  • firstSpeakerSettings: { "user": {} }: This is vital for outbound. It tells the AI to wait for the human to say "Hello" before it starts talking. (Otherwise, the AI might finish its greeting while the call is still connecting).

Step 4: What Happens Next? (The Lifecycle)

  1. Request: You run the CURL. Ultravox returns a callId immediately.
  2. Invite: Ultravox sends a SIP INVITE to 38bb7fbf.sip.vobiz.ai using your piyush credentials.
  3. Ringing: The destination phone (+919148227303) starts ringing. Note: SIP billing starts now.
  4. Connect: The user picks up and says "Hello."
  5. Conversation: Ultravox detects the speech and the AI Agent (test_vobiz) starts the conversation.

Troubleshooting Outbound

If the call doesn't ring, use this API to see exactly why Vobiz rejected it:

Get SIP Logs
# Replace CALL_ID with the ID you got from the first command
curl -X GET "https://api.ultravox.ai/api/calls/CALL_ID/sip/logs" \
     -H "X-API-Key: FoE4dx39.JM1StfK4RYJedz4XIorebyhVZ8z7ujQM"
  • 403 Forbidden: Wrong username/password or your IP isn't allowed.
  • 407 Proxy Authentication Required: This is normal; Ultravox should handle it automatically using your password.
  • 480 Temporarily Unavailable: The destination number is busy or turned off.