VonyxDocs

Vapi

Use a Vonyx SIP trunk and number as a bring-your-own SIP trunk for Vapi assistants.

View this page as Markdown

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.

FieldValue
Gateway IP43.204.9.41
Port5060
Netmask32
TransportUDP (Vonyx has no TLS)
Allow inbound callsOn (off if you only need outbound)
Allow outbound callsOn
Authentication usernameyour_trunk_username
Authentication passwordyour_trunk_password
SIP registrationOff
  1. Open the organization menu in the top left and choose Settings.
  2. Open Integrations and select SIP Trunk.
  3. Click Configure New SIP Trunk.
  4. Name the trunk (for example, Vonyx) and add a gateway with the values in the table above.
  5. Turn on Allow inbound calls and Allow outbound calls.
  6. Under Authentication, enter your Vonyx trunk username and password. Leave SIP registration off.
  7. 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.

  1. Go to Phone Numbers and click Create Phone Number.
  2. Select BYO SIP Trunk Number.
  3. Enter your Vonyx number as 91XXXXXXXXXX and turn on Allow non-E164 phone numbers.
  4. Select the Vonyx credential 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.

Start an outbound call
curl -X POST https://api.vapi.ai/call \
  -H "Authorization: Bearer YOUR_VAPI_PRIVATE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "assistantId": "YOUR_ASSISTANT_ID",
    "phoneNumberId": "YOUR_PHONE_NUMBER_ID",
    "customer": {
      "number": "91XXXXXXXXXX",
      "numberE164CheckEnabled": false
    }
  }'

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:

Inbound address
YOUR_CREDENTIAL_ID.sip.vapi.ai

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

  1. 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.
  2. Call your Vonyx number from another phone. The assistant you picked under Inbound Settings answers.
  3. 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 tls or tls/srtp.
  • Vonyx supports only the PCMU and PCMA codecs.

Troubleshooting

ProblemFix
"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 403Check the trunk username and password under Authentication (outboundAuthenticationPlan).
Outbound call is rejected for its number formatSet outboundLeadingPlusEnabled to false and dial 91XXXXXXXXXX.
Vapi rejects customer.numberSet customer.numberE164CheckEnabled to false, or dial +91XXXXXXXXXX.
Inbound call gets 401 or isn't answeredMake 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 audioVapi 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.

On this page