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

# Stream with Record

> Use the Vobiz Record and Stream XML elements together to simultaneously record a call to file and stream raw audio to your WebSocket in real time.

You can use the `<Record>` and `<Stream>` elements together to simultaneously record a call and stream its audio to a WebSocket in real-time. This is useful for applications that require both persistent storage of the call audio and live processing, such as real-time transcription and analysis.

## Stream with Record XML

```xml theme={null}
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Play>https://yourcdn.com/play.wav</Play>
  <Record action="https://your-domain.com/record_action/" method="POST" maxLength="3600" playBeep="true">
    <Stream bidirectional="true" keepCallAlive="true">wss://your-server.com/ws</Stream>
  </Record>
  <Play>https://yourcdn.com/play.wav</Play>
</Response>
```

## Record Event Callback Parameters

The Record event will go to the callback URL once recording starts on the call. The recording will be accessible via media.vobiz.ai after the recording is complete.

| Parameter           | Type   | Description                                      |
| ------------------- | ------ | ------------------------------------------------ |
| Digits              | string | Digits pressed during the call.                  |
| From                | string | The calling party number.                        |
| RecordingID         | string | The unique ID for the recording.                 |
| RecordFile          | string | The URL of the recorded file.                    |
| RecordingEndMs      | string | The timestamp when the recording ended.          |
| BillRate            | string | The billing rate for the call.                   |
| To                  | string | The called party number.                         |
| RecordingDurationMs | string | The duration of the recording in milliseconds.   |
| CallUUID            | string | The unique ID for the call.                      |
| ALegRequestUUID     | string | The request UUID for the A leg of the call.      |
| SessionStart        | string | The timestamp when the session started.          |
| Direction           | string | The direction of the call (inbound or outbound). |
| RecordUrl           | string | The URL of the recorded file.                    |
| RecordingDuration   | string | The duration of the recording in seconds.        |
| ALegUUID            | string | The unique ID for the A leg of the call.         |
| CallStatus          | string | The status of the call.                          |
| ParentAuthID        | string | The parent authentication ID.                    |
| RequestUUID         | string | The unique ID for the request.                   |
| Event               | string | The event type (Record).                         |
| RecordingStartMs    | string | The timestamp when the recording started.        |

## Stream with Record & Callback URL XML

```xml theme={null}
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Play>https://yourcdn.com/play.wav</Play>
  <Record action="https://your-domain.com/record_action/" method="POST" callbackUrl="https://your-domain.com/record_callback/" callbackMethod="POST" maxLength="3600" playBeep="true">
    <Stream bidirectional="true" keepCallAlive="true">wss://your-server.com/ws</Stream>
  </Record>
  <Play>https://yourcdn.com/play.wav</Play>
</Response>
```

## RecordStop Event Callback Parameters

A RecordStop event will be posted to the callbackUrl when the recording is stopped.

| Parameter           | Type   | Description                                      |
| ------------------- | ------ | ------------------------------------------------ |
| From                | string | The calling party number.                        |
| RecordingID         | string | The unique ID for the recording.                 |
| RecordFile          | string | The URL of the recorded file.                    |
| RecordingEndMs      | string | The timestamp when the recording ended.          |
| BillRate            | string | The billing rate for the call.                   |
| To                  | string | The called party number.                         |
| RecordingDurationMs | string | The duration of the recording in milliseconds.   |
| CallUUID            | string | The unique ID for the call.                      |
| ALegRequestUUID     | string | The request UUID for the A leg of the call.      |
| SessionStart        | string | The timestamp when the session started.          |
| Direction           | string | The direction of the call (inbound or outbound). |
| RecordUrl           | string | The URL of the recorded file.                    |
| RecordingDuration   | string | The duration of the recording in seconds.        |
| ALegUUID            | string | The unique ID for the A leg of the call.         |
| CallStatus          | string | The status of the call.                          |
| ParentAuthID        | string | The parent authentication ID.                    |
| RequestUUID         | string | The unique ID for the request.                   |
| Event               | string | The event type (RecordStop).                     |
| RecordingStartMs    | string | The timestamp when the recording started.        |
