transfer call via DTMF
# support
i
What is the easiest way to set it up so if a user hits "0" Vapi will transfer the call to an external voicemail?
v
Hi there! 👋 I found that Vapi cannot directly handle DTMF tones (like pressing "0"), but I can help explain how to set up this functionality using an external solution. According to the [information I found](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1341108728115757138), Vapi cannot directly receive DTMF tones. The easiest way to implement this functionality is to: 1. Use Twilio Flex or TWIML to handle the DTMF input first - Twilio can be configured to detect when a caller presses "0" - [Documentation indicates](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1342504647520157788) that "the best thing to do is to first send or accept those key presses using another solution like Twilio Flex. Then, you can transfer the call to Vapi." 2. Configure call transfer to external voicemail - Once Twilio detects the "0" input, you can use Vapi's
transferCall
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": {} } }
], "destination": "555-1234" }' ``` Is there anything specific about this setup you'd like me to explain further? Sources: - [Discord Thread on DTMF in Vapi](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1341108728115757138) - [Discord Thread on Call Transfer via DTMF](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1342504647520157788) - [Discord Thread on Call Status Issues](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1342459464346767492) - [Vapi Documentation on transferCall Function](https://docs.vapi.ai/documentation/advanced-concepts/customization/custom-llm/custom-llm-tool-calling-integration)
i
I'm clicking on "Discord Thread on Call Transfer via DTMF" and I'm trying to do it through the GUI, I've created a function in the GUI to transfer call but don't see option to have DTMF be the trigger
Anyone have anything here?
s
@ithaka Here's a step-by-step guide: Step 1: Configure DTMF Input Detection First, you need to enable keypad input processing in your Vapi assistant. This ensures that when a user presses "0", Vapi can detect it and take action. In your assistant configuration, enable the keypad input plan:
Copy code
javascript
// 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:
Copy code
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:
Copy code
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.
i
thank you!
s
Marking this ticket as Solved ✅
i
Thank you
2 Views