Skip to content

Commit c60bba2

Browse files
authored
VAP-3931 Added more transferPlan details and along with twiml notes (#240)
* VAP-3931 Added more transferPlan details and along with twiml notes * add more docs
1 parent 7d35300 commit c60bba2

File tree

1 file changed

+91
-31
lines changed

1 file changed

+91
-31
lines changed

fern/call-forwarding.mdx

Lines changed: 91 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ title: Call Forwarding
33
slug: call-forwarding
44
---
55

6-
76
Vapi's call forwarding functionality allows you to redirect calls to different phone numbers based on specific conditions using tools. This guide explains how to set up and use the `transferCall` function for call forwarding.
87

98
## Key Concepts
@@ -53,17 +52,11 @@ The `transferCall` tool includes a list of destinations and corresponding messag
5352
"properties": {
5453
"destination": {
5554
"type": "string",
56-
"enum": [
57-
"+1234567890",
58-
"+0987654321",
59-
"+1122334455"
60-
],
55+
"enum": ["+1234567890", "+0987654321", "+1122334455"],
6156
"description": "The destination to transfer the call to."
6257
}
6358
},
64-
"required": [
65-
"destination"
66-
]
59+
"required": ["destination"]
6760
}
6861
},
6962
"messages": [
@@ -106,6 +99,19 @@ The `transferCall` tool includes a list of destinations and corresponding messag
10699
}
107100
```
108101

102+
You can also specify the `extension` parameter to forward the call to an extension.
103+
104+
```json
105+
"destinations": [
106+
{
107+
"type": "number",
108+
"number": "+1234567890",
109+
"extension": "4603",
110+
"message": "I am forwarding your call to Department A. Please stay on the line."
111+
}
112+
]
113+
```
114+
109115
### 2. Using the `transferCall` Function
110116

111117
When the assistant needs to forward a call, it uses the `transferCall` function with the appropriate destination:
@@ -119,7 +125,6 @@ When the assistant needs to forward a call, it uses the `transferCall` function
119125
}
120126
}
121127
}
122-
123128
```
124129

