import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const response = await client.calls.actions.startRecording('call_control_id', {
channels: 'single',
format: 'wav',
});
console.log(response.data);{
"data": {
"result": "ok"
}
}Start recording the call. Recording will stop on call hang-up, or can be initiated via the Stop Recording command.
Expected Webhooks:
call.recording.savedcall.recording.transcription.savedcall.recording.errorimport Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const response = await client.calls.actions.startRecording('call_control_id', {
channels: 'single',
format: 'wav',
});
console.log(response.data);{
"data": {
"result": "ok"
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Unique identifier and token for controlling the call
Start recording audio request
The audio file format used when storing the call recording. Can be either mp3 or wav.
wav, mp3 "mp3"
When dual, final audio file will be stereo recorded with the first leg on channel A, and the rest on channel B.
single, dual "single"
Use this field to add state to every subsequent webhook. It must be a valid Base-64 encoded string.
"aGF2ZSBhIG5pY2UgZGF5ID1d"
Use this field to avoid duplicate commands. Telnyx will ignore any command with the same command_id for the same call_control_id.
"891510ac-f3e4-11e8-af5b-de00688a4901"
If enabled, a beep sound will be played at the start of a recording.
true
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)
100
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)
100
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).
both, inbound, outbound "outbound"
When set to trim-silence, silence will be removed from the beginning and end of the recording.
trim-silence "trim-silence"
The custom recording file name to be used instead of the default call_leg_id. Telnyx will still add a Unix timestamp suffix.
1 - 40"my_recording_file_name"
Enable post recording transcription. The default value is false.
true
Engine to use for speech recognition. A - Google
"A"
Language to use for speech recognition
af-ZA, am-ET, ar-AE, ar-BH, ar-DZ, ar-EG, ar-IL, ar-IQ, ar-JO, ar-KW, ar-LB, ar-MA, ar-MR, ar-OM, ar-PS, ar-QA, ar-SA, ar-TN, ar-YE, az-AZ, bg-BG, bn-BD, bn-IN, bs-BA, ca-ES, cs-CZ, da-DK, de-AT, de-CH, de-DE, el-GR, en-AU, en-CA, en-GB, en-GH, en-HK, en-IE, en-IN, en-KE, en-NG, en-NZ, en-PH, en-PK, en-SG, en-TZ, en-US, en-ZA, es-AR, es-BO, es-CL, es-CO, es-CR, es-DO, es-EC, es-ES, es-GT, es-HN, es-MX, es-NI, es-PA, es-PE, es-PR, es-PY, es-SV, es-US, es-UY, es-VE, et-EE, eu-ES, fa-IR, fi-FI, fil-PH, fr-BE, fr-CA, fr-CH, fr-FR, gl-ES, gu-IN, hi-IN, hr-HR, hu-HU, hy-AM, id-ID, is-IS, it-CH, it-IT, iw-IL, ja-JP, jv-ID, ka-GE, kk-KZ, km-KH, kn-IN, ko-KR, lo-LA, lt-LT, lv-LV, mk-MK, ml-IN, mn-MN, mr-IN, ms-MY, my-MM, ne-NP, nl-BE, nl-NL, no-NO, pa-Guru-IN, pl-PL, pt-BR, pt-PT, ro-RO, ru-RU, rw-RW, si-LK, sk-SK, sl-SI, sq-AL, sr-RS, ss-latn-za, st-ZA, su-ID, sv-SE, sw-KE, sw-TZ, ta-IN, ta-LK, ta-MY, ta-SG, te-IN, th-TH, tn-latn-za, tr-TR, ts-ZA, uk-UA, ur-IN, ur-PK, uz-UZ, ve-ZA, vi-VN, xh-ZA, yue-Hant-HK, zh, zh-TW, zu-ZA "en-US"
Enables profanity_filter. Applies to google engine only.
true
Enables speaker diarization. Applies to google engine only.
true
Defines minimum number of speakers in the conversation. Applies to google engine only.
4
Defines maximum number of speakers in the conversation. Applies to google engine only.
4
Was this page helpful?