Connect Vapi to an Indian phone number with a bring-your-own SIP trunk
Give a Vapi assistant an Indian phone number that answers and places calls. A Vapi SIP trunk credential pointed at RingTrunk, the number added to Vapi as a bring-your-own number, the trunk's origination URI pointed at Vapi, and the settings that make calls fail when they are wrong.
Updated 24 September 2026
In short: In Vapi, create a bring-your-own SIP trunk credential that sends calls to sip.ringtrunk.com:5070 with your trunk id and password and accepts calls from RingTrunk's source IP, add your Indian number with that credential, and set your RingTrunk trunk's origination URI to <credential-id>.sip.vapi.ai; the same number then answers and places calls for your Vapi assistant.
Vapi connects to RingTrunk as a bring-your-own SIP trunk, which Vapi calls a BYO SIP trunk. You create a SIP trunk credential in Vapi that knows how to reach RingTrunk, add your Indian number to Vapi with that credential, and assign an assistant to the number. Calls to your number travel from RingTrunk to Vapi, and calls your assistant places travel from Vapi to RingTrunk. Vapi's reference for this is its SIP trunking guide.
What you need
- A RingTrunk trunk with an Indian number attached, its trunk id (
TR…) and the SIP password shown when you created the trunk. - RingTrunk's source IP, shown on your trunk's Origination tab in the portal.
- A Vapi account, its private API key, and an assistant.
1. Create the SIP trunk credential in Vapi
The credential tells Vapi where to send your assistant's calls and which address to accept calls from. It needs two gateways, because Vapi accepts a hostname only on a gateway that sends calls, and needs a numeric IP on a gateway that receives them:
curl -X POST https://api.vapi.ai/credential \
-H "Authorization: Bearer $VAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider": "byo-sip-trunk",
"name": "RingTrunk",
"gateways": [
{"ip": "sip.ringtrunk.com", "port": 5070, "outboundEnabled": true, "inboundEnabled": false, "outboundProtocol": "tcp"},
{"ip": "<SOURCE_IP_FROM_ORIGINATION_TAB>", "inboundEnabled": true, "outboundEnabled": false}
],
"outboundAuthenticationPlan": {
"authUsername": "TRxxxxxxxxxxxxxxxx",
"authPassword": "YOUR_SIP_PASSWORD"
}
}'Keep the id from the response. It is the credential ID in the next two steps.
- Set `inboundEnabled: false` on the `sip.ringtrunk.com` gateway. Vapi turns inbound on by default and rejects a hostname on an inbound gateway with "Couldn't validate SIP trunk credential".
- Use port 5070, not 5060. Port 5060 on RingTrunk's switch is the carrier side and does not accept your calls.
- The username is the trunk id, and the password is the trunk's SIP password, not your portal login.
In the Vapi dashboard, the same credential is created under Settings, Integrations, SIP Trunk, Configure New SIP Trunk.
2. Add your number to Vapi
The phone number ties your Indian number to the credential and to the assistant that answers it. Store the number in the 10-digit form RingTrunk sends, with Vapi's E.164 check switched off:
curl -X POST https://api.vapi.ai/phone-number \
-H "Authorization: Bearer $VAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider": "byo-phone-number",
"name": "RingTrunk India",
"number": "9XXXXXXXXX",
"numberE164CheckEnabled": false,
"credentialId": "<CREDENTIAL_ID>",
"assistantId": "<ASSISTANT_ID>"
}'RingTrunk delivers each call with your number in 10-digit form in the request URI and the To header, and Vapi routes an incoming call only when the called number matches the stored number exactly. In the Vapi dashboard, this is Phone Numbers, Create Phone Number, BYO SIP Trunk Number, with "Allow non-E164 phone numbers" switched on.
3. Send calls to your number to Vapi
The trunk's origination URI tells RingTrunk where to deliver calls to your number. On the trunk's Origination tab, add:
<CREDENTIAL_ID>.sip.vapi.aiReplace <CREDENTIAL_ID> with the credential ID from step 1. Vapi recognises the call as yours because it arrives from the source IP on your inbound gateway. Dial your number from any phone and your assistant answers.
4. Place a call from your assistant
Outbound calls travel from Vapi to RingTrunk through the credential's outbound gateway:
curl -X POST https://api.vapi.ai/call \
-H "Authorization: Bearer $VAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"assistantId": "<ASSISTANT_ID>",
"phoneNumberId": "<PHONE_NUMBER_ID>",
"customer": {"number": "+91XXXXXXXXXX"}
}'The caller ID on the call is your Vapi phone number, and it must be a number attached to your RingTrunk trunk. RingTrunk reads the caller ID and the destination with or without a +91, 91 or 0 prefix, so Vapi's default number format needs no change. Destinations are Indian mobile numbers only: 10 digits starting 6, 7, 8 or 9.
When it fails
| Symptom | Cause | Fix |
|---|---|---|
| Vapi says "Couldn't validate SIP trunk credential" | A gateway has a hostname with inbound left on, which is Vapi's default. | Set inboundEnabled: false on the sip.ringtrunk.com gateway, and put the numeric source IP on the inbound gateway. |
Outbound calls fail with 401 or 403 | The username or password in outboundAuthenticationPlan does not match the trunk. A rotated password takes up to 60 seconds to apply. | Use the trunk id as authUsername and the trunk's current SIP password as authPassword. |
Outbound calls fail with 403 cli_not_allowed | The Vapi phone number the call is placed from is not attached to your RingTrunk trunk. | Attach the number to the trunk, or place the call from a Vapi number that is. |
Calls to your number are rejected with 401 | Vapi did not recognise the source of the call, because the inbound gateway does not hold RingTrunk's source IP. | Put the source IP from your trunk's Origination tab on a gateway with inboundEnabled: true. |
Calls to your number are rejected with 404 | The called number does not match the number stored in Vapi. | Store the number in 10-digit form with numberE164CheckEnabled: false. |
| Calls to your number never reach Vapi | The trunk has no enabled origination URI. | Add <CREDENTIAL_ID>.sip.vapi.ai on the trunk's Origination tab. |
Working example
A script that creates the credential and the number from a .env file and places calls, dry run by default, is at github.com/Zingaro-Ai/ringtrunk-vapi-integration (MIT).
More SIP responses and what they mean are on Troubleshooting. The rules every call follows, caller ID and destinations, are on Placing calls.