Issue
This article explains why in some instances recording may not capture the full duration of a Twilio call. It covers call flow scenario, possible causes, how to identify the issue using Twilio Console logs, and how to properly configure your application to record the entire call.
Product
Programmable Voice
Environment
legacy Twilio Console
Cause
You may report that a call recording:
- Only captures a few seconds (8–10 seconds), while the actual call lasted much longer.
- Is unexpectedly truncated.
- Is missing the beginning, middle, or end of the conversation.
- Recording only contains one sided audio
Example
A Console log might show a call lasting 1 minute 32 seconds, but the associated recording is only 8 seconds long.
Twilio provides different ways to record calls, and each method behaves differently. In the below above example, we captured recording of 8 seconds while call duration was 1 minute 32 seconds. This is because,<Record> verb Is Executed only After <Stream> verb as per below Twiml instruction.
TwiML instructions run sequentially, not simultaneously. If your TwiML includes a <Connect><Stream> followed by <Record>, then recording won’t begin until the <Stream> ends. <Record> Verb records only side of the call.
Example TwiML
<Response>
<Connect>
<Stream url="wss://stream-endpoint" name="StreamName"/>
</Connect>
<Record timeout="10" transcribe="true"/>
</Response>
Some additional possible causes that may lead into this specific issue:
- Call ended before recording began: The caller hung up or disconnected before TwiML reached the <Record> or <Dial record="true"> instruction.
- Multiple recording tags in call flow: Only the first valid <Record> or <Dial> with record="true" may take effect; others may be skipped.
- Delayed recording start via API: Using the Recording Controls API after the conversation has started results in partial recordings.
- Conference calls missing record="record-from-start": Without this TwiML setup, <Conference> calls may not record.
- Trim settings cutting silence: trim="silence" can shorten recordings by removing quiet periods at the beginning or end.
-
Audio packet loss or call quality issues: Rare media transport issues can result in incomplete or choppy recordings or will result in missing of this bad audio from recording.
Resolution
Additional information regarding recordings:
Silence settings
- trim="silence" (default) removes leading and trailing silence from recordings.
- If you need to preserve all audio, make sure to set trim="do-not-trim".
When recording is started
Recording does not start automatically without explicit instructions. It begins only when a recording command is given—whether through <Record> verb, Recording Control API, the <Dial> Record attribute, Record=true, ConferenceRecord=true in an API call, or similar methods. Therefore, it’s important to compare the time the Call SID was created with when the recording instruction was sent to Twilio.
Resolution
How to record entire call from start which involves multiple Twiml instruction:
If you want to ensure the entire conversation is recorded, especially when using <Stream>, <Dial>, or more complex call flows, Twilio recommends using the call Recording Controls API. This gives you flexibility to work around sequential TwiML execution or third-party integrations.
Benefits of the Call Recording Controls API:
- Start recording at any point in the call.
- Pause and resume as needed.
- Stop recording when needed.
How to check what was recorded and when recording instruction was sent to Twilio
- Visit the Call Logs page in Twilio Console.
- Select the relevant Call SID.
- Check:
- Call Duration (eg 1:32)
- Recording Length (eg 0:08)
- Recording SID and Format (WAV/MP3)
- Check the related TwiML logs, also known as Request Inspector logs, to see when the TwiML instructions or API requests to record the call were sent. These details can be found in Request Inspector Log.
Best Practices
- Use the Recording Controls API if you need full-call coverage.
- Always test changes in a staging environment before deploying to production.
Additional Information
If you're unsure how to update your TwiML or implement Recording Controls, reach out to your development team or contact Twilio Support and we will be happy to assist you.