Skip to main content

AI Streaming

The Stream action will connect the call to a WebSocket server and stream real-time audio data. This can be used for scenarios like real-time AI processing or interactive voice response systems.

Streaming action JSON

[
{
action: "stream",
ws_url: "ws://example.tcp.ngrok.url",
listen_mode: "both",
voice_quality: "8000",
stream_on_answer: true
}
]

Parameters type and description

ParameterTypeDescription
*actionstringThe PCMO action to control the flow of the call.
*ws_urlstringThe WebSocket URL where the audio stream will be sent.
*listen_modestringDetermines which part of the call audio is captured and stored
  • Caller: The voice of the person who initiated the call will be recorded and stored.
  • Callee: The voice of the person receiving the call will be recorded and stored.
  • Both: the voices from both the caller and the callee will be recorded and stored.
voice_qualitystringThe desired voice quality in bits per second. Options are 8000, 16000.
stream_on_answerbooleanWhether to start streaming after the call is answered.The default value is false.
Note
The * marked parameter is mandatory.