The audio streaming feature requires an active WebSocket connection throughout the call. If the initial connection attempt fails, Plivo will automatically attempt twice before disconnecting the stream. Plivo also recommends using callbacks to monitor any connection failures. You can set this up by specifying the status_callback_url in your XML.
StartStream: Sent as soon as audio streaming begins.
StopStream: Sent when streaming stops.
DroppedStream: Sent for one of the following reasons:
WebSocket connection failed during initiation.
WebSocket connection was terminated during streaming.
WebSocket connection was terminated due to a slow connection.
DegradedStream: Sent when a slow connection is detected. Plivo buffers audio packets for up to 40 seconds, and when the buffer - reaches 30%, 60%, or 90% capacity, this event is triggered.
Disconnecting Stream & Websockets
Plivo automatically handles disconnecting the stream and WebSocket when your call is terminated, so there is no need to manually disconnect the WebSocket from your end.
Audio stream logs on Plivo Console
Plivo displays details of audio streams linked to a call on the respective Call Detail Record (CDR) page. In your audio stream log, you’ll find details including:
Stream uuid: A unique identifier for the audio stream associated with the call log.
Stream start time: The start time for the audio stream, displayed in UTC.
Stream end time: The end time for the audio stream ended, displayed in UTC.
Duration: The duration of the audio stream expressed in seconds.
Rounded bill duration: The total amount billed based on the billing interval, expressed in seconds.
Billed amount: The total charges incurred for the corresponding stream uuid.
Hangup reason: Specifies the cause behind the termination of the stream. Potential termination reasons include:
API request: The stream is disconnected through an API request.
Call hangup: The call ended and the stream was disconnected.
Connection error: A connection issue caused the stream to end.
Stream timeout: The stream ended when the duration specified in the stream_timeout parameter was reached.
Debug logs: A hyperlink leading customers to detailed audio streaming debug logs. These logs give you access to a list of events that occurred during audio streaming, aiding in debugging any stream-related issues.
Sample debug log for an audio stream
Rate this page
🥳 Thank you! It means a lot to us!
×
Help Us Improve
Thank you so much for rating the page, we would like to get your input
for further improvements!