Telnyx SIP Integration
How to integrate SIP Telnyx to Vapi
Integrate your Telnyx SIP trunk with Vapi.ai to enable your AI voice assistants to handle calls efficiently. This guide walks you through the complete setup process for both inbound and outbound calls.
1. Retrieve Your Vapi.ai Private Key
- Log in to your Vapi.ai account
- Navigate to Organization Settings
- In the API Keys section, copy your Private Key
2. Configure Telnyx for Inbound Calls
To allow Telnyx to forward incoming calls to Vapi.ai:
-
Create a SIP Trunk
- Go to Voice / SIP Trunking / Create
- Select FQDN
- Click “Add FQDN”
- Select A record type
- Set FQDN to:
sip.vapi.ai
- Port should be 5060 by default
-
Configure Inbound Settings
- Navigate to the Inbound tab of your SIP trunk
- Configure settings as shown:
-
Assign Phone Number
- Go to the Numbers tab
- Assign your acquired phone number to the SIP trunk
-
Configure SIP Invite
- Go to Numbers, edit the number you’ll be using
- Navigate to Voice settings
- Scroll down to find “Translated Number”
- Set this value to match your Vapi SIP URI
This setting modifies the SIP Invite to the Vapi platform so invites are correctly routed to your Vapi SIP URI.
3. Configure Telnyx for Outbound Calls
To allow Vapi.ai to make outbound calls through your Telnyx account:
-
Set Up Outbound Authentication
- Go to Voice / SIP Trunking / Authentication and routing
- Scroll down to “Outbound calls authentication”
- Whitelist Vapi’s SIP server IPs:
- 44.229.228.186
- 44.238.177.138
- Select Tech Prefix and create a new credential for Vapi to use
-
Create Outbound Voice Profile
- Go to Voice / Outbound Voice Profiles
- Create a new profile
- Name it appropriately
- Configure desired destinations
- Leave default configuration settings
- Assign your SIP trunk
- Complete setup
Alternatively, go to your SIP trunk / Outbound tab and select your newly created outbound voice profile.
-
Configure Outbound Settings
- Choose the country you’ll be making most calls to
We recommend creating a separate SIP Trunk for each country you aim to be making most calls to.
4. Add Your Telnyx SIP Credentials to Vapi.ai
Use the Vapi API to create a SIP trunk credential:
Replace YOUR_VAPI_PRIVATE_KEY
, YOUR_SIP_USERNAME
, and YOUR_SIP_PASSWORD
with your actual credentials.
If successful, the response will include an id
for the created credential, which you’ll use in the next step.
5. Add Your Phone Number to Vapi.ai
Associate your phone number with the SIP trunk in Vapi.ai:
Replace YOUR_VAPI_PRIVATE_KEY
, YOUR_PHONE_NUMBER
, and YOUR_CREDENTIAL_ID
with your actual details.
6. Assign Your Voice Assistant to Handle Calls
- In your Vapi.ai dashboard, go to the Build section and select Phone Numbers
- Click on your Telnyx Number
- In the Inbound Settings section, assign your voice assistant to handle incoming calls
- In the Outbound Form section, assign your voice assistant to handle outgoing calls
7. Make Outbound Calls
To initiate outbound calls through your Telnyx SIP trunk:
Replace all placeholder values with your actual information.
By following these steps, your Telnyx SIP trunk will be fully integrated with Vapi.ai, allowing your AI voice assistants to manage calls effectively.