Call Forwarding
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.
Key Concepts
Call Forwarding Tools
transferCall
Tool: This tool enables call forwarding to predefined phone numbers with specific messages based on the destination.
Parameters and Messages
- Destinations: A list of phone numbers where the call can be forwarded.
- Messages: Custom messages that inform the caller about the call being forwarded.
Setting Up Call Forwarding
1. Defining Destinations and Messages
The transferCall
tool includes a list of destinations and corresponding messages to notify the caller:
2. Using the transferCall
Function
When the assistant needs to forward a call, it uses the transferCall
function with the appropriate destination:
3. Customizing Messages
Customize the messages for each destination to provide clear information to the caller:
Instructing the Assistant
Use the system prompt to guide the assistant on when to utilize each forwarding number. For example:
- “If the user asks for sales, call the
transferCall
function with+1234567890
." - "If the user requests technical support, use the
transferCall
function with+0987654321
.”
Troubleshooting
- If calls are not being transferred, check the logs for errors.
- Ensure that the correct destination numbers are used.
- Ensure you have written the function description properly to indicate where you want to forward the call
- Test the call forwarding setup thoroughly to confirm its functionality.
Call Transfers Mode
Vapi supports two types of call transfers:
- Blind Transfer (default): Directly transfers the call to another agent without providing any prior information to the recipient.
- Warm Transfer: Transfers the call to another agent after providing context about the call. The context can be either a full transcript or a summary, based on your configuration.
Warm Transfer
To implement a warm transfer, add a transferPlan
object to the transferCall
tool syntax and specify the transfer mode.
Modes of Warm Transfer
1. Warm Transfer with Summary
In this mode, Vapi provides a summary of the call to the recipient before transferring.
-
Configuration:
- Set the
mode
to"warm-transfer-with-summary"
. - Define a
summaryPlan
specifying how the summary should be generated. - Use the
{{transcript}}
variable to include the call transcript.
- Set the
-
Example:
2. Warm Transfer with Message
In this mode, Vapi delivers a custom static message to the recipient before transferring the call.
-
Configuration:
- Set the
mode
to"warm-transfer-with-message"
. - Provide the custom message in the
message
property. - Note that the
{{transcript}}
variable is not available in this mode.
- Set the
-
Example:
Complete Example
Here is a full example of a transferCall
payload using the warm transfer with summary mode:
Note: In all warm transfer modes, the {{transcript}}
variable contains the full transcript of the call and can be used within the summaryPlan
.