https://retellai.com/?utm_source=discord&utm_medium=seo logo
We incur a bunch of cost for outbound calls that r...
# ❓・ai-evy-support
p
@AI Evy We incur a bunch of cost for outbound calls that result in a voicemail. Is there a way to pre-record a VM message or to use a cheaper model?
a
Thanks for tagging me @Phil. I'll look through relevant sources and get back to you shortly.
### Answer Yes, you can configure voicemail handling to reduce costs on outbound calls that hit voicemail. Voicemail Detection & Static Message You can enable voicemail detection and set a static text message to be played when voicemail is detected, rather than having the full AI agent engage: [(1) ]() [(2) ]()
Copy code
javascript
"enable_voicemail_detection": true,
"voicemail_option": {
  "action": {
    "type": "static_text",
    "text": "Please give us a callback tomorrow at 10am."
  }
}
- `enable_voicemail_detection`: Set to
true
to detect whether the call enters a voicemail (only available for phone calls) . - `voicemail_option`: When set, the call will try to detect voicemail in the first 3 minutes. You can define an action to leave a static message or hang up. - `voicemail_message`: Alternatively, you can set a simple message string to be played when voicemail is detected. If you want to hang up after hitting voicemail, set this to an empty string. - `voicemail_detection_timeout_ms`: Configures when to stop running voicemail detection (default is 30,000 ms / 30 seconds) . Using
static_text
for the voicemail action means the AI agent won't need to generate a dynamic response, which can help reduce costs associated with LLM and TTS usage on voicemail calls. You can update these settings via the [Update Voice Agent]() API endpoint. [(2) ]()
​ To learn more, see the sources I considered: [[1] List Voice Agents](https://docs.retellai.com/api-references/list-agents) [[2] Update Voice Agent](https://docs.retellai.com/api-references/update-agent) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
p
@User can i use variabes {{ }} in a static_text?
@AI Evy can i use variabes {{ }} in a static_text?
@AI Evy I Evy can i use variabes {{ }} in a static_text?
a
Thanks for the follow-up, @Phil. I'll get back to you soon.
### Answer Yes, dynamic variables (
{{ }}
) are supported in static voicemail messages. [(1) ]() The documentation states that for the "Leave a message" option, dynamic variables are supported for both static message and prompt. Example:
Copy code
json
"voicemail_option": {
  "action": {
    "type": "static_text",
    "text": "Hi, this is {{your name}}, please give us a callback tomorrow at 10am."
  }
}
Just make sure to pass the dynamic variable values via
retell_llm_dynamic_variables
when creating the outbound call. [(7) ]()
​ To learn more, see the sources I considered: [[1] Handle voicemail](https://docs.retellai.com/build/handle-voicemail) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.