SUPPORT.TWILIO.COM END OF LIFE NOTICE: This site, support.twilio.com, is scheduled to go End of Life on February 27, 2024. All Twilio Support content has been migrated to help.twilio.com, where you can continue to find helpful Support articles, API docs, and Twilio blog content, and escalate your issues to our Support team. We encourage you to update your bookmarks and begin using the new site today for all your Twilio Support needs.

Why Are My Inbound Call Recordings Missing with the Twilio Node.js SDK

Issue

Twilio’s Programmable Voice API allows you to record calls for compliance, quality assurance, or analytics. While outbound call recordings are often straightforward, some developers encounter issues where inbound call recordings are not created or visible in the Twilio Console even when following the documentation and using the Node.js SDK.

This article will walk you through common causes and troubleshooting steps to resolve missing inbound call recordings.

Common Scenario: You have implemented call recording in your Node.js application using the Twilio SDK. Outbound calls are recorded as expected, but inbound calls are not, and no recordings appear in the Twilio Console. You have:

  • Used client.calls(callSid).recordings.create(...) for inbound calls.
  • Set record: true for outbound calls.
  • Specified options like recordingChannels: 'dual',  recordingTrack: 'both', and trim: 'trim-silence'.
  • Checked for TwiML conflicts, API errors, and console settings.
  • Verified there are no error messages in your application logs.

 

Product

Programmable Voice

 

Environment

legacy Twilio Console

 

Resolution

1. Confirm When the Recording API Is Triggered

The recordings.create() method must be called while the call is in-progress (i.e., after the call is answered, but before it completes). If you attempt to start a recording before the call is active, Twilio will not process the request.

Tip: If you are using Twilio Media Streams or other event handlers, ensure your recording logic is triggered only after the call is in-progress and you have a valid CallSid.

2. Log the Full API Response

If your code only logs recording.sid and recording.status on success, and error.message on failure, you may miss important details. Always log the full error object, including status,  code and moreInfo, to help diagnose issues.

Example:

js
try {
  const recording = await client.calls(callSid).recordings.create({
    recordingChannels: "dual",
    recordingTrack: "both",
    trim: "trim-silence",
  });
  console.log(recording.sid, recording.status);
} catch (error) {
  console.error(error); // Log the full error object
}

3. Test with a Direct API Call

To isolate whether the issue is with your SDK implementation or elsewhere, try starting a recording using a direct API call (e.g., cURL or Postman) while the call is in-progress. If this works, the issue may be with your application logic or timing.

Example cURL:

curl -X POST "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings.json" \
-u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'

4. Check for Recording Start Events in Twilio Console

In the Twilio Console, navigate to the specific Call SID and review the event log. If you do not see a "Recording Started" event, your application may not be triggering the recording as expected.

5. Review Application Logic for Inbound Calls

  • Ensure your handler for inbound calls is correctly identifying and acting on inbound call events.
  • If using Media Streams, confirm that the recording logic is not inadvertently skipped or delayed.

 

Additional Information 

  • No Backend Toggle: Twilio does not provide a global dashboard toggle to enable call recording for all calls. Recording must be initiated programmatically or via TwiML in your application.
  • Regional Restrictions: Make sure your Twilio account and phone numbers are not subject to regional restrictions that could affect recording.
  • TwiML Conflicts: If you use TwiML to control call flows, ensure there are no conflicting instructions that might prevent recording.

If you have followed all the above steps and inbound call recordings are still not being created, gather the following information before seeking further assistance:

  • Example Call SID(s) where recording failed
  • Full API response or error payload
  • Details about when and how your recording logic is triggered

This information will help support teams or the Twilio community assist you more efficiently.

Below you will find references to useful documents:

Have more questions? Submit a request
Powered by Zendesk