ithaka
03/25/2025, 10:31 PMVapi Support Bot
03/25/2025, 10:33 PMtransferCall
function to redirect the call to your external voicemail
- You'll need to specify the destination phone number for your external voicemail
3. Handle potential call status issues
- [Some sources mention](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1342459464346767492) that you may need to use a conference call method when transferring from Twilio to Vapi due to call status differences
For the Vapi side of things, you can use the transferCall
function as shown in this example:
```
curl -X POST https://custom-llm-url/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-3.5-turbo",
"messages": [
{"role": "user", "content": "Please transfer my call."}
],
"temperature": 0.7,
"tools": [
{
"type": "function",
"function": {
"name": "transferCall",
"description": "Transfer call to a specified destination",
"parameters": {}
}
}Vapi Support Bot
03/25/2025, 10:33 PMithaka
03/25/2025, 10:34 PMithaka
03/26/2025, 5:40 PMShubham Bajaj
03/26/2025, 11:47 PMjavascript
// Assistant configuration
{
// Other assistant config...
keypadInputPlan: {
enabled: true,
timeoutSeconds: 0, // Process each key press immediately
delimiters: [] // No delimiters needed for single key detection
}
}
Step 2: Add a transferCall Tool to Your Assistant
Add a transferCall
tool to your assistant that includes the external voicemail number as a destination:
javascript
// Assistant configuration with transferCall tool
{
// Other assistant config...
model: {
// Other model config...
tools: [
{
type: "transferCall",
destinations: [
{
type: "number",
number: "+1234567890", // Replace with your voicemail number
message: "Transferring you to voicemail now..."
}
]
}
]
}
}
Step 3: Add Logic to Handle DTMF "0" Input
In your assistant's prompt/system message, include instructions to transfer the call when "0" is pressed:
System: You are a helpful voice assistant. When a user presses 0 on their keypad, immediately transfer the call to voicemail.
If you detect that a user has pressed the 0 key (which will appear in the conversation as "User's Keypad Entry: 0"), use the transferCall tool to transfer them to the voicemail number without asking for confirmation.
Step 4: Testing Your Implementation
Once configured, test your setup by calling your Vapi number and pressing "0" during the conversation. The assistant should detect the keypress and automatically transfer the call to your configured voicemail number.ithaka
03/27/2025, 3:56 AMShubham Bajaj
03/29/2025, 11:54 AMithaka
03/29/2025, 6:40 PM