Troubleshooting Blacklisted Destination Numbers in Twilio Outbound Calls

For an outbound call to be placed and completed successfully there are a number of factors that need to work properly. It's often hard to find the causes of a failing call. One great tool that we can use for this purpose is the Logs module in the Twilio Console. In this post we describe the process of checking the Errors logs, specifically related to calls blocked due to blacklisted destination numbers.

Identifying Blacklisted Destination Number Issues

  1. Open the Twilio Console. https://console.twilio.com/

  2. Click the Monitor tab in the left menu.

  3. Open the Errors logs submenu item.


You will then see the Errors logs page, in there you are presented with a variety of filters that you can apply to your search. By default you see all the events in the last 24 hours, the most recent first. In the next screenshot you can see this screen:

In the previous image you can see an event of type error, associated to voice connectivity. In the event description you can read "SIP call blocked by Twilio", so this alone gives us information about why our outbound call failed. If we click the link in the event description, we see more details like the request parameters. In our case, only the description was enough to confirm the error cause, sadly, there is no way to remove the number from the backlist other than using the Twilio Help Center to contact support.

Understanding Destination Number Blocking Errors

When you see error messages related to blocked destination numbers, you'll typically encounter one of these error codes:

  • Error 13225: "Dial: Call blocked by Twilio" - This indicates that the outbound call to the destination number was blocked by Twilio. Twilio

  • Error 21216: "API: Call blocked by Twilio" - Similar to 13225, this indicates that the destination number is blocked. Twilio

  • Error 32203: "SIP: Call blocked by Twilio" - This occurs when attempting to make SIP calls to blocked destination numbers. Twilio

Why Destination Numbers Get Blacklisted

There are several reasons why Twilio might block calls to certain destination numbers:

  1. High-Risk Destinations: The destination may be identified as high-risk for fraud, causing Twilio to block calls to these numbers as a preventative measure. Twilio

  2. Specific Country Restrictions: You may be attempting to call a country that has not been enabled under your account's Voice Geographic Permissions. Twilio

  3. Fraud Prevention Measures: Twilio constantly monitors call patterns and may block destinations that show suspicious activity or are frequently associated with scams.

Resolving Blacklisted Destination Number Issues

When you encounter errors indicating that your destination number is blocked, there are several steps you can take:

  1. Verify the Error in Console Logs:

    • Check the complete error details in the Twilio Console Logs

    • Note the specific error code (13225, 21216, or 32203)

    • Review any additional information provided in the error description

  2. Check Geographic Permissions: If the issue relates to country restrictions, you can set the allowed countries under your account's Voice Geographic Permissions. Twilio

  3. Contact Twilio Support: If you believe the destination number is incorrectly blocked, contact Twilio Customer Support through the Console or Help Center. Twilio As mentioned in our example case, contacting support is often the only way to have a legitimate number removed from the blacklist.

  4. Provide Supporting Information: When contacting support, be prepared to:

    • Share the Call SID for the failed attempt

    • Explain why you need to call this particular destination

    • Provide context about your business use case

Best Practices to Avoid Destination Blocking Issues

To minimize disruptions from destination blocking:

  1. Monitor Your Logs Regularly: Set up a routine to check your Twilio Console Logs for any emerging patterns of blocked destination numbers.

  2. Review Call Patterns: Unusual calling patterns to specific regions might trigger automatic blocks, so maintain consistent, expected call patterns.

  3. Set Up Alert Triggers: Configure alerts in the Twilio Console to notify you when calls to specific destinations are being blocked.

  4. Verify Voice Permissions: Ensure your account has the proper geographic permissions enabled for all regions you need to call.

Conclusion

Blacklisted destination number issues can be a significant obstacle when making outbound calls with Twilio. By properly monitoring your Twilio Console Logs and understanding the various error codes, you can quickly identify when a destination number is blocked and take appropriate steps to resolve the issue.

Remember that while some issues can be resolved through self-service methods like adjusting your geographic permissions, removing specific numbers from Twilio's blacklist typically requires assistance from Twilio Support. When contacting support, be clear about your legitimate business need to call the blocked number, and they should be able to assist you in resolving the issue.

By following the steps outlined in this guide, you can minimize disruptions to your outbound calling operations and ensure better delivery rates for your voice communications.

References