Vapi
Use a Vonyx SIP trunk and number as a bring-your-own SIP trunk for Vapi assistants.
Connect a Vonyx SIP trunk to Vapi so your Vapi assistants can call out from, and answer calls on, your Vonyx +91 number. Vapi calls this a BYO SIP trunk. You can set it up in the Vapi dashboard or through the Vapi API.
Before you start
- A Vonyx SIP trunk with a number attached, and the trunk's username and password
- A Vapi account with at least one assistant
- For the API path: your Vapi private API key
Use the US Vapi region
This guide uses https://api.vapi.ai and sip.vapi.ai. Vapi's EU region uses https://api.eu.vapi.ai and sip.eu.vapi.ai; Vapi says the API base and the SIP host must be in the same region.
Outbound calls
Create the SIP trunk credential
Vapi stores the trunk as a credential. Add one gateway for Vonyx with inbound and outbound both on, so the same credential can be used for inbound calls later.
| Field | Value |
|---|---|
| Gateway IP | 43.204.9.41 |
| Port | 5060 |
| Netmask | 32 |
| Transport | UDP (Vonyx has no TLS) |
| Allow inbound calls | On (off if you only need outbound) |
| Allow outbound calls | On |
| Authentication username | your_trunk_username |
| Authentication password | your_trunk_password |
| SIP registration | Off |
- Open the organization menu in the top left and choose Settings.
- Open Integrations and select SIP Trunk.
- Click Configure New SIP Trunk.
- Name the trunk (for example,
Vonyx) and add a gateway with the values in the table above. - Turn on Allow inbound calls and Allow outbound calls.
- Under Authentication, enter your Vonyx trunk username and password. Leave SIP registration off.
- Save the trunk.
Import your Vonyx number
Vonyx numbers are written 91XXXXXXXXXX, without a +, so turn off Vapi's E.164 check for this number.
- Go to Phone Numbers and click Create Phone Number.
- Select BYO SIP Trunk Number.
- Enter your Vonyx number as
91XXXXXXXXXXand turn on Allow non-E164 phone numbers. - Select the
Vonyxcredential you created, optionally add a label, and click Import SIP Phone Number.
Place a call
The caller ID is the Vonyx number you imported. Vonyx only accepts calls whose caller ID is one of your Vonyx numbers.
customer.numberE164CheckEnabled defaults to true, which only accepts numbers like +91XXXXXXXXXX. Set it to false to dial 91XXXXXXXXXX.
Inbound calls
Check the credential allows inbound
The Vonyx gateway in your credential must have inbound turned on (Allow inbound calls in the dashboard, "inboundEnabled": true in the API). Vapi only accepts inbound SIP from gateway IPs in the credential, and Vonyx sends inbound calls from 43.204.9.41.
Pick the assistant
Go to Phone Numbers, open your Vonyx number, select an assistant under Inbound Settings, and click Save.
Point Vonyx at Vapi
Vapi expects inbound calls at {phoneNumber}@YOUR_CREDENTIAL_ID.sip.vapi.ai. In the Vonyx console, open the trunk, turn on Inbound calls and set Inbound address to the host part only:
Use the credential ID from the first step. Don't add sip: or a user part; Vonyx adds the dialled number. See inbound calls.
Test the connection
- Run the Place a call request with your own mobile as
customer.number. Your phone rings with your Vonyx number as caller ID, and the assistant speaks when you answer. - Call your Vonyx number from another phone. The assistant you picked under Inbound Settings answers.
- If either fails, check the call logs in Vapi and SIP troubleshooting.
Limitations
- DTMF and call transfer are not available on Vonyx yet. Vapi's SIP transfers use SIP REFER, so don't add Vapi transfer tools that point at this trunk.
- New accounts make 1 call at a time (raise limits).
- Vonyx has no TLS or SRTP, so keep the gateway's outbound protocol on UDP (or TCP). Don't pick
tlsortls/srtp. - Vonyx supports only the PCMU and PCMA codecs.
Troubleshooting
| Problem | Fix |
|---|---|
| "Couldn't validate SIP trunk credential. SIP gateway creation failed." | Vapi needs a numeric IPv4 address on an inbound gateway. Use 43.204.9.41 as the gateway IP, not a hostname. |
| Outbound call fails with 401 or 403 | Check the trunk username and password under Authentication (outboundAuthenticationPlan). |
| Outbound call is rejected for its number format | Set outboundLeadingPlusEnabled to false and dial 91XXXXXXXXXX. |
Vapi rejects customer.number | Set customer.numberE164CheckEnabled to false, or dial +91XXXXXXXXXX. |
| Inbound call gets 401 or isn't answered | Make sure the Vonyx gateway has Allow inbound calls on, the inbound address uses the right credential ID, and an assistant is set under Inbound Settings. |
| Call connects but there's no audio | Vapi sends media on UDP ports 40000–60000 from changing IPs in the US region; make sure nothing on your side blocks RTP. See SIP connection details. |