The AudioStream element
The audio stream element lets you receive raw audio from active calls over a WebSocket connection in near real time.
Attributes
bidirectionalboolean | Specifies whether the audio being streamed over the WebSocket is bidirectional (the service can both read and write audio over the WebSocket) or one-way (read-only). If the bidirectional attribute is set to Allowed values:
|
audioTrackstring | The audio track (inbound or outbound) of the underlying call that Plivo will fork and stream to the WebSocket service. |
Note: When the bidirectional value is set to true, the audioTrack value should not be set to outbound or both. | |
streamTimeoutinteger | The maximum duration, in seconds, for which audio will be streamed once streaming starts. At the end of the specified duration, streaming will stop. This will have no impact on the rest of the call flow. |
statusCallbackUrlstring | URL notified by Plivo when one of the following events occurs:
|
statusCallbackMethodstring | The HTTP verb used to invoke the status_callback_url. |
contentTypestring | Preferred audio codec and sampling rate. |
extraHeadersstring | Key-value pairs passed to the WebSocket service along with the audio stream. These extra headers will be passed with every HTTP request made by the call. |
keepCallAliveBoolean | This parameter signifies whether the stream element should be executed alone, without proceeding to execute the subsequent elements in the XML instruction. It applies only when the bi-directional audio stream is set to true. Any elements following the stream in the XML instruction will execute only after the stream is disconnected. |
Parameters sent to the statusCallbackUrl
This information is sent to statusCallbackUrl when an event is triggered.
bidirectionalboolean | Specifies whether the audio being streamed over the WebSocket is bidirectional (the service can both read and write audio over the WebSocket) or one-way (read-only). If the bidirectional attribute is set to Allowed values:
|
audioTrackstring | The audio track (inbound or outbound) of the underlying call that Plivo will fork and stream to the WebSocket service. |
Note: When the bidirectional value is set to true, the audioTrack value should not be set to outbound or both. | |
streamTimeoutinteger | The maximum duration, in seconds, for which audio will be streamed once streaming starts. At the end of the specified duration, streaming will stop. This will have no impact on the rest of the call flow. |
statusCallbackUrlstring | URL notified by Plivo when one of the following events occurs:
|
statusCallbackMethodstring | The HTTP verb used to invoke the status_callback_url. |
contentTypestring | Preferred audio codec and sampling rate. |
extraHeadersstring | Key-value pairs passed to the WebSocket service along with the audio stream. These extra headers will be passed with every HTTP request made by the call. |
keepCallAliveBoolean | This parameter signifies whether the stream element should be executed alone, without proceeding to execute the subsequent elements in the XML instruction. It applies only when the bi-directional audio stream is set to true. Any elements following the stream in the XML instruction will execute only after the stream is disconnected. |