How can I use vapi.send to trigger dtmf keypad or ...
# support
a
v
To trigger a DTMF keypad using
vapi.send
, you can send a tool call with the DTMF function and a sequence of keys (including pauses for reliability). Here’s an example:
Copy code
js
vapi.send({
  type: "tool_call",
  tool: "dtmf",
  arguments: { keys: "1w2w3#" } // 'w' adds a 0.5s pause between digits
});
This will send the DTMF tones 1, 2, 3 with short pauses, as recommended for IVR navigation (according to the documentation I have found at https://docs.vapi.ai/ivr-navigation). Source: - [IVR Navigation](https://docs.vapi.ai/ivr-navigation)
a
curl -X POST 'https://aws-us-west-2-production1-phone-call-websocket.vapi.ai/7420f27a-30fd-4f49-a995-5549ae7cc00d/control' -H 'content-type: application/json' --data-raw '{ "type": "add-message", "message": { "role": "system", "content": "New message added to conversation" }, "triggerResponseEnabled": true }' how would we replace the above with the manual ivr triggger via the post trigger
i am trying to trigger an ivr tree
c
Hi Amulya Parmar, Use vapi.send with a tool_call payload. Examples: - DTMF (with 0.5s pauses using
w
):
Copy code
js
vapi.send({
  type: "tool_call",
  tool: "dtmf",
  arguments: { keys: "1w2w3#" }
});
- SMS:
Copy code
js
vapi.send({
  type: "tool_call",
  tool: "sms",
  arguments: {
    to: "+15551234567",
    body: "Your message here"
  }
});
If you need to call the Live Call Control controlUrl directly (like your curl), post to {controlUrl}/control with the same structure Vapi expects for tool calls; for DTMF use a tool_call body containing the dtmf tool and arguments (keys). See IVR Navigation for recommended pauses: https://docs.vapi.ai/ivr-navigation and DTMF tool docs: https://docs.vapi.ai/tools/default-tools