Skip to content

VAP-5857: add more context about dtmf tool #310

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 43 additions & 11 deletions fern/tools/default-tools.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ This function is provided when `endCall` is included in the assistant's list of
}
```

#### Dial Keypad (DTMF)
#### Send Text

This function is provided when `dtmf` is included in the assistant's list of available tools (see configuration options [here](/api-reference/assistants/create#request.body.model.openai.tools.dtmf)). The assistant will be able to enter digits on the keypad.
This function is provided when `sms` is included in the assistant's list of available tool (see configuration options [here](/api-reference/assistants/create#request.body.model.openai.tools.sms)). The assistant can use this function to send SMS messages using a configured Twilio account.

```json
{
Expand All @@ -74,21 +74,24 @@ This function is provided when `dtmf` is included in the assistant's list of ava
"messages": [
{
"role": "system",
"content": "You are an assistant at a law firm. When you hit a menu, use the dtmf function to enter the digits."
"content": "You are an assistant. When the user asks you to send a text message, use the sms function."
}
],
"tools": [
{
"type": "dtmf"
"type": "sms",
"metadata": {
"from": "+15551234567"
}
}
]
}
}
```

#### Send Text
#### Dial Keypad (DTMF)

This function is provided when `sms` is included in the assistants list of available tool (see configuration options [here](/api-reference/assistants/create#request.body.model.openai.tools.sms)). The assistant can use this function to send SMS messages using a configured Twilio account.
This function is provided when `dtmf` is included in the assistant's list of available tools (see configuration options [here](/api-reference/assistants/create#request.body.model.openai.tools.dtmf)). The assistant will be able to enter digits on the keypad.

```json
{
Expand All @@ -98,21 +101,50 @@ This function is provided when `sms` is included in the assistant’s list of av
"messages": [
{
"role": "system",
"content": "You are an assistant. When the user asks you to send a text message, use the sms function."
"content": "You are an assistant at a law firm. When you hit a menu, use the dtmf function to enter the digits."
}
],
"tools": [
{
"type": "sms",
"metadata": {
"from": "+15551234567"
}
"type": "dtmf"
}
]
}
}
```

There are three methods for sending DTMF in a phone call:

1. **In-band**: tones are transmitted as part of the regular audio stream. This is the simplest method, but it can suffer from quality issues if the audio stream is compressed or degraded.
2. **Out-of-band via RFC 2833**: tones are transmitted separately from the audio stream, within RTP (Real-Time Protocol) packets. It's typically more reliable than in-band DTMF, particularly for VoIP applications where the audio stream might be compressed. RFC 2833 is the standard that initially defined this method. It is now replaced by RFC 4733 but this method is still referred by RFC 2833.
3. **Out-of-band via SIP INFO messages**: tones are sent as separate SIP INFO messages. While this can be more reliable than in-band DTMF, it's not as widely supported as the RFC 2833 method.

<Note>
Vapi's DTMF tool uses in-band method. Please note that this method may not work with certain IVRs. If you are running into this issue, the recommended approach is to have your assistant say the options out loud if available. For example, when an IVR says "Press 1 or say Sales for the Sales department," prefer having the assistant say "Sales."
</Note>

##### Tool Effectiveness

To evaluate this tool, we set up a Vapi assistant with the DTMF tool enabled and conducted calls to a range of IVR systems, including a Twilio IVR (configured via Studio Flows) and several third-party IVRs such as pharmacies and insurance companies.

**Testing Methodology**

We called and navigated through the IVRs using three different strategies:

1. **Direct Dialpad**: calling from a personal phone and dialing options using the dialpad.
2. **Vapi DTMF Tool**: an assistant configured with the DTMF tool.
3. **Manual DTMF Sound**: calling from a personal phone and playing DTMF tones generated by software. _(similar approach as the Vapi DTMF Tool)_

**Key Findings**

- The assistant successfully navigated some of the third-party IVRs.
- The assistant encountered issues with Twilio IVRs, likely due to Twilio’s preference for RFC 2833.
- Observed occasional delays in DTMF tone transmission, which may affect effectiveness with IVRs that have short timeouts.

**Conclusion**

The tool's effectiveness depends on the IVR system's configuration and DTMF capturing method. We are working to improve compatibility and reduce transmission delays for broader and more reliable support.


<Accordion title="Custom Functions: Deprecated">
### Custom Functions
Expand Down
Loading