Skip to content

Commit f084b2a

Browse files
Merge remote-tracking branch 'origin/main' into bryant/remove-advanced-functionality-not-supported-from-realtime-docs
2 parents c2b4d28 + 26cb2bf commit f084b2a

26 files changed

+1094
-46
lines changed

fern/advanced/sip/sip-telynx.mdx

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
---
2+
title: Telynx SIP Integration
3+
subtitle: How to integrate SIP Telnyx to Vapi
4+
slug: advanced/sip/telynx
5+
---
6+
## Inbound
7+
### On Vapi
8+
<Steps>
9+
<Step title="Personalized origination SIP URI creation">
10+
11+
First we will create a personalized origination SIP URI via the Vapi API
12+
13+
```json
14+
curl --location 'https://api.vapi.ai/phone-number' \
15+
--header 'Authorization: Bearer your-vapi-private-api-key' \
16+
--header 'Content-Type: application/json' \
17+
--data-raw '{
18+
"provider": "vapi",
19+
"sipUri": "sip:[email protected]",
20+
"assistantId": "your-assistant-id"
21+
}'
22+
```
23+
- ```provider```: This is set to "vapi".
24+
- ```sipUri```: Replace ` username ` with your desired SIP username.
25+
- ```assistantId```: Provide your specific `assistant ID` associated with your Vapi AI account.
26+
</Step>
27+
28+
<Step title="[Optional] Send call request to a webhook instead of assistant">
29+
30+
Send a PATCH to /phone-number/your_phone_id
31+
32+
```json
33+
curl --location --request PATCH 'https://api.vapi.ai/phone-number/your_phone_id' \
34+
--header 'Content-Type: application/json' \
35+
--header 'Authorization: Bearer your-vapi-private-api-key' \
36+
--data '{
37+
"assistantId": null,
38+
"serverUrl": "https://your_server_url"
39+
}'
40+
```
41+
- `your_server_url` is the webhook link that will receive the assistant request.
42+
- `your_phone_id` is the id of your just created origination sip URI
43+
44+
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.
45+
</Step>
46+
</Steps>
47+
48+
### On Telynx
49+
<Steps>
50+
<Step title="Setup inbound authentication">
51+
1. Go to Voice / SIP Trunking / Create
52+
2. Select FQDN
53+
3. Select add FQDN
54+
4. Select A
55+
5. Add created SIP URI
56+
6. FQDN: sip.vapi.ai
57+
7. Port should be 5060 by default
58+
</Step>
59+
<Step title="Go to Inbound tab">
60+
Set as follows:
61+
<Frame>
62+
<img src="../../static/images/sip/telynx-inbound.png" />
63+
</Frame>
64+
</Step>
65+
<Step title="Assign your acquired phone number to SIP trunking">
66+
Go to numbers tab, assign number
67+
</Step>
68+
<Step title="Modify SIP invite">
69+
Modify SIP invite so your VAPI and Telnyx accounts will be matched correctly
70+
1. Go to numbers, edit the one your will be using
71+
2. Navigate do voice
72+
3. Scroll down till the end to find Translated Number
73+
74+
*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.*
75+
76+
4. If your chosen sipURI from previous step is [email protected] , this should be username
77+
5. Done! You should now be receiving calls!
78+
</Step>
79+
</Steps>
80+
81+
## Outbound
82+
### On Telynx
83+
<Steps>
84+
<Step title="Set outbound authentication method">
85+
1. Go to Voice / Sip Trunking / Authentication and routing
86+
2. Scroll down to outbound calls authentication and:
87+
- 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)
88+
<Frame>
89+
<img src="../../static/images/sip/telynx-outbound-auth.png" />
90+
</Frame>
91+
</Step>
92+
<Step title="Create outbound voice profiles">
93+
1. Go to voice / outbound voice profiles
94+
2. Create profile
95+
3. Name it as you will (1. details)
96+
4. Allow as desired destination (2. destinations)
97+
5. Leave the next screen as is (3. configuration)
98+
6. Assign the desired sip trunk (4. …)
99+
7. Complete
100+
101+
Or you an just go to sip trunk / you sip trunk / outbound / and select your just created outbound voice profile.
102+
</Step>
103+
<Step title="Go to Outbound tab to select the country you'll be calling the most">
104+
Set as follows, choosing the country that you will be making most calls to (example Brazil)
105+
106+
*We recommend creating a separate SIP Trunk for each country you aim to be making most calls to.*
107+
<Frame>
108+
<img src="../../static/images/sip/telynx-outbound-settings.png" />
109+
</Frame>
110+
</Step>
111+
</Steps>
112+
### On Vapi
113+
<Steps>
114+
<Step title="Create a SIP Trunk Credential through Vapi API">
115+
```json
116+
curl -X POST https://api.vapi.ai/credential \
117+
-H "Content-Type: application/json" \
118+
-H "Authorization: Bearer your-vapi-private-api-key" \
119+
-d '{
120+
"provider": "byo-sip-trunk",
121+
"name": "Telnyx Trunk",
122+
"gateways": [
123+
{
124+
"ip": "sip.telnyx.com"
125+
}
126+
]
127+
}'
128+
```
129+
</Step>
130+
<Step title="Create a Phone Number Associated with the SIP Trunk">
131+
```json
132+
curl -X POST https://api.vapi.ai/phone-number \
133+
-H "Content-Type: application/json" \
134+
-H "Authorization: Bearer your-vapi-private-api-key" \
135+
-d '{
136+
"provider": "byo-phone-number",
137+
"name": "Telnyx SIP Number",
138+
"number": "your-sip-phone-number",
139+
"numberE164CheckEnabled": false,
140+
"credentialId": "your-new-trunk-credential-id-which-you-got-from-previous-step"
141+
}'
142+
```
143+
</Step>
144+
<Step title="Start making outbound calls">
145+
Use this cURL to trigger calls with tech prefix
146+
```json
147+
curl --location 'https://api.vapi.ai/call/phone' \
148+
--header 'Authorization: Bearer your-vapi-private-api-key' \
149+
--header 'Content-Type: application/json' \
150+
--data '{
151+
"assistantId": "your-assistant-id",
152+
"customer": {
153+
"number": "tech-prefix-with-phone-number-without-plus-signal",
154+
"numberE164CheckEnabled": false
155+
},
156+
"phoneNumberId": "your-phone-id"
157+
}'
158+
```
159+
Example of tech-prefix-with-phone-number-without-plus-signal
160+
- Phone number: +6699999999
161+
- Tech Prefix: 1234
162+
- Should look like this: 12346699999999
163+
- No + as you can see
164+
165+
Done! Outbound should now be working!
166+
</Step>
167+
</Steps>

fern/advanced/calls/sip.mdx renamed to fern/advanced/sip/sip.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: SIP
2+
title: SIP Introduction
33
subtitle: You can make SIP calls to Vapi Assistants.
4-
slug: advanced/calls/sip
4+
slug: advanced/sip
55
---
66

77
<Steps>

fern/apis/api/generators.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ groups:
1010
python-sdk:
1111
generators:
1212
- name: fernapi/fern-python-sdk
13-
version: 4.3.8
13+
version: 4.3.9
1414
disable-examples: true
1515
api:
1616
settings:
@@ -47,7 +47,7 @@ groups:
4747
java-sdk:
4848
generators:
4949
- name: fernapi/fern-java-sdk
50-
version: 2.2.0
50+
version: 2.3.1
5151
output:
5252
location: maven
5353
coordinate: dev.vapi:server-sdk

0 commit comments

Comments
 (0)