Allowed signalling IPs
# support
n
Our VoiP server load balance calls and will therefore signal from different IP's and ports. We are unable to add additional IP's when creating a SIP trunk via the UI (Vapi Dashboard: Settings> Integrations > Configure New SIP Trunk) Patch the trunk with four IPs and Ports <- done this successfully curl -X PATCH https://api.vapi.ai/credential/SIP_ID \ -H "Authorization: Bearer YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{"gateways":[ {"ip":"103.230.159.**","port":5060}, {"ip":"103.1.186.**","port":5060}, {"ip":"119.42.54.**","port":5070} ]}' If you run a check, these IP's and Ports are listed. All indications are that the request was applied. However, inbound calls will only successfully terminate when coming from IP used when the SIP trunk was created originally on the UI (Vapi Dashboard). When an inbound call originates from any of the other IP's we are still getting '401 Unauthorized' Note that we are NOT using Authorisation Headers but rather IP-only auth. We have removed outboundAuthenticationPlan: null → no digest challenge. To summarise: All 3 IP's are listed as gateways when doing a query. However we are still getting '401 Unauthorized' from IP's that was added via the API call. Inbound calls from the IP originally added when SIP trunk was created works fine. Can you help?
v
Suggestion: Based on the documentation, all signaling IPs must be provided at the time of SIP trunk creation for proper whitelisting—adding new IPs later via API may not update the backend allowlist for inbound IP-auth calls, leading to 401 errors. The recommended action is to delete and recreate the SIP trunk with the full set of required IPs in the
gateways
array, for example:
Copy code
bash
curl -X POST https://api.vapi.ai/credential \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "byo-sip-trunk",
    "name": "Your Trunk Name",
    "gateways": [
      {"ip": "103.230.159.**", "port": 5060},
      {"ip": "103.1.186.**", "port": 5060},
      {"ip": "119.42.54.**", "port": 5070}
    ]
  }'
This ensures all IPs are properly whitelisted for inbound calls. Source: - [Vapi SIP Trunking Documentation](https://docs.vapi.ai/advanced/sip/sip-trunk)
n
@User Support Bot - Can you give me the API to add 'sipRegistration'. Our SIP trunks require sipRegistration with username and password. We added this, nut it gave us an error: "outboundLeadingPlusEnabled": true, "outboundAuthenticationPlan": { "authUsername": "177***28", "authPassword": "K8nK****IjNZkv" }, "sipRegistration": { "enabled": true, "domain": "103.230.159.**", "username": "177***28", "password": "K8nK****IjNZkv", "realm": "sip.fibremaxfone.com.au" }, "usePublicContact": false }'
@Vapi Support Bot - Can you give me the API to add 'sipRegistration'. Our SIP trunks require sipRegistration with username and password. We added this, nut it gave us an error: "outboundLeadingPlusEnabled": true, "outboundAuthenticationPlan": { "authUsername": "17728", "authPassword": "K8nK**IjNZkv" }, "sipRegistration": { "enabled": true, "domain": "103.230.159.", "username": "17728", "password": "K8nK**IjNZkv", "realm": "sip.fibremaxfone.com.au" }, "usePublicContact": false }'
c
To troubleshoot the 401 Unauthorized error when connecting your SIP provider to a Vapi SIP number, please follow these steps: 1\. **Check IP Whitelisting**: Ensure that your SIP provider's IP addresses are allowlisted in your Vapi configuration. Vapi requires SIP signaling IP addresses to be authorized. You can add these during your SIP trunk setup. 2\. **Configuration Review**: \- Ensure that your SIP INVITE is being sent to the correct SIP URI:
sip:<your-unique-id>@sip.vapi.ai
. \- Confirm that the IP address of your provider is in the recognized list by Vapi. Calls from unrecognized IPs will result in 401 errors. \- If applicable, make sure there are no typos in your SIP gateway IP configuration in Vapi. 3\. **SIP URI Termination**: When setting up your provider's termination, use the format
<credential_id>-sip.vapi.ai
if specific credential-based addressing is required by your setup. 4\. **Dummy Credentials**: If IP-based authentication has an issue, it's acceptable to use non-functional dummy credentials (e.g., username/password set as
vapi/vapi
) just to pass authentication checks. Even though Vapi doesn’t require authentication, some systems need these headers to proceed correctly. 5\. **Provider-Specific Configuration**: Double-check your provider’s settings to ensure they conform to the configuration recommended by their documentation, and match with the necessary details for Vapi integration. By following these steps, you should be able to resolve the authorization issue. Let me know if you need further assistance.
2 Views