Streaming start
POST/calls/:call_control_id/actions/streaming_start
Start streaming the media from a call to a specific WebSocket address or Dialogflow connection in near-realtime. Audio will be delivered as base64-encoded RTP payload (raw audio), wrapped in JSON payloads.
Please find more details about media streaming messages specification under the link.
Request
Path Parameters
Unique identifier and token for controlling the call
- application/json
Body
required
Start streaming media request
The destination WebSocket address where the stream is going to be delivered.
Possible values: [inbound_track
, outbound_track
, both_tracks
]
Default value: inbound_track
Specifies which track should be streamed.
Possible values: [mp3
, rtp
]
Default value: mp3
Configures method of bidirectional streaming (mp3, rtp).
Possible values: [PCMU
, PCMA
, G722
]
Default value: PCMU
Indicates codec for bidirectional streaming RTP payloads. Used only with stream_bidirectional_mode=rtp. Case sensitive.
Possible values: [both
, self
, opposite
]
Default value: opposite
Specifies which call legs should receive the bidirectional stream audio.
Enables Dialogflow for the current call. The default value is false.
dialogflow_config
object
Enable sentiment analysis from Dialogflow.
Enable partial automated agent reply from Dialogflow.
Use this field to add state to every subsequent webhook. It must be a valid Base-64 encoded string.
Use this field to avoid duplicate commands. Telnyx will ignore any command with the same command_id
for the same call_control_id
.
Responses
200: Successful response upon making a call control command.
- application/json
default: Unexpected error
- application/json
Request samples
curl -L 'https://api.telnyx.com/v2/calls/:call_control_id/actions/streaming_start' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
-d '{
"stream_url": "wss://www.example.com/websocket",
"stream_track": "both_tracks",
"client_state": "aGF2ZSBhIG5pY2UgZGF5ID1d",
"command_id": "891510ac-f3e4-11e8-af5b-de00688a4901",
"enable_dialogflow": false,
"dialogflow_config": {
"analyze_sentiment": false,
"partial_automated_agent_reply": false
}
}'
Response samples
{
"data": {
"result": "ok"
}
}
{
"errors": [
{
"code": "string",
"title": "string",
"detail": "string",
"source": {
"pointer": "string",
"parameter": "string"
},
"meta": {}
}
]
}