Additional Documentation for Twillio DTMF forwardi...
# support
k
Hi, we have a Twillio integration with VAPI and calls work perfectly. I however need DTMF, I have read all the posts I could find but still quite confused. Is there any guides or additional documentation regarding this? We are looking at Twilio -> TwiML -> VAPI, not sure if this is the right approach as I do not want different voices than my VAPI squad. Thank you in advance for the assistance.
v
@kaza69 Hello! I'm glad to hear that your Twilio integration with VAPI is working well for calls. For DTMF (Dual-Tone Multi-Frequency) integration, you're on the right track considering Twilio's TwiML for handling user input via phone keypresses. TwiML is Twilio's markup language that tells Twilio how to handle incoming calls and SMS messages. To integrate DTMF with VAPI while maintaining a consistent voice experience, you can use Twilio's
<Gather>
TwiML verb to collect input from a caller and then process that input within your VAPI application. Here's a basic outline of how you can approach this: 1. When a call is received, Twilio will make a request to your specified webhook URL. 2. Respond to this request with TwiML that uses the
<Gather>
verb to collect DTMF input. 3. Set the
action
attribute of
<Gather>
to the URL of your VAPI application where you want to process the input. 4. In your VAPI application, handle the input and respond with appropriate voice responses using the same voice as your VAPI squad. Here's an example of TwiML using the
<Gather>
verb:
Copy code
xml
<Response>
  <Gather action="https://your-vapi-application.com/process_input" method="POST" numDigits="1">
    <Say voice="alice">Please press 1 for sales, 2 for support.</Say>
  </Gather>
</Response>
In this example, when the caller presses a digit, Twilio will send a POST request to the
action
URL with the DTMF input. You can then process this input in your VAPI application. If you need more detailed guides or documentation, Twilio's official documentation is a great resource. You can find information about the
<Gather>
verb and handling DTMF inputs here: [Twilio Docs - Gather](https://www.twilio.com/docs/voice/twiml/gather) If you have any specific questions or need further assistance with the integration, please let me know, and I'll be happy to help!
You can continue this conversation by mentioning me in the message.
Got it. Tagging @User for additional help.
k
Problem is the "Say" parameter as that will not be the same as VAPI conversations. I would like VAPI to handle the prompting/conversation and ask for the DTMF.
Any feedback? Just asking for some documentation as my twilio DTMF is working fine, just seems VAPI can't accept DTMF.
@Shubham Bajaj
s
@kaza69 as of now sending DTMD tones using Vapi isn't reliable for few of the users but you can give a try. What you have to do is include the dtmf tool in your model tools and then using prompting send the DTMF tones or keypresses as required.
including tool within the assistant
{ tools: [{type: "dtmf"}] }
prompting
use the dtmf tool with Do let me know if you require further help.