Telnyx SIP Integration
How to integrate SIP Telnyx to Vapi
Inbound
On Vapi
Personalized origination SIP URI creation
First we will create a personalized origination SIP URI via the Vapi API
provider
: This is set to “vapi”.sipUri
: Replaceusername
with your desired SIP username.assistantId
: Provide your specificassistant ID
associated with your Vapi AI account.
[Optional] Send call request to a webhook instead of assistant
Send a PATCH to /phone-number/your_phone_id
your_server_url
is the webhook link that will receive the assistant request.your_phone_id
is the id of your just created origination sip URI
Now every time you make a call to this number (i.e. assigned numbers on SIP trunking to this origination URI), you’ll get a webhook event requesting an assistant.
On Telnyx
Setup inbound authentication
- Go to Voice / SIP Trunking / Create
- Select FQDN
- Select add FQDN
- Select A
- Add created SIP URI
- FQDN: sip.vapi.ai
- Port should be 5060 by default
Modify SIP invite
Modify SIP invite so your VAPI and Telnyx accounts will be matched correctly
- Go to numbers, edit the one your will be using
- Navigate do voice
- Scroll down till the end to find Translated Number
This setting will modify the SIP Invite to the vapi platform so invites are sent to your vapi sip URI. It will be whatever value you set when you created it.
- If your chosen sipURI from previous step is [email protected] , this should be username
- Done! You should now be receiving calls!
Outbound
On Telnyx
Set outbound authentication method
- Go to Voice / Sip Trunking / Authentication and routing
- Scroll down to outbound calls authentication and:
- Add the two fixed IPs from VAPI, select Tech Prefix and create a unique 4-digits Tech Prefix (example 1234 - don’t use 1234, must be unique to your account)
Create outbound voice profiles
- Go to voice / outbound voice profiles
- Create profile
- Name it as you will (1. details)
- Allow as desired destination (2. destinations)
- Leave the next screen as is (3. configuration)
- Assign the desired sip trunk (4. …)
- Complete
Or you an just go to sip trunk / you sip trunk / outbound / and select your just created outbound voice profile.