Drafting Voice mail message and enable voice mail ...
# support
d
I want to dynamically enable the voice mail detection and then allow a tool to generate the voice mail message. Not getting any option to achieve this?
@Vapi Support Bot how i can do this
@Vapi_Talent how i can enable voice mail detection from api
v
To dynamically enable voicemail detection and generate a message via the API, you can use the
voicemailDetection
configuration with a dynamic variable:
Copy code
json
"voicemailDetection": {
  "provider": "twilio",
  "voicemailDetectionTypes": [
    "machine_end_beep",
    "machine_end_silence",
    "human",
    "fax",
    "unknown",
    "machine_end_other"
  ],
  "enabled": info.info.agent.voicemail,
  "machineDetectionTimeout": 45
},
"voicemailMessage": info.info.agent.voicemail_message
Update this configuration using a PATCH request to
https://api.vapi.ai/assistant/{assistant-id}
. Sources: - [Discord Channel](https://discord.com/channels/1211482211119796234/1336548894896816222) - [Discord Channel](https://discord.com/channels/1211482211119796234/1334597630235512956) - [Discord Channel](https://discord.com/channels/1211482211119796234/1336424026486079559)
To dynamically enable voicemail detection and set a custom message, add the
voicemailDetection
configuration in your API request to the
/call
endpoint:
Copy code
json
{
  "assistantOverrides": {
    "voicemailDetection": {
      "provider": "twilio",
      "voicemailDetectionTypes": ["machine_start", "machine_end_beep"],
      "enabled": true,
      "machineDetectionTimeout": 15
    },
    "voicemailMessage": "Hello, I'm calling about your appointment. Please call us back at 555-123-4567."
  }
}
This enables Twilio's voicemail detection and sets a custom message to be played when voicemail is detected. Sources: - [Discord discussion on voicemail detection](https://discord.com/channels/1211482211119796234/1334597630235512956) - [Discord discussion on voicemail message configuration](https://discord.com/channels/1211482211119796234/1336424026486079559) - [Discord discussion on API request structure](https://discord.com/channels/1211482211119796234/1339783527700496396)
c
Why would you have the tool generate the message when you can just create the message you want to say? Akso trying to have a tool generate a voicemail message does not make much sense at all.
k
Configure the voicemailDetection settings in your assistant’s configuration and set the voicemailMessage property, then ensure the VoicemailTool is included in your assistant’s tools.
d
I am now generating dynamic message and pushing that into assistant so that my voice mail message depends on customers
k
You can use dynamic variables in Vapi to personalize voicemail messages by passing customer-specific data via assistantOverrides when initiating a call.
4 Views