Home · Guides · Connect Callivex to Vapi

Connect Callivex to Vapi

Run your Vapi voice agents on a Callivex SIP trunk: your own numbers in 96 countries, caller ID delivered as sent, every second billed as a second. Three API calls and one request to us.

What you need

  • A Callivex account with a SIP trunk set to username and password authentication. Vapi recommends this over IP authentication because its servers are shared between customers. Ask us and we switch your trunk over.
  • Your trunk details from the Connection page in your console at console.callivex.com: SIP server, username and password.
  • A Callivex phone number for the agent to call from and answer on.
  • Your Vapi private API key and an assistant you have already built.

1. Add Callivex as a SIP trunk in Vapi

Create a credential of type byo-sip-trunk. Use the SIP server, username and password from your Connection page.

curl -X POST https://api.vapi.ai/credential \
  -H "Authorization: Bearer YOUR_VAPI_PRIVATE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "byo-sip-trunk",
    "name": "Callivex",
    "gateways": [{ "ip": "YOUR_CALLIVEX_SIP_SERVER", "inboundEnabled": true }],
    "outboundLeadingPlusEnabled": true,
    "outboundAuthenticationPlan": {
      "authUsername": "YOUR_TRUNK_USERNAME",
      "authPassword": "YOUR_TRUNK_PASSWORD"
    }
  }'

Keep the id Vapi returns. This is your credential ID.

2. Add your Callivex number

Import the number as a byo-phone-number linked to the credential. Write the number in full international format, digits only.

curl -X POST https://api.vapi.ai/phone-number \
  -H "Authorization: Bearer YOUR_VAPI_PRIVATE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "byo-phone-number",
    "name": "Callivex UK line",
    "number": "442079460321",
    "numberE164CheckEnabled": false,
    "credentialId": "YOUR_CREDENTIAL_ID"
  }'

Keep the phone number id. In the Vapi dashboard, attach your assistant to this number so it answers inbound calls.

3. Send inbound calls to your agent

Tell us your credential ID and we point your Callivex number at Vapi. Calls are delivered to:

sip:442079460321@YOUR_CREDENTIAL_ID.sip.vapi.ai

Vapi only accepts calls from the gateways listed on the credential. If an inbound test returns 401, the gateway list is missing one of our signalling addresses; we send you the full list when we switch inbound on.

4. Make a test call

curl -X POST https://api.vapi.ai/call/phone \
  -H "Authorization: Bearer YOUR_VAPI_PRIVATE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "assistantId": "YOUR_ASSISTANT_ID",
    "phoneNumberId": "YOUR_PHONE_NUMBER_ID",
    "customer": { "number": "+447700900123" }
  }'

The call leaves through Callivex with your number as caller ID. When it ends, it appears in the call records in your console, rated to the second.

Settings that matter

  • Codec: G.711, A-law or µ-law.
  • Media: Vapi uses UDP ports 40000 to 60000 for audio. If a firewall of yours sits in the path, keep that range open.
  • Region: on Vapi's EU platform use api.eu.vapi.ai for the API calls and sip.eu.vapi.ai in the inbound address. Keep both in the same region.
  • Transfers: to let the agent hand a call to a person, use Vapi's transfer tool with a SIP destination. Ask us to enable SIP REFER on your trunk first.
  • Confirmations by SMS: send the booking, the code or the follow-up from the same Callivex account with the SMS API.

Common problems

  • Outbound calls fail at once: check the username and password on the credential match your Connection page exactly.
  • Inbound returns 401: a Callivex signalling address is missing from gateways.
  • Caller ID shows wrong: the number must be one on your Callivex account. We deliver it as sent.

Steps follow Vapi's own documentation for bring-your-own SIP trunks. If Vapi changes its API, their docs take precedence and we update this guide.

Put your agents on Callivex.

Tell us which markets your agents call and answer in. We set up the trunk and the numbers.

Talk to us