SIP Trunking Guide for Vapi
How to integrate your SIP provider with Vapi
SIP trunking replaces traditional phone lines with a virtual connection over the internet, allowing your business to make and receive calls via a broadband connection. It connects your internal PBX or VoIP system to a SIP provider, which then routes calls to the Public Switched Telephone Network (PSTN). This setup simplifies your communications infrastructure and often reduces costs.
1. Vapi SIP Trunking Options
Vapi supports multiple SIP trunk configurations, including:
- Telnyx: Uses SIP gateway domain (e.g., sip.telnyx.com) with IP-based authentication. May require a tech prefix for outbound calls.
- Zadarma: Uses SIP credentials (username/password) with its SIP server (e.g., sip.zadarma.com).
- Custom “BYO” SIP Trunk: Allows integration with any SIP provider. You simply provide the SIP gateway address and the necessary authentication details.
2. Setup Process Overview
To set up a SIP trunk in Vapi, follow these steps:
Obtain Provider Details
Gather the SIP server address, authentication credentials (username/password or IP-based), and at least one phone number (DID) from your provider.
Create a SIP Trunk Credential in Vapi
Use the Vapi API to create a new credential (type: byo-sip-trunk) with your provider’s details. This informs Vapi how to connect to your SIP network.
Example (using Zadarma):
Save the returned Credential ID for later use.
Associate a Phone Number with the SIP Trunk
Link your external phone number (DID) to the SIP trunk credential in Vapi by creating a Phone Number resource.
Example:
Note the returned Phone Number ID for use in test calls.
Test Your SIP Trunk
Outbound Call Test
Initiate a call through the Vapi dashboard or API to ensure outbound calls are properly routed.
API Example:
Inbound Call Test
If inbound routing is configured, call your phone number from an external line. Ensure your provider forwards calls to the correct SIP URI (e.g., {phoneNumber}@sip.vapi.ai
for Zadarma).