really cool n based
03/10/2025, 1:09 PMShubham Bajaj
03/11/2025, 2:26 PMkeypadInputPlan
configuration in your assistant.
2. **Webhook for each digit press**: Currently, VAPI doesn't have a built-in webhook that triggers immediately when a single digit is pressed. Instead, DTMF digits are collected according to your keypadInputPlan
configuration and then added to the conversation as a user message.
3. **How DTMF handling works**:
- When a user presses a digit, it's added to a buffer
- The digits are processed based on:
- Timeout: After a configurable number of seconds (default 2)
- Delimiters: When the user presses a configured delimiter (default # or *)
- Once processed, the digits are added to the conversation as a message: "User's Keypad Entry: [digits]"
Use the built-in keypadInputPlan with regular function tools
json
"keypadInputPlan": {
"enabled": true,
"timeoutSeconds": 2, // Can be 0-10 seconds, or omitted for default
"delimiters": ["#", "*"] // Can customize or use empty array
}
With this configuration, when users press digits:
1. The digits are collected
2. After triggering conditions are met (timeout or delimiter), they're added to conversation
3. Your assistant can use those digits and send them via a function tool webhook
## Recommended Implementation
1. **Enable keypadInputPlan in your assistant configuration**:
json
"keypadInputPlan": {
"enabled": true,
"timeoutSeconds": 2,
"delimiters": ["#"]
}
2. **Create a function tool to receive digits**:
- Set up a webhook URL that will receive the collected digits
- Create a function tool with appropriate parameters for your digit collection needs
- Configure your assistant to use this tool after collecting digits
3. Program your assistant to:
- Ask the user to input digits
- Wait for digits to be collected via the keypadInputPlan
- Pass those digits to your function tool which will send them to your webhook
This approach leverages VAPI's built-in DTMF handling while giving you a way to send the collected digits to your webhook.
Let me know if you need further assistance implementing this solution for your specific use case!