125130
### 3. Customizing Messages
@@ -142,7 +147,6 @@ Customize the messages for each destination to provide clear information to the
142147
}
143148
]
144149
}
145-
146150
```
147151

148152
## Instructing the Assistant
@@ -176,12 +180,13 @@ To implement a warm transfer, add a `transferPlan` object to the `transferCall`
176180

177181
In this mode, Vapi provides a summary of the call to the recipient before transferring.
178182

179-
* **Configuration:**
180-
* Set the `mode` to `"warm-transfer-with-summary"`.
181-
* Define a `summaryPlan` specifying how the summary should be generated.
182-
* Use the `{{transcript}}` variable to include the call transcript.
183+
- **Configuration:**
184+
185+
- Set the `mode` to `"warm-transfer-with-summary"`.
186+
- Define a `summaryPlan` specifying how the summary should be generated.
187+
- Use the `{{transcript}}` variable to include the call transcript.
183188

184-
* **Example:**
189+
- **Example:**
185190

186191
```json
187192
"transferPlan": {
@@ -204,14 +209,15 @@ In this mode, Vapi provides a summary of the call to the recipient before transf
204209

205210
#### 2. Warm Transfer with Message
206211

207-
In this mode, Vapi delivers a custom static message to the recipient before transferring the call.
212+
In this mode, Vapi delivers a custom message to the recipient before transferring the call.
213+
214+
- **Configuration:**
208215

209-
* **Configuration:**
210-
* Set the `mode` to `"warm-transfer-with-message"`.
211-
* Provide the custom message in the `message` property.
212-
* Note that the `{{transcript}}` variable is not available in this mode.
216+
- Set the `mode` to `"warm-transfer-with-message"`.
217+
- Provide the custom message in the `message` property.
218+
- Note that the `{{transcript}}` variable is not available in this mode.
213219

214-
* **Example:**
220+
- **Example:**
215221

216222
```json
217223
"transferPlan": {
@@ -259,17 +265,69 @@ Here is a full example of a `transferCall` payload using the warm transfer with
259265
}
260266
```
261267

262-
#### 3. Warm Transfer with TwiML
268+
#### 3. Warm Transfer with Wait and Say Message
269+
270+
In this mode, Vapi waits for the recipient to speak first and then delivers a custom message to the recipient before transferring the call.
271+
272+
- **Configuration:**
273+
274+
- Set the `mode` to `"warm-transfer-wait-for-operator-to-speak-first-and-then-say-message"`.
275+
- Provide the custom message in the `message` property.
276+
- Note that the `{{transcript}}` variable is not available in this mode.
277+
278+
- **Example:**
279+
280+
```json
281+
"transferPlan": {
282+
"mode": "warm-transfer-wait-for-operator-to-speak-first-and-then-say-message",
283+
"message": "Hey, this call has been forwarded through Vapi."
284+
}
285+
```
286+
287+
#### 4. Warm Transfer with Wait and Say Summary
288+
289+
In this mode, Vapi waits for the recipient to speak first and then delivers a summary of the call to the recipient before transferring the call.
290+
291+
- **Configuration:**
292+
293+
- Set the `mode` to `"warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary"`.
294+
- Define a `summaryPlan` specifying how the summary should be generated.
295+
- Use the `{{transcript}}` variable to include the call transcript.
296+
297+
- **Example:**
298+
299+
```json
300+
"transferPlan": {
301+
"mode": "warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary",
302+
"summaryPlan": {
303+
"enabled": true,
304+
"messages": [
305+
{
306+
"role": "system",
307+
"content": "Please provide a summary of the call."
308+
},
309+
{
310+
"role": "user",
311+
"content": "Here is the transcript:\n\n{{transcript}}\n\n"
312+
}
313+
]
314+
}
315+
}
316+
```
317+
318+
#### 5. Warm Transfer with TwiML
263319

264320
In this mode, Vapi executes TwiML instructions on the destination call leg before connecting the destination number.
265321

266-
* **Configuration:**
267-
* Set the `mode` to `"warm-transfer-with-twiml"`.
268-
* Provide the TwiML instructions in the `twiml` property.
269-
* Supports only `Play`, `Say`, `Gather`, `Hangup`, and `Pause` verbs.
270-
* Maximum TwiML length is 4096 characters.
322+
- **Configuration:**
271323

272-
* **Example:**
324+
- Set the `mode` to `"warm-transfer-with-twiml"`.
325+
- Provide the TwiML instructions in the `twiml` property.
326+
- Supports only `Play`, `Say`, `Gather`, and `Pause` verbs.
327+
- Maximum TwiML length is 4096 characters.
328+
- TwiML must be provided as a single-line string without line breaks or tabs, and must be a valid XML string. For example: `<Say>Hello</Say>` is valid, but `<Say>Hello\n</Say>` is not.
329+
330+
- **Example:**
273331

274332
```json
275333
"transferPlan": {
@@ -278,7 +336,6 @@ In this mode, Vapi executes TwiML instructions on the destination call leg befor
278336
}
279337
```
280338

281-
282339
Here is a full example of a `transferCall` payload using the warm transfer with TwiML mode:
283340

284341
```json
@@ -305,4 +362,7 @@ Here is a full example of a `transferCall` payload using the warm transfer with
305362
}
306363
```
307364

308-
**Note:** In all warm transfer modes, the `{{transcript}}` variable contains the full transcript of the call and can be used within the `summaryPlan`.
365+
**Notes:**
366+
367+
- In all warm transfer modes, the `{{transcript}}` variable contains the full transcript of the call and can be used within the `summaryPlan`.
368+
- For more details about transfer plans and configuration options, please refer to the [transferCall API documentation](https://docs.vapi.ai/api-reference/tools/create#request.body.transferCall.destinations.number.transferPlan)

0 commit comments

Comments
 (0)