Receive DTMF Input
# support
w
Is it possible to receive dtmf/keypad inputs that the vapi assistant knows, so for example if the call receiver pressed 1 on their keypad, it does one thing, and if they press 2 on their keypad, it does something else. I want to do this via the api endpoints, not any of the sdks
@Vapi ^
v
@wavy Absolutely, VAPI does support DTMF (Dual-Tone Multi-Frequency) inputs, which are the sounds associated with keypad presses on a phone. You can set up your voice application to listen for these inputs during a call and perform different actions based on the digits received. To implement this, you would typically use a
gather
action in your call flow, which waits for the user to press a key on their phone's keypad. Once a key is pressed, the input is sent to your specified endpoint, and you can then handle the input accordingly. For example, if you have an endpoint set up to handle DTMF inputs, you might have logic like this: - If the user presses
1
, the application performs Action A. - If the user presses
2
, the application performs Action B. The specific implementation details would depend on the API's documentation and the capabilities of your endpoint. If you need more detailed instructions or assistance with setting up your endpoint to handle DTMF inputs, please let me know, and I can provide further guidance or direct you to the appropriate resources.
w
Yes please help me with setting up the endpoint
@Vapi
v
message has been deleted
@wavy Absolutely! VAPI does support receiving DTMF (Dual-Tone Multi-Frequency) inputs, which are the sounds generated when a caller presses the buttons on their phone's keypad. You can handle these inputs through the API by setting up a webhook to listen for the
input
event. When you receive an
input
event, it will contain the DTMF digits that the caller pressed. You can then use this information to trigger different actions or responses within your application logic. Here's a simplified example of how you might handle this in your server code:
Copy code
json
{
  "eventUrl": ["https://yourserver.com/webhooks/dtmf"],
  "actions": [
    {
      "action": "talk",
      "text": "Please press 1 or 2 on your keypad."
    },
    {
      "action": "input",
      "maxDigits": 1,
      "timeOut": 5,
      "submitOnHash": false
    }
  ]
}
And then on your server, you would have an endpoint
/webhooks/dtmf
that might look something like this:
Copy code
json
{
  "dtmf": "1 or 2"
}
Based on the
dtmf
value, you can then decide what action to take. If you need more specific guidance on setting up your server to handle these events or have any other questions, please let me know!
You can continue this conversation by mentioning me in the message.
s
@wavy Currently, we don't have a way to capture DTMF tone. Due, to which we can't do it on our end. You will need to find a way to do it.
w
Is it possible to implement it via twilio?
Into my vapi assistant’s functionality
s
@wavy you can try using twilio and live call features. Not sure about the exact steps to be followed, what's the plan in your mind?
w
Well I plan to have multiple things going on, but for this specifically (outbound calls) will be responses to customer queries to direct the customer to A or B via pressing 1 or 2 on their keypad upon being prompted to do so
directing them to the corresponding department
s
@wavy You have to check with twilio team, if you can hook into the key presses events to your server and later using live call feature update the assistant about it. Apart from this I don't see any alternative as of now.
w
Okay, thanks
10 Views