Skip to content

Commit e55be82

Browse files
committed
sip
1 parent ef6ad88 commit e55be82

File tree

3 files changed

+100
-5
lines changed

3 files changed

+100
-5
lines changed

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"cSpell.words": ["openapi", "vonage"]
3+
}

advanced/calls/sip.mdx

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
title: "SIP"
3+
sidebarTitle: "SIP"
4+
description: "You can make SIP calls to Vapi Assistants."
5+
---
6+
7+
<Accordion title="1. Create an Assistant.">
8+
9+
## 1. Create an Assistant
10+
11+
We'll create an assistant with `POST /assistant` endpoint. This is no different than creating an assistant for other transports.
12+
13+
```json
14+
{
15+
"name": "My SIP Assistant",
16+
"firstMessage": "Hello {{first_name}}, you've reached me over SIP. How can I help you today?"
17+
}
18+
19+
```
20+
21+
</Accordion>
22+
23+
<Accordion title="2. Create a SIP Phone Number.">
24+
25+
## 2. Create A SIP Phone Number
26+
27+
We'll create a SIP phone number with `POST /phone-number` endpoint.
28+
29+
```json
30+
{
31+
"provider": "vapi",
32+
"sipUri": "sip:your_unique_user_name@sip.vapi.ai",
33+
"assistantId": "your_assistant_id"
34+
}
35+
36+
```
37+
38+
`sipUri` is the SIP URI of the phone number. It must be in the format `sip:username@sip.vapi.ai`. You are free to choose any username you like.
39+
40+
</Accordion>
41+
42+
43+
44+
<Accordion title="3. Start a SIP call.">
45+
46+
## 3. Start a SIP call.
47+
48+
You can use any SIP softphone to test the Assistant. Examples include [Zoiper](https://www.zoiper.com/) or [Linphone](https://www.linphone.org/).
49+
50+
You just need to dial `sip:your_unique_user_name@sip.vapi.ai` and the Assistant will answer your call.
51+
52+
There is no authentication or SIP registration required.
53+
54+
</Accordion>
55+
56+
<Accordion title="4. Send SIP Headers to Fill Template Variables.">
57+
58+
## 4. Send SIP Headers to Fill Template Variables.
59+
60+
To fill your template variables, you can send custom SIP headers.
61+
62+
For example, to fill the `first_name` variable, you can send a SIP header `x-first_name: John`.
63+
64+
The header name is case insensitive. So, `X-First_Name`, `x-first_name`, and `X-FIRST_NAME` are all the same.
65+
66+
</Accordion>
67+
68+
<Accordion title="5. Use a Custom Assistant For Each Call.">
69+
70+
## 5. Use a Custom Assistant For Each Call.
71+
72+
You can use a custom assistant for SIP calls same as phone calls.
73+
74+
Set the `assistantId` to `null` and the `serverUrl` to the URL of your server which will respond to the `assistant-request`.
75+
76+
`PATCH /phone-number/:id`
77+
```json
78+
{
79+
"assistantId": null,
80+
"serverUrl": "https://your_server_url"
81+
}
82+
```
83+
84+
Now, every time you make a call to this phone number, the server will receive a `assistant-request` event.
85+
86+
</Accordion>
87+

mint.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,25 +197,30 @@
197197
},
198198
{
199199
"group": "Squads",
200-
"pages": ["squads","squads-example"]
200+
"pages": ["squads", "squads-example"]
201201
}
202202
]
203203
},
204204
{
205-
"group": "Learn",
205+
"group": "Advanced Concepts",
206206
"pages": [
207207
{
208208
"group": "Calls",
209-
"pages": ["call-forwarding", "calls/call-ended-reason"]
209+
"pages": [
210+
"call-forwarding",
211+
"calls/call-ended-reason",
212+
"advanced/calls/sip"
213+
]
210214
},
211215
"GHL",
212-
"tools-calling"
216+
"tools-calling",
217+
"prompting-guide"
213218
]
214219
},
215220

216221
{
217222
"group": "Glossary",
218-
"pages": ["prompting-guide", "glossary", "faq"]
223+
"pages": ["glossary", "faq"]
219224
},
220225
{
221226
"group": "Community",

0 commit comments

Comments
 (0)