Skip to content
Merged
Show file tree
Hide file tree
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
56 changes: 56 additions & 0 deletions fern/calls/voicemail-detection.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,60 @@ Choose between two detection methods based on provider performance:

---

## **Pre-recorded Audio Messages**

Instead of text-to-speech, you can use pre-recorded audio files for your voicemail messages. Simply provide the URL to your audio file in the `voicemailMessage` property:

<CodeBlocks>
```json title="API Configuration"
{
"name": "Sales Assistant with Audio Message",
"model": {
"provider": "openai",
"model": "gpt-4o"
},
"voicemailDetection": {
"provider": "vapi"
},
"voicemailMessage": "https://example.com/sales-voicemail.mp3"
}
```
```typescript title="TypeScript SDK"
const assistant = await vapi.assistants.create({
name: "Sales Assistant with Audio Message",
model: {
provider: "openai",
model: "gpt-4o"
},
voicemailDetection: {
provider: "vapi"
},
voicemailMessage: "https://example.com/sales-voicemail.wav"
});
```
```python title="Python SDK"
assistant = client.assistants.create(
name="Sales Assistant with Audio Message",
model={
"provider": "openai",
"model": "gpt-4o"
},
voicemail_detection={
"provider": "vapi"
},
voicemail_message="https://example.com/sales-voicemail.mp3"
)
```
</CodeBlocks>

**Supported formats**: `.wav` and `.mp3` files

<Tip>
Pre-recorded audio messages provide consistent quality and pronunciation, especially useful for brand-specific messaging or complex information like phone numbers and website URLs.
</Tip>

---

## **Disabling Voicemail Detection**

To completely disable voicemail detection for your assistant, set the `voicemailDetection` property to `"off"`:
Expand Down Expand Up @@ -596,6 +650,8 @@ When voicemail detection is disabled, your assistant will continue the conversat

By using Vapi's detection system, you'll avoid the common pitfalls of voicemail detection, while creating a **faster, smarter, and more professional experience** for your users.



## **Related Documentation**

- **[Voicemail Tool](/tools/voicemail-tool)** - Alternative assistant-controlled voicemail approach for maximum flexibility
59 changes: 58 additions & 1 deletion fern/tools/voicemail-tool.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ assistant = client.assistants.create(

Define the voicemail message in the tool configuration:

### **Text-to-Speech Messages**

```json
{
"messages": [
Expand All @@ -146,9 +148,64 @@ Define the voicemail message in the tool configuration:
Use template variables like `{{company}}`, `{{message}}`, and `{{phone}}` to make your voicemail messages dynamic while keeping them consistent.
</Tip>

### **Pre-recorded Audio Messages**

For consistent quality and pronunciation, use pre-recorded audio files by providing the URL in the `content` field:

```json
{
"messages": [
{
"type": "request-start",
"content": "https://example.com/voicemail.mp3"
}
]
}
```

**Supported formats**: `.wav` and `.mp3` files

<Note>
Pre-recorded audio messages are ideal for brand-specific messaging or when you need precise pronunciation of phone numbers, website URLs, or company names.
</Note>

## Advanced Examples

### Dynamic voicemail with context
### **Pre-recorded Audio Example**

Using pre-recorded audio for professional voicemail messages:

```json
{
"model": {
"provider": "openai",
"model": "gpt-4o",
"messages": [
{
"type": "system",
"content": "You are a sales representative calling prospects. If you reach voicemail, use the leave_voicemail tool to play our professional pre-recorded message."
}
],
"tools": [
{
"type": "voicemail",
"function": {
"name": "leave_voicemail",
"description": "Leave a professional pre-recorded voicemail message"
},
"messages": [
{
"type": "request-start",
"content": "https://example.com/professional-sales-voicemail.mp3"
}
]
}
]
}
}
```

### **Dynamic voicemail with context**

```json
{
Expand Down
Loading