Bad Request on Twilio SIP Trunk Credential
# support
i
I wanted to ask what could be causing this issue when I'm trying to create a SIP trunk from Twilio to my VAPI account I'm consistently getting this error whenever I try to hit the API in Postman { "message": "Couldn't validate SIP trunk credential. SIP gateway creation failed.", "error": "Bad Request", "statusCode": 400 } https://cdn.discordapp.com/attachments/1402793714119737345/1402793719828054016/GetAttachmentThumbnail.png?ex=689534f5&is=6893e375&hm=2ee8886fca3c9ad0a346d51c75e86c007727b1b06868eba0089baba7ba0729b9& https://cdn.discordapp.com/attachments/1402793714119737345/1402793720243552306/GetAttachmentThumbnail.png?ex=689534f5&is=6893e375&hm=29075b21f3d6058b2e070f1b7ab0b6c6b4959dea46aac4791a02bb319d5d591d&
v
Suggestion: Double-check that your
gateways
field uses the exact Twilio Termination SIP URI (not just the trunk domain). For example, your request body should look like this:
Copy code
json
{
  "provider": "byo-sip-trunk",
  "name": "Twilio Trunk",
  "gateways": [{ "ip": "your-trunk-termination.sip.twilio.com" }],
  "outboundLeadingPlusEnabled": true
}
Make sure your Twilio trunk is active and that Vapi's IPs (
44.229.228.186
,
44.238.177.138
) are whitelisted in Twilio as required by the documentation. [See full guide](https://docs.vapi.ai/advanced/sip/twilio) Source: - [Twilio SIP Integration](https://docs.vapi.ai/advanced/sip/twilio)
Can I get assistance instead of connecting a BYO-SIP-Trunk? I'm getting the 400 error when I try in postman
c
Hi Ivan, you have a couple of options when configuring a Twilio SIP Trunk: - Add your Twilio API key to your Vapi dashboard on the
Phone Numbers
page - Or through the API request to the /credential endpoint (like you are currently doing) and use the IP address of the domain instead of the resolved name If you continue to encounter errors when adding the SIP, please let us know and we will be more than happy to help you.
2 Views