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.
| Source | Item | Where to Get | Value / Description |
|---|---|---|---|
| Ultravox | API Key | Ultravox Keys | YOUR_API_KEY |
| Ultravox | Agent ID | Agent Dashboard | YOUR_AGENT_ID |
| Vobiz | SIP Domain | Vobiz Trunks | YOUR_DOMAIN.sip.vobiz.ai |
| Vobiz | Username | Vobiz Trunks | YOUR_USERNAME |
| Vobiz | Password | Vobiz Trunks | YOUR_PASSWORD |
| Vobiz | From Number | Vobiz 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)
- Request: You run the CURL. Ultravox returns a
callIdimmediately. - Invite: Ultravox sends a SIP INVITE to
38bb7fbf.sip.vobiz.aiusing yourpiyushcredentials. - Ringing: The destination phone (
+919148227303) starts ringing. Note: SIP billing starts now. - Connect: The user picks up and says "Hello."
- 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"