Receiving DTMF input from user
# support
d
Is VAPI capable of receiving DTMF input from the user? If so, could you please provide documentation or an example for this? I am looking to provide an option for the caller to either say their date of birth or enter it in MMDDYYYY format using their phone
v
@Dhina Yes, VAPI is indeed capable of receiving DTMF (Dual-Tone Multi-Frequency) input from the user. To collect DTMF input, you can use the
input
action within your VAPI NCCO (Nexmo Call Control Object). This action allows you to wait for input from the user and can be configured to capture both speech and DTMF tones. Here's a simple example of how you might set up an NCCO to collect a date of birth from a caller, either by saying it or by entering it using their phone's keypad:
Copy code
json
[
  {
    "action": "talk",
    "text": "Please enter or say your date of birth in month, day, year format."
  },
  {
    "action": "input",
    "type": ["dtmf", "speech"],
    "dtmf": {
      "maxDigits": 8,
      "timeOut": 10
    },
    "speech": {
      "endOnSilence": 1,
      "language": "en-US"
    },
    "eventUrl": ["https://your-webhook.url/events"]
  }
]
In this example, the
input
action is configured to accept both DTMF and speech. The
dtmf
object specifies that a maximum of 8 digits can be entered (for the MMDDYYYY format), and the
timeOut
parameter defines the maximum amount of time in seconds that the system will wait for the user to enter their DTMF input. The
speech
object includes parameters like
endOnSilence
to determine when to end the speech input and
language
to specify the language model to be used for speech recognition. When the user provides their input, an event is sent to the specified
eventUrl
containing the details of the input received. Your application can then process this input accordingly. For more detailed documentation and additional examples, please visit the official VAPI documentation on the Nexmo Developer Portal or reach out to support for further assistance.
You can continue this conversation by mentioning me in the message.
d
VAPI Support: Please help
s
Hey @Dhina 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. Do let me know if you have further questions or rquires help.
k
Wow you actually got a reply from the support team, well done!
s
Hey @kaza69 I reply everyone, no one is left out. Can you kindly tag me to your ticket.
14 Views