{
    "api_id": "f7615566-13c5-11ee-b552-0242ac110005",
    "audio_track": "both",
    "bidirectional": false,
    "bill_duration": 27,
    "billed_amount": "0.00300",
    "call_uuid": "78737f83-4660-490d-98e1-025dfe4b5c8f",
    "created_at": "2023-06-21 13:23:44.136962+00:00",
    "end_time": "2023-06-21 18:53:43+05:30",
    "plivo_auth_id": "MAY2RJNZKZNJMWOXXX",
    "resource_uri": "/v1/Account/MAY2RJNZKZNJMWOXXX/Call/78737f83-4660-490d-98e1-025dfe4b5c8f/Stream/20170ada-f610-433b-8758-c02a2aab3662/",
    "rounded_bill_duration": 60,
    "service_url": "wss://mysocket.com/wss/v2/1/demo/",
    "start_time": "2023-06-21 18:53:16+05:30",
    "stream_id": "20170ada-f610-433b-8758-c02a2aab3662"
}

The audio Steam object lets you receive the raw audio of a live phone call over a configured WebSocket in near real time.

API Endpoint

POST
https://api.plivo.com/v1/Account/{auth_id}/Conference/{conference_name}/Record/

Attributes

AttributesDescription
Service_url (string, required)WebSocket URL to which the audio stream is initiated.
Example: wss://mystream.ngrok.io/audiostream
If a valid URL is not provided or an active stream already exists at the URL, a 400 error is returned.
bidirectional (boolean)Specifies whether the WebSocket stream is bidirectional.
If true, Plivo accepts the following input types from your app:
- event: takes playAudio as value
- media: JSON object with:
contentType: raw, wav
sampleRate: 8000, 16000
payload: base64-encoded raw audio
audio_track (string)Audio track of the call to stream.
Allowed values:
- inbound: audio received by Plivo
- outbound: audio sent by Plivo
- both: both directions
Default: inbound
stream_timeout (integer)Max duration (in seconds) the audio will be streamed.
Must be a positive integer.
Default: 86400 (24 hours).
This does not affect the rest of the call flow.
status_callback_url (string)URL to notify when stream events occur:
- Stream connected
- Stream stopped
- Timeout reached
- Stream connection failed or dropped
status_callback_method (string)HTTP method used to invoke status_callback_url.
Allowed values: GET, POST
Default: POST
content_type (string)Preferred codec and sampling rate.
Allowed values:
- audio/x-l16;rate=8000
- audio/x-l16;rate=16000
- audio/x-mulaw;rate=8000
Default: audio/x-l16;rate=8000
extra_headers (string)Key-value pairs sent with the stream to the WebSocket service.
Format: "key1=value1,key2=value2"
Max size: 512 bytes. Only alphanumeric characters [A-Z][a-z][0-9] allowed.

When the bidirectional value is set to true, the audio_track value should not be set to outbound or both.

{
    "api_id": "f7615566-13c5-11ee-b552-0242ac110005",
    "audio_track": "both",
    "bidirectional": false,
    "bill_duration": 27,
    "billed_amount": "0.00300",
    "call_uuid": "78737f83-4660-490d-98e1-025dfe4b5c8f",
    "created_at": "2023-06-21 13:23:44.136962+00:00",
    "end_time": "2023-06-21 18:53:43+05:30",
    "plivo_auth_id": "MAY2RJNZKZNJMWOXXX",
    "resource_uri": "/v1/Account/MAY2RJNZKZNJMWOXXX/Call/78737f83-4660-490d-98e1-025dfe4b5c8f/Stream/20170ada-f610-433b-8758-c02a2aab3662/",
    "rounded_bill_duration": 60,
    "service_url": "wss://mysocket.com/wss/v2/1/demo/",
    "start_time": "2023-06-21 18:53:16+05:30",
    "stream_id": "20170ada-f610-433b-8758-c02a2aab3662"
}