Recording start
POST/calls/:call_control_id/actions/record_start
Start recording the call. Recording will stop on call hang-up, or can be initiated via the Stop Recording command.
Expected Webhooks (see callback schema below):
call.recording.saved
Request
Path Parameters
Unique identifier and token for controlling the call
- application/json
Body
required
Start recording audio request
Possible values: [wav
, mp3
]
The audio file format used when storing the call recording. Can be either mp3
or wav
.
Possible values: [single
, dual
]
When dual
, final audio file will be stereo recorded with the first leg on channel A, and the rest on channel B.
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
.
If enabled, a beep sound will be played at the start of a recording.
Default value: 0
Defines the maximum length for the recording in seconds. The minimum value is 0. The maximum value is 14400. The default value is 0 (infinite)
Default value: 0
The number of seconds that Telnyx will wait for the recording to be stopped if silence is detected. The timer only starts when the speech is detected. Please note that call transcription is used to detect silence and the related charge will be applied. The minimum value is 0. The default value is 0 (infinite)
Possible values: [both
, inbound
, outbound
]
Default value: both
The audio track to be recorded. Can be either both
, inbound
or outbound
. If only single track is specified (inbound
, outbound
), channels
configuration is ignored and it will be recorded as mono (single channel).
Possible values: [trim-silence
]
When set to trim-silence
, silence will be removed from the beginning and end of the recording.
Possible values: non-empty
and <= 40 characters
The custom recording file name to be used instead of the default call_leg_id
. Telnyx will still add a Unix timestamp suffix.
Enable post recording transcription. The default value is false.
Possible values: [A
, B
]
Default value: A
Engine to use for speech recognition. A
- Google
, B
- Telnyx
.
transcription_language
object
oneOf
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/record_start' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
-d '{
"format": "wav",
"channels": "single",
"client_state": "aGF2ZSBhIG5pY2UgZGF5ID1d",
"command_id": "891510ac-f3e4-11e8-af5b-de00688a4901",
"play_beep": true,
"max_length": 0,
"timeout_secs": 0,
"transcription": true,
"transcription_engine": "B",
"transcription_language": "en-US"
}'
Response samples
{
"data": {
"result": "ok"
}
}
{
"errors": [
{
"code": "string",
"title": "string",
"detail": "string",
"source": {
"pointer": "string",
"parameter": "string"
},
"meta": {}
}
]
}