SIP Trunking issue
# support
t
Hey Everyone, Need some help with a SIP trunk issue that's driving me crazy So I've got my SIP trunk set up, followed the docs, whitelisted all the IPs you guys listed, tried different protocols and ports... but inbound calls just aren't working at all The weird part is: When I connect a phone number to the trunk (even a wrong one), Vapi says it's configured but doesn't throw any errors My SIP trunk backend shows nothing is actually connected to it When someone calls the number... nothing happens, no routing at all I've been troubleshooting this for a while now and can't figure out what I'm missing. Anyone know what might be going on or what I should check next? Happy to share logs/config details if needed
c
Hi there, Thank you for your message. Our team is currently out of the office. We operate Monday through Friday, from 9:00 AM to 8:00 PM Pacific Standard Time (PST). We’ll get back to you as soon as possible during our normal business hours. If your message is urgent, please mark it accordingly or include “URGENT” in the subject line, and we’ll do our best to respond promptly. Warm regards, Vapi Customer Support Team
v
Check your SIP provider's inbound routing: Make sure your provider is forwarding inbound calls to the correct SIP URI format:
Copy code
sip:YOUR_PHONE_NUMBER@sip.vapi.ai
Replace
YOUR_PHONE_NUMBER
with your actual number. This is a common source of issues if not set exactly as required ([see documentation](https://docs.vapi.ai/advanced/sip/twilio)). Source: - [Twilio SIP Integration](https://docs.vapi.ai/advanced/sip/twilio)
d
"I'm building a custom tool that looks up tenant data. My n8n webhook is returning data successfully, but VAPI keeps saying 'no result returned'. What's the exact response format VAPI expects from a custom tool webhook? Should it be: 1. Plain text string? 2. JSON with a specific field name? 3. Something else? My current response: [paste what we're sending] Any help appreciated!"
t
@Vapi Support Bot I tried this but It didn't work. I also tried the Sip Trunk on a local softphone and it works as intended, I can both get inbound calls and make outbound calls. Also Vapi's dashboard says the Sip is configured but when called there is nothing . It is very weird because Vapi says configured but on the Sip Trunk's dashboard, there are is nothing. I've been troubleshooting this for a while now and can't figure out what I'm missing. Anyone know what might be going on or what I should check next? Happy to share logs/config details if needed
v
Thanks for the update. To help narrow this down: Can you confirm if your SIP provider is forwarding inbound calls to the exact SIP URI format
sip:YOUR_PHONE_NUMBER@sip.vapi.ai
as required?
Even a small mismatch in the URI can prevent inbound calls from reaching Vapi ([see documentation](https://docs.vapi.ai/advanced/sip/twilio)). If possible, please double-check the provider's inbound routing settings for this detail. Source: - [Twilio SIP Integration](https://docs.vapi.ai/advanced/sip/twilio)
t
@Vapi Support Bot Inbound calls are being forwarded to Vapi using the SIP URI format sip:MY_NUMBER@sip.vapi.ai, but the INVITE is getting a 401 Unauthorized response, and the logs show “Endpoint: 'vapi': There were no auth ids available” followed by the call being disconnected.
v
Actionable Next Step: Double-check that you have provided all Vapi signaling IP addresses to your SIP provider when creating the SIP trunk. Missing any required IPs can cause 401 Unauthorized errors for inbound calls. Required IPs to whitelist:
Copy code
44.229.228.186/32
44.238.177.138/32
Update your SIP provider's access control or trunk settings to include both IPs, then retest inbound calls. [See full documentation](https://docs.vapi.ai/advanced/sip/sip-trunk) Source: - [SIP Trunking | Vapi Documentation](https://docs.vapi.ai/advanced/sip/sip-trunk)
t
@Vapi Support Bot I double checked and all the IPs are whitelisted. My SIP side is sending INVITEs into Vapi for that BYO number, but the INVITEs get a 401 Unauthorized response and the logs on my side show “Endpoint: 'vapi': There were no auth ids available”.
v
Try re-creating your SIP trunk credential in Vapi with explicit authentication details. Use the following API call, replacing the placeholders with your actual SIP provider info:
Copy code
bash
curl -X POST "https://api.vapi.ai/credential" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_VAPI_PRIVATE_KEY" \
  -d '{
    "provider": "byo-sip-trunk",
    "name": "Your Trunk Name",
    "gateways": [{ "ip": "YOUR_SIP_PROVIDER_DOMAIN", "inboundEnabled": true }],
    "outboundAuthenticationPlan": {
      "authUsername": "YOUR_SIP_USERNAME",
      "authPassword": "YOUR_SIP_PASSWORD"
    }
  }'
After creating the credential, associate your phone number with it and retest inbound calls. See [full example in the documentation](https://docs.vapi.ai/advanced/sip/sip-trunk). Source: - [SIP Trunking | Vapi Documentation](https://docs.vapi.ai/advanced/sip/sip-trunk)
t
@Vapi Support Bot Calls from my PBX to sip:pbx_test_sip@sip.vapi.ai now get 100/180/200 and then BYE from Vapi in under a second. On my side the SIP leg is clean, but in the Vapi dashboard I only see /v2/call/metadata GETs and no normal call log entry for these SIP calls. Can you help me on why SIP calls to this SIP URI are being answered and then immediately terminated (or not recorded) on Vapi?
v
It sounds like your SIP trunk is connecting, but calls are not being processed because the phone number may not be properly associated with your SIP trunk credential in Vapi. Try explicitly linking your phone number to the SIP trunk using this API call:
Copy code
bash
curl -X POST "https://api.vapi.ai/phone-number" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_VAPI_PRIVATE_KEY" \
  -d '{
    "provider": "byo-phone-number",
    "name": "Your Number",
    "number": "YOUR_PHONE_NUMBER",
    "numberE164CheckEnabled": false,
    "credentialId": "YOUR_CREDENTIAL_ID"
  }'
After this, assign the number to your assistant in the dashboard and retest inbound calls. See [full example in the documentation](https://docs.vapi.ai/advanced/sip/sip-trunk). Source: - [SIP Trunking | Vapi Documentation](https://docs.vapi.ai/advanced/sip/sip-trunk)
t
@Vapi Support Bot No but the thing im doing is that im sending all calls to the vapi uri so why would i need this
v
Even if you are sending all calls to the Vapi URI, you must associate your phone number with the SIP trunk credential in Vapi for inbound calls to be processed. This is a required step for Vapi to recognize and route the calls. Use the following API call to link your number:
Copy code
bash
curl -X POST "https://api.vapi.ai/phone-number" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_VAPI_PRIVATE_KEY" \
  -d '{
    "provider": "byo-phone-number",
    "name": "Your Number",
    "number": "YOUR_PHONE_NUMBER",
    "numberE164CheckEnabled": false,
    "credentialId": "YOUR_CREDENTIAL_ID"
  }'
This association is necessary for proper call handling—see the [Vapi SIP Trunk documentation](https://docs.vapi.ai/advanced/sip/sip-trunk) for details. Source: - [SIP Trunking | Vapi Documentation](https://docs.vapi.ai/advanced/sip/sip-trunk)
t
@Vapi Support Bot where do i get credentialId from
v
You get the
credentialId
from the response when you create your SIP trunk credential in Vapi. After sending the following API request, the returned JSON will include an
"id"
field—this is your `credentialId`:
Copy code
bash
curl -X POST "https://api.vapi.ai/credential" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_VAPI_PRIVATE_KEY" \
  -d '{
    "provider": "byo-sip-trunk",
    "name": "Your Trunk Name",
    "gateways": [{ "ip": "YOUR_SIP_PROVIDER_DOMAIN", "inboundEnabled": true }],
    "outboundAuthenticationPlan": {
      "authUsername": "YOUR_SIP_USERNAME",
      "authPassword": "YOUR_SIP_PASSWORD"
    }
  }'
Check the
"id"
in the API response and use it as your
credentialId
when associating phone numbers.
See [Vapi SIP Trunk documentation](https://docs.vapi.ai/advanced/sip/sip-trunk) for details. Source: - [SIP Trunking | Vapi Documentation](https://docs.vapi.ai/advanced/sip/sip-trunk)
t
@Vapi Support Bot so i associated my phone number with the SIP trunk credential in Vapi for inbound calls to be processed but still Calls from my PBX to sip:pbx_test_sip@sip.vapi.ai now get 100/180/200 and then BYE from Vapi in under a second. On my side the SIP leg is clean, but in the Vapi dashboard I only see /v2/call/metadata GETs and no normal call log entry for these SIP calls. Can you help me on why SIP calls to this SIP URI are being answered and then immediately terminated (or not recorded) on Vapi?
c
Hey, can you share the org_id? You can find it [here](https://dashboard.vapi.ai/org/settings). This will help me get more details about it.
2 Views