BYO SIP Trunk API prevents FQDN usage (Twilio PSTN...
# support
n
* Issue 1: The API Validator instantly rejects FQDNs (No network request is made)* * Attempting to POST /credential for a byo-sip-trunk using a Twilio FQDN ({name}.pstn.twilio.com) fails instantly with a 400 Bad Request: Couldn't validate SIP trunk credential. * There are several posts here where Vapi's support claims that Twilio is rejecting the request because some sort of authentication issue, but Vapi never call the address we put in there during creation * Proof: We ran a raw TCP/UDP proxy and confirmed Vapi makes zero network attempts (no OPTIONS ping) when the FQDN is provided. It is a pure, local API validation failure, which makes it impossible to use Twilio (Twilio requires the FQDN in SIP headers) Example: POST https://api.vapi.ai/credential
Copy code
{
  "provider": "byo-sip-trunk",
  "name": "Twilio",
  "gateways": [
    {
      "ip": "myfqdn.pstn.twilio.com"
    }
  ],
  "outboundAuthenticationPlan": {
    "authPassword": "...",
    "authUsername": "vapi"
  },
  "outboundLeadingPlusEnabled": true
}
Response
Copy code
{
  "message": "Couldn't validate SIP trunk credential. SIP gateway creation failed.",
  "error": "Bad Request",
  "statusCode": 400
}
Issue 2: PATCH updates the DB, but not the voice engine (Sticky IP Bug) * The Workaround: Create the trunk with a dummy numeric IP -> PATCH the gateway to the Twilio FQDN. * The Bug: The UI/API successfully reflects the updated Twilio FQDN. However, the outbound voice engine remains stuck on the original numeric IP used during creation. * The Result: Calls fail with 408 Request Timeout because Vapi’s engine ignores the PATCHed FQDN and continues routing SIP signaling to the dummy IP.** And before you ask, YES, I have put Vapi ips in Twilio's allowlist and the credential as well
c
Hi, For any gateway that handles inbound calls, our system requires a real IPv4 address. Hostnames are only supported for outbound-only gateways. Since your current config is implicitly treated as inbound-enabled, the system attempts to validate [myfqdn.pstn.twilio.com](http://myfqdn.pstn.twilio.com) as an inbound gateway and rejects it, which causes: “Couldn't validate SIP trunk credential. SIP gateway creation failed.” We recommend you if you only need outbound calling, please set:
Copy code
{
  "inboundEnabled": false
}
This marks the gateway as outbound-only, which allows hostname-based gateways like [myfqdn.pstn.twilio.com](http://myfqdn.pstn.twilio.com) Best regards, Vapi Support Team
n
How am I supposed to make SIP work with twilio inbound calls ?
If I put twilio ips for my pstn hostname, twilio rejects it with a generic 403
I created a proxy script that forwards the packets coming to my ip to that fqdn and it somewhat works, confirming that it's not a credentials / allow list problem
Note: the configuration I'm trying to use is the same as the video you guys got attached on your docs
The presenter were able to use the full hostname normally at the time of his recording
Ok, vapi accepts something like this... I'm. trying to test the outbound call but I get a bunch of missed calls notifications from my carrier... Just wondering if this is how it is intended to be configured
Copy code
{
  "provider": "byo-sip-trunk",
  "name": "Twilio-Hybrid-Trunk",
  "gateways": [
    {
      "ip": "myfqdn.pstn.twilio.com",
      "outboundEnabled": true,
      "inboundEnabled": false
    },
    {
      "ip": "54.172.60.0",
      "inboundEnabled": true,
      "outboundEnabled": false
    },
    {
      "ip": "54.172.60.1",
      "inboundEnabled": true,
      "outboundEnabled": false
    },
    {
      "ip": "54.172.60.2",
      "inboundEnabled": true,
      "outboundEnabled": false
    },
    {
      "ip": "54.172.60.3",
      "inboundEnabled": true,
      "outboundEnabled": false
    }
  ],
  "outboundAuthenticationPlan": {
    "authPassword": "...",
    "authUsername": "vapi"
  },
  "outboundLeadingPlusEnabled": true
}
c
Hi, the missed calls notifications in this case is probably a normal behavior here's the sequence when you test an outbound call: 1. vapi sends a sip INVITE to
myfqdn.pstn.twilio.com
2. twilio routes it to whatever destination number you're calling 3. that number rings 4. if you don't pick up (because you're just testing), your carrier logs it as a missed call and notifies you