how to connect vapi to Telnyx sip trunk?
# support
t
how to connect vapi to Telnyx sip trunk?
v
Hi there! 👋 I'd be happy to help you connect Vapi to a Telnyx SIP trunk. I can provide you with the complete process for setting up this connection, including both the Vapi and Telnyx sides of the configuration. ## Initial Setup Information First, here are the key parameters you'll need: - Gateway IP:
sip.telnyx.com
- FQDN:
sip.vapi.ai
- Port:
5060
## Configuration Steps ### 1. Outbound Configuration (Telnyx Side) According to the [Vapi SIP Trunking Setup guide](https://docs.vapi.ai/advanced/sip/telnyx), you'll need to: 1. Go to Voice / Sip Trunking / Authentication and routing 2. Scroll down to outbound calls authentication and: - Add the two fixed IPs from VAPI - Select Tech Prefix and create a unique 4-digit Tech Prefix (must be unique to your account) 3. Create outbound voice profiles: - Go to voice / outbound voice profiles - Create profile - Name it as desired - Allow desired destinations - Assign the desired SIP trunk 4. Go to the Outbound tab to select the country you'll be calling the most - It's recommended to create a separate SIP Trunk for each country you aim to make most calls to ### 2. Outbound Configuration (Vapi Side) 1. Create a SIP Trunk Credential through the Vapi API:
Copy code
curl -X POST https://api.vapi.ai/credential \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer your-vapi-private-api-key" \
  -d '{
  "provider": "byo-sip-trunk",
  "name": "Telnyx Trunk",
  "gateways": [
  {
  "ip": "sip.telnyx.com"
  }
  ]
  }'
2. Create a Phone Number Associated with the SIP Trunk:
Copy code
curl -X POST https://api.vapi.ai/phone-number \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer your-vapi-private-api-key" \
  -d '{
  "provider": "byo-phone-number",
  "name": "Telnyx SIP Number",
  "number": "your-sip-phone-number",
  "numberE164CheckEnabled": false,
  "credentialId": "your-new-trunk-credential-id-which-you-got-from-previous-step"
  }'
### 3. Inbound Configuration (Vapi Side) Create a personalized origination SIP URI:
Copy code
curl --location 'https://api.vapi.ai/phone-number' \
  --header 'Authorization: Bearer your-vapi-private-api-key' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "provider": "vapi",
  "sipUri": "sip:username@sip.vapi.ai",
  "assistantId": "your-assistant-id"
  }'
### 4. Inbound Configuration (Telnyx Side) 1. 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 2. Go to Inbound tab to set configurations 3. Assign your acquired phone number to SIP trunking 4. Modify SIP invite: - Go to numbers, edit the one you will be using - Navigate to voice - Scroll down to find Translated Number - If your chosen sipURI is username@sip.vapi.ai, this should be username For more detailed instructions, you can refer to the [Vapi SIP Trunking Setup guide](https://docs.vapi.ai/advanced/sip/telnyx) and the [Vapi SIP URI Configuration guide](https://docs.vapi.ai/advanced/sip/telnyx#personalized-origination-sip-uri-creation). Is there anything specific about this setup process you'd like me to explain in more detail? Sources: - [Vapi SIP Trunking Setup guide](https://docs.vapi.ai/advanced/sip/telnyx) - [Vapi SIP URI Configuration guide](https://docs.vapi.ai/advanced/sip/telnyx#personalized-origination-sip-uri-creation)
t
is there a video
?
where can i find Vapi SIP URI
k
Hey, you can directly import Telenyx numbers using the dashboard. Simply visit the dashboard page and go to the phone numbers page by navigating on the left side of the dashboard. After clicking on 'Import a Number', you will get a section to import Telenyx numbers just by inputting your API key.
4 Views