This guide helps you resolve the Couldn't validate SIP trunk credential. SIP gateway creation failed. error when creating a BYO SIP trunk credential in Vapi.
This error occurs during the gateway creation step of SIP trunk provisioning. Vapi’s SBC (Session Border Controller) rejects the gateway configuration you provided. The sections below cover the most common causes and how to fix each one.
In this guide, you’ll learn to:
This guide focuses on the specific SIP gateway creation failed error. For
general SIP trunk setup instructions, see the
SIP trunking page.
Before you start troubleshooting, ensure you have:
This is the most common cause of this error.
The gateways[].ip field accepts both hostnames (for example, sip.example.com) and IPv4 addresses (for example, 203.0.113.10). However, the behavior differs depending on the call direction:
inboundEnabled: true, the SBC rejects the gateway configuration.Look at your gateway configuration. If inboundEnabled is true (or omitted, since it defaults to true) and the ip field contains a hostname (for example, sip.example.com), this is the cause of the error.
You have two options depending on whether you need inbound calling:
If you need inbound calling, resolve the hostname to its IPv4 address:
If your provider’s IP address changes, you need to update the gateway configuration with the new address.
If you only need outbound calling, you can keep the hostname and disable inbound:
The inboundEnabled gateway option defaults to true. If your SIP trunk is outbound-only (you only make calls through it, you do not receive inbound calls through Vapi), having inbound enabled can cause gateway creation to fail with some providers.
Look at your API request. If you did not set inboundEnabled explicitly, it defaulted to true. If you only need outbound calling, this is likely the problem.
Set inboundEnabled to false in your gateway configuration:
If you are using the Vapi dashboard, uncheck the Inbound option when configuring the gateway.
Your SIP provider needs to allow traffic from Vapi’s SBC IP addresses. If these IPs are not on the allowlist, the SBC’s registration and signaling requests to your provider are blocked, and gateway creation fails.
Ask your SIP provider whether the following IP addresses are on their allowlist:
44.229.228.186/3244.238.177.138/32Ask your SIP provider to add both Vapi SBC IP addresses to their allowlist:
Both addresses must be allowed. Vapi may use either one for signaling, so missing one can cause intermittent failures.
The table below lists all available options for each entry in the gateways array.
If none of the above resolves your issue, gather the following information and contact Vapi support:
Now that you can troubleshoot SIP trunk credential errors: