client.calls resource. Vobiz keeps the same call flow and gives each concern a dedicated, explicitly named resource - calls.make_call to place a call, live_calls to fetch/list/hang up in‑flight calls, and one purpose‑built resource per in‑call action (play_audio, speak_text, dtmf, record_calls). Migrating is mostly a tab‑swap: rename the method, pass your auth_id explicitly, and keep the same answer‑URL webhook.
Set credentials once:
AUTH_ID is your Vobiz Auth ID (MA_…) and AUTH_TOKEN is your Auth Token. In the Vobiz SDK, api_key is the Auth ID (sent as the X-Auth-ID header) and auth_token becomes X-Auth-Token. Every account‑scoped method takes that auth_id as its first argument. Base URL: https://api.vobiz.ai/api/v1.Twilio → Vobiz mapping
Twilio grounds every outbound call inclient.calls.create() and every live‑call change in client.calls(sid).update(). Vobiz splits those responsibilities into focused resources so each call is easy to read and test.
Place an outbound call
Twilio requires exactly one ofurl, twiml, or application_sid; the common case is url + method pointing at your answer webhook. Vobiz uses answer_url + answer_method for the identical purpose.
Answer the call with markup
When Vobiz rings the destination it fetches youranswer_url and executes the returned XML - the same request/response model as a Twilio webhook. TwiML’s <Say>/<Gather> become VobizXML’s <Speak>/<Gather>; the vobizxml builder mirrors the ergonomics you already use.
Vobiz
<Gather> uses inputType, executionTimeout, digitEndTimeout, numDigits, and finishOnKey. See /xml/gather for the full attribute list.Control a live call
This is the biggest shape change - and the one that makes Vobiz code clearer. Twilio funnels every mid‑call action back throughclient.calls(sid).update(...), either redirecting to fresh TwiML or setting status. Vobiz gives each action its own resource keyed by (auth_id, call_uuid), so the intent is on the method name.
Fetch and list calls
Twilio’sclient.calls.list() and client.calls(sid).fetch() return both live and completed calls from one resource, filtered by status. Vobiz separates the two lifecycles: live_calls for anything in flight (status='live', plus queued‑call helpers) and cdr for completed‑call history with rich filters.
Key differences
- The answer webhook maps 1:1. Twilio’s
url+methodbecome Vobiz’sanswer_url+answer_method, andanswer_methodis passed explicitly on everymake_call. Your web framework returns markup exactly as before - just VobizXML instead of TwiML. - Explicit
auth_idon every call. Twilio scopes requests to the account behind the client. Vobiz passes the Auth ID (MA_…) as the first argument of each account‑scoped method, which makes multi‑account and sub‑account code unambiguous at the call site. - In‑call actions are first‑class resources. Where Twilio re‑enters
client.calls(sid).update(...)for every mid‑call change, Vobiz exposesplay_audio.call,speak_text.call,dtmf.send_dtmf,record_calls.start_recording, andlive_calls.hangup_call. Each method name states the action, so live‑call logic reads top‑to‑bottom. - Live vs. completed are separate lenses. Vobiz
live_callscovers in‑flight and queued legs; the dedicatedcdrresource covers completed‑call history with filters likefrom_number,to_number,call_direction,hangup_cause, andbridge_uuid- purpose‑built for reporting. - Redirect the natural way. An imperative Twilio redirect (
update(url=…)) is expressed on Vobiz by returning<Redirect>from your answer flow, keeping call routing declarative and versionable alongside the rest of your XML. - Familiar verb set. TwiML’s core verbs have direct VobizXML counterparts -
<Say>→<Speak>,<Pause>→<Wait>, and<Play> <Gather> <Dial> <Record> <Hangup> <Redirect> <Conference> <Stream>keep their names - so answer documents port with minimal edits. - Signed webhooks. Both platforms sign inbound webhook requests with your Auth Token; validate the signature on your
answer_urlthe same way you validatedX-Twilio-Signaturewith Twilio’sRequestValidator.
How to build click-to-call with a voice API
Click-to-call lets a web or mobile user initiate a phone call with a single button press — the server places an outbound call to the user’s number and connects it to an agent or an IVR. The pattern (identical on Twilio and Vobiz):- User clicks “Call me” — browser POSTs their phone number to your server
- Server calls the voice API to place an outbound call to that number
- API calls your
answer_urlwebhook when the call connects - Webhook returns XML instructions (TwiML / VobizXML) — speak a greeting, play hold music, dial your agent queue
Best practices for reducing call latency and drop rates
Latency is the delay between when the call connects and when audio starts flowing. Drop rate is the percentage of connected calls that disconnect before completion (excluding intentional hangups).Reduce call latency
Best practices:
- Host your
answer_urlwebhook in the same region as the voice API PoP — webhook round-trips add directly to perceived call setup time - Use Opus or G.722 where supported — lower bitrate at equal quality vs G.711 narrowband
- Pre-fetch customer data before the call connects — do your CRM lookup before
make_call, not inside the webhook, to eliminate lookup latency from the call path - Use streaming TTS for AI agents — start generating audio before the full response is ready
Reduce call drop rates
- Handle webhook timeouts — Twilio and Vobiz both expect a response from
answer_urlwithin ~15 seconds; slow responses cause the call to drop. Keep webhook handlers fast; offload heavy logic to background jobs - Use AMD before connecting an AI agent — without Answering Machine Detection, your agent speaks into voicemail. AMD filters these before the connection, reducing false-drop statistics
- Log every
status_callbackevent —completed,busy,no-answer,failedeach indicate different root causes. Failed carrier routes need different remediation than voicemail connections - Monitor
SIP-Termination-Reasonheaders — available in CDR data; map specific SIP codes to carrier vs application failures
How to set up international calling
International calling requires: a number in the originating country, carrier interconnect to the destination, and regulatory compliance in the destination market. Key setup steps:- Provision a local number in the caller’s country — calls from local numbers have significantly higher answer rates than calls from foreign numbers
- Use E.164 format for all destination numbers:
+[country code][subscriber number], no spaces or dashes - Check STIR/SHAKEN attestation level — international calls typically receive B or C attestation, increasing spam-label risk on US-terminating calls. Use numbers registered to your business entity for A-level attestation
- Know the regulatory requirements in the destination market — India requires 140-series caller ID for all commercial outbound calls; the US requires TCPA written consent for AI voice calls
How to route calls based on customer data
Dynamic call routing uses data from your CRM or database to determine how a call is handled — which queue, which agent, which language, which script — before the caller hears anything. The routing pattern:answer_url or action URLs to carry state — https://yourapp.com/answer?customer_id=12345. This avoids session storage and keeps routing logic stateless.
Need a resource that isn’t here? See the full Twilio → Vobiz overview for the migration order and the at‑a‑glance matrix across numbers, SIP trunking, conferences, and CDR.