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.
transferCall Tool: This tool enables call forwarding to predefined phone numbers with specific messages based on the destination.Looking for dynamic routing decided at runtime? Use a transferCall tool with an empty destinations array and either:
phoneNumber) directly; no webhook is sent.transfer-destination-request webhook with a destination.
See: Dynamic call transfers.The recommended approach is to create your transfer call tool in the Vapi dashboard:
+1234567890 with message “I am forwarding your call to Department A. Please stay on the line.”+0987654321 with message “I am forwarding your call to Department B. Please stay on the line.”+1122334455 with message “I am forwarding your call to Department C. Please stay on the line.”You can also define the tool via API with destinations and corresponding messages:
You can also specify the extension parameter to forward the call to an extension.
transferCall FunctionWhen the assistant needs to forward a call, it uses the transferCall function with the appropriate destination:
Customize the messages for each destination to provide clear information to the caller:
Use the system prompt to guide the assistant on when to utilize each forwarding number. For example:
transferCall function with +1234567890.”transferCall function with +0987654321.”Vapi supports two types of call transfers:
To implement a warm transfer, add a transferPlan object to the transferCall tool syntax and specify the transfer mode.
In this mode, Vapi provides a summary of the call to the recipient before transferring.
Configuration:
mode to "warm-transfer-with-summary".summaryPlan specifying how the summary should be generated.{{transcript}} variable to include the call transcript.Example:
In this mode, Vapi delivers a custom message to the recipient before transferring the call.
Configuration:
mode to "warm-transfer-with-message".message property.{{transcript}} variable is not available in this mode.Example:
Here is a full example of a transferCall payload using the warm transfer with summary mode:
In this mode, Vapi waits for the recipient to speak first and then delivers a custom message to the recipient before transferring the call.
Configuration:
mode to "warm-transfer-wait-for-operator-to-speak-first-and-then-say-message".message property.{{transcript}} variable is not available in this mode.Example:
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.
Configuration:
mode to "warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary".summaryPlan specifying how the summary should be generated.{{transcript}} variable to include the call transcript.Example:
In this mode, Vapi executes TwiML instructions on the destination call leg before connecting the destination number.
Configuration:
mode to "warm-transfer-with-twiml".twiml property.Play, Say, Gather, and Pause verbs.<Say>Hello</Say> is valid, but <Say>Hello\n</Say> is not.Example:
Here is a full example of a transferCall payload using the warm transfer with TwiML mode:
In this mode, Vapi dials the destination number and places the caller on hold (with a default ringtone). If the destination answers, Vapi connects the calls. If voicemail is detected or the call isn’t answered, Vapi plays a fallback message to the caller.
Configuration:
mode to "warm-transfer-experimental".message to be spoken to the operator when they answer.summaryPlan that will take precedence over the message if enabled.fallbackPlan with a message and whether to end the call if transfer fails.holdAudioUrl to play custom hold music to the customer during the transfer.voicemailDetectionType to customize how human voice detection is performed (only applies when the provider is Google or OpenAI):
"audio" (default): Supports a wide range of machine detection including beep detection and other audio cues"transcript": Uses transcript-based detection with the lowest latency and faster transfer processing timesExample:
"transcript" for the fastest transfer processing. For wider machine detection capabilities, use "audio" instead.Here is a full example of a transferCall payload using the experimental warm transfer mode:
"audio" for comprehensive machine detection including beep detection. This is the default option if not specified.For use cases requiring AI-managed transfers, Vapi supports using assistants to handle the transfer process. This allows the assistant to converse with operators and make transfer decisions based on your configuration.
Notes:
{{transcript}} variable contains the full transcript of the call and can be used within the summaryPlan.holdAudioUrl property (available only in warm-transfer-experimental mode) allows you to specify a custom MP3 file URL that will be played to the customer while they are on hold during the transfer. If not provided, the default hold audio will be used.voicemailDetectionType parameter allows you to optimize the detection method based on your needs:
"transcript" for the fastest transfer processing with lowest latency"audio" (default) for comprehensive machine detection including beep detection and other audio cues