> ## Documentation Index
> Fetch the complete documentation index at: https://www.vobiz.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Twilio to Vobiz Code: Control and Look Up Live Calls

> Side-by-side Twilio and Vobiz code for live calls - play audio, speak text, send DTMF, record and hang up a call in progress, and fetch or list live calls.

Part of the [Twilio to Vobiz code snippets](https://www.vobiz.ai/docs/compare/twilio/code-snippets): each task shows the **Twilio** code and the equivalent **Vobiz** code in Python and Node - copy the Vobiz tab. The snippets use the `client` from [Set up the client](https://www.vobiz.ai/docs/compare/twilio/code-snippets#set-up-the-client).

> [!NOTE]
>
> Set your credentials once: `AUTH_ID` is your Vobiz Auth ID (`MA_…`), `AUTH_TOKEN` is your Auth Token. In the Vobiz SDK, `api_key` **is** the Auth ID, and every account-scoped method takes that `auth_id` explicitly.

## 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 through `client.calls(sid).update(...)` (redirecting to fresh TwiML or setting `status`) and starts recording with `client.calls(sid).recordings.create()`. Vobiz gives each action its own resource keyed by `(auth_id, call_uuid)`, so the intent lives on the method name.

| Action | Twilio | Vobiz |
| - | - | - |
| Play audio | `client.calls(sid).update(twiml="<Play>…")` | `client.play_audio.call(auth_id, call_uuid, urls=)` |
| Speak text | `client.calls(sid).update(twiml="<Say>…")` | `client.speak_text.call(auth_id, call_uuid, text=)` |
| Send DTMF | `client.calls(sid).update(twiml="<Play digits=…>")` | `client.dtmf.send_dtmf(auth_id, call_uuid, digits=)` |
| Start recording | `client.calls(sid).recordings.create()` | `client.record_calls.start_recording(auth_id, call_uuid)` |
| Hang up | `client.calls(sid).update(status="completed")` | `client.live_calls.hangup_call(auth_id, call_uuid)` |

```python Twilio · Python theme={null}
# Every mid-call change re-enters client.calls(sid).update(...)
client.calls(sid).update(                                            # play audio
    twiml='<Response><Play>https://example.com/hold.mp3</Play></Response>')
client.calls(sid).update(                                            # speak text
    twiml='<Response><Say>Please hold.</Say></Response>')
client.calls(sid).update(                                            # send DTMF
    twiml='<Response><Play digits="1234"></Play></Response>')
client.calls(sid).recordings.create()                                # start recording
client.calls(sid).update(status='completed')                         # hang up
```

```python Vobiz · Python theme={null}
client.play_audio.call(AUTH_ID, CALL_UUID, urls='https://example.com/hold.mp3')   # play audio
client.speak_text.call(AUTH_ID, CALL_UUID, text='Please hold.')                   # speak text
client.dtmf.send_dtmf(AUTH_ID, CALL_UUID, digits='1234')                          # send DTMF
client.record_calls.start_recording(AUTH_ID, CALL_UUID)                           # start recording
client.live_calls.hangup_call(AUTH_ID, CALL_UUID)                                 # hang up
```

```javascript Twilio · Node theme={null}
await client.calls(sid).update({
  twiml: '<Response><Play>https://example.com/hold.mp3</Play></Response>' });
await client.calls(sid).update({
  twiml: '<Response><Say>Please hold.</Say></Response>' });
await client.calls(sid).update({
  twiml: '<Response><Play digits="1234"></Play></Response>' });
await client.calls(sid).recordings.create();
await client.calls(sid).update({ status: 'completed' });
```

```javascript Vobiz · Node theme={null}
await client.playAudio.call(AUTH_ID, CALL_UUID, { urls: 'https://example.com/hold.mp3' });
await client.speakText.call(AUTH_ID, CALL_UUID, { text: 'Please hold.' });
await client.dtmf.sendDtmf(AUTH_ID, CALL_UUID, { digits: '1234' });
await client.recordCalls.startRecording(AUTH_ID, CALL_UUID);
await client.liveCalls.hangupCall(AUTH_ID, CALL_UUID);
```

> [!TIP]
>
> Each Vobiz method name states the action, so live-call logic reads top-to-bottom. For the full resource map, see [Voice Call API](https://www.vobiz.ai/docs/compare/twilio/voice-call-api.md); to convert the TwiML you inline via `update(twiml=…)`, use the [TwiML → VobizXML](https://www.vobiz.ai/docs/compare/twilio/twiml-to-vobizxml.md) reference.

## Look up a live call

Twilio reads live and completed calls off one `client.calls` resource, filtered by `status`. Vobiz gives in-flight calls their own `live_calls` resource - pass `status="live"` to fetch or list what's currently on the wire. Completed-call history lives in [`cdr`](https://www.vobiz.ai/docs/compare/twilio/voice-call-api).

| Task | Twilio | Vobiz |
| - | - | - |
| Get one call | `client.calls('CA0123...').fetch()` | `client.live_calls.get_live_call(AUTH_ID, 'call-uuid-here', status='live')` |
| List calls in progress | `client.calls.list(status='in-progress')` | `client.live_calls.list_live_calls(AUTH_ID, status='live')` |
| Call identifier | Call SID (`CA…`) | Call UUID |

```python Twilio · Python theme={null}
one = client.calls('CA0123...').fetch()
live = client.calls.list(status='in-progress')
```

```python Vobiz · Python theme={null}
one = client.live_calls.get_live_call(AUTH_ID, 'call-uuid-here', status='live')
live = client.live_calls.list_live_calls(AUTH_ID, status='live')
```

## More Twilio to Vobiz code snippets

* [Set up the client and make an outbound call](https://www.vobiz.ai/docs/compare/twilio/code-snippets)
* [Answer calls with XML](https://www.vobiz.ai/docs/compare/twilio/code-snippets/answer-calls.md)
* [Numbers and conferences](https://www.vobiz.ai/docs/compare/twilio/code-snippets/numbers-and-conferences.md)
* [Call records, webhooks and errors](https://www.vobiz.ai/docs/compare/twilio/code-snippets/call-records-webhooks-errors.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.