Skip to main content

Start streaming media from a call.

POST 
/texml/Accounts/:account_sid/Calls/:call_sid/Streams.json

Starts streaming media from a call to a specific WebSocket address.

Request

Path Parameters

    account_sid stringrequired

    The id of the account the resource belongs to.

    call_sid stringrequired

    The CallSid that identifies the call to update.

Body

Start streaming media from a call

    StatusCallback uri

    Url where status callbacks will be sent.

    StatusCallbackMethod TexmlStatusCallbackMethod (string)

    Possible values: [GET, POST]

    Default value: POST

    HTTP method used to send status callbacks.

    Track StreamTrack (string)

    Possible values: [inbound_track, outbound_track, both_tracks]

    Default value: inbound_track

    Tracks to be included in the stream

    Name StreamName (string)

    The user specified name of Stream.

    BidirectionalMode Stream Bidirectional Mode (string)

    Possible values: [mp3, rtp]

    Default value: mp3

    Configures method of bidirectional streaming (mp3, rtp).

    BidirectionalCodec Stream Bidirectional Codec (string)

    Possible values: [PCMU, PCMA, G722]

    Default value: PCMU

    Indicates codec for bidirectional streaming RTP payloads. Used only with stream_bidirectional_mode=rtp. Case sensitive.

Responses

200: Successful call streaming create response

404: Resource not found

Request samples


curl -L -X POST 'https://api.telnyx.com/v2/texml/Accounts/:account_sid/Calls/:call_sid/Streams.json' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>'

Response samples


{
"account_sid": "61bf923e-5e4d-4595-a110-56190ea18a1b",
"call_sid": "v3:KBnLO0ZK3DhKM5s7bE9VluaSmKsOchKht_fUYvxcp8ysbmzCCtpkmA",
"sid": "e9cea0be-7dbd-4b98-98b1-c0089d9d43b0",
"name": "My stream",
"status": "in-progress",
"date_updated": "Fri, 11 Aug 2023 19:12:11 +0000",
"uri": "/v2/texml/Accounts/61bf923e-5e4d-4595-a110-56190ea18a1b/Calls/v3:KBnLO0ZK3DhKM5s7bE9VluaSmKsOchKht_fUYvxcp8ysbmzCCtpkmA/Streams/b08f0fa1-a32c-4218-b3b5-9cf78941ccac.json"
}