Voicemail detection
# support
s
Hi guys, Hope you're doing well! I have created an Vapi agent to make outbound calls but for some reason most of my calls fails to detect voicemails. Can you help with the best ways to detect all the voicemail if possible? And is there a pre defined voicemail tool or do I have to create one? I have sent you my configurations below. **Twilio detection settings**: `"voicemailDetection": { "provider": "twilio", "voicemailDetectionTypes": [ "machine_end_beep", "machine_end_silence", "machine_start", "unknown", "machine_end_other" ], "enabled": True, "machineDetectionTimeout": 15, "machineDetectionSpeechThreshold": 2500, "machineDetectionSpeechEndThreshold": 2050, "machineDetectionSilenceTimeout": 2000, }, "voicemailMessage": f"{selected_voicemail}", "firstMessageMode": "assistant-waits-for-user" Custom voicemail tool created in Vapi: Tool ID: 7e6bb3aa-f1e3-48e5-acde-01485e639108 Text: Listen for common voicemail prompts (e.g., 'leave a message after the tone', 'tone', 'signal', leave a message', leave message or 'record your message'). Wait for the beep or tone or silence before leaving your message. Leave the VOICEMAIL. End the call after leaving the voicemail. Voicemail detection in prompt: I have an issue here, my agent ends the call without leaving the voicemail with this prompt.
Voicemail detection in prompt: I have an issue here, my agent ends the call without leaving the voicemail with this prompt. If transferred to a voicemail system, follow these steps: Listen for common voicemail prompts leave a message after the tone record your message Wait for the beep, tone, or silence Before leaving your message. Call the Voicemail tool. Call the EndCall function After leaving the voicemail.
v
message has been deleted
s
s
Hey @Shivam Sharma can you share the call id?
s
There are many man, 4fd3a322-309b-4d24-8e50-a051220b962f 8a3ad13a-e3f3-43dd-a7d7-cf2d12dbbba5 f02e571e-d5e8-4db7-a987-206921bb9cb9 bd5ea663-6d4e-48b3-94bc-9d3710e8066a
s
Hey @Shivam Sharma 1. Try reducing your prompt token length to around 2500 tokens. 2. Remove your own voicemail detection tool 3. Use TwilioVoiceMailDetection First
logs
{ "role": "tool_calls", "time": 1731081858310, "message": "", "toolCalls": [ { "id": "call_48MuTVXDSp54ascysiPecJQz", "type": "function", "function": { "name": "Voicemail", "arguments": "{\"Voicemail detection\": \"tone\"}" } } ], "secondsFromStart": 102.629 }, { "name": "Voicemail", "role": "tool_call_result", "time": 1731081859580, "result": "No result returned.", "toolCallId": "call_48MuTVXDSp54ascysiPecJQz", "secondsFromStart": 103.899 }
TLDR:
Remove your voicemail tool, and use TwilioVoiceMailDetection instead. Prompt works best when length is less than or equal to 2500.
s
And before leaving voicemail, it always asks the agent to to hold on a sec, why is that heppening? 5691f208-1bd0-4c4e-a348-aa7d7c166436 https://cdn.discordapp.com/attachments/1305065394662408192/1305883427979137024/image.png?ex=6734a637&is=673354b7&hm=261d531a32f90b5a265b8dd883263950b467fe65193c90e7d12fc02bfa6b40f4&
s
You need to add firstMessageMode to assistantWaitsForUser
s
This is already done. But still the same issue.
s
Hey @Shivam Sharma can you try out this once?
Copy code
json
  "voicemailDetection": {
    "provider": "twilio",
    "enabled": true,
    "voicemailDetectionTypes": [
      "machine_end_beep",
      "machine_end_other",
      "machine_end_silence",
      "machine_start",
      "unknown"
    ],
    "machineDetectionTimeout": 5,
    "machineDetectionSpeechThreshold": 2400,
    "machineDetectionSpeechEndThreshold": 1000,
    "machineDetectionSilenceTimeout": 3000
  }
Your current voicemail config:
Copy code
json
"voicemailDetection": {"enabled": true, "provider": "twilio"}
@Shivam Sharma your using your own voicemail tool which is not efficient instead can you please use the twilio voicemail tool and let me know how it goes.
s
@Shubham Bajaj I will try with these settings tomorrow and send you the results.
s
Hey @Shivam Sharma can i close this ticket now?
s
Hey, I'm trying to work my way around voicemails. I faced one issue today where call went to voicemail and the user said bye bye in the voicemail message which triggered the call to end. It is a rare case but any idea how we can work around it? f3d838c6-e4e9-4d04-b511-86b4ff0d82e2
s
@Shivam Sharma it didn't happened by chance your custom tool call of type voicemail didn't received correct response and failed. By chance user spoken "Good Bye" and call was hangup. https://cdn.discordapp.com/attachments/1305065394662408192/1308172135759613963/Screenshot_2024-11-19_at_2.17.00_AM.png?ex=673cf9bd&is=673ba83d&hm=70ef862a771c63fdaae443c88e63e50fc9a6ee6466bab58fb2937e51f293546f&
@Shivam Sharma can you help me with some info on why your using own voicemail tool?
s
I’m using the custom tool because it is more helpful in detecting true voicemails. With the twilio detection types and value settings shared, it was detecting a lot of false voicemails and thinking of humans as voicemails because of which lot of our calls were failing. That is why, I’m using the custom tool which is still giving us 60-70% better calls.
s
Your voicemail tool didn't returned any response fix that part and it will work.
s
I have made it retry whenever the user interrupts the voicemail and not end the call.
s
Yeah end of call was by chance, but its visible from logs server didn't returned any response. Look I am trying to help you here, that if you associate server url with a tool your supposed to return a response or make it async. If you made it async then tool call response won't be used.
s
s
Hey @Shivam Sharma it is not looks like something is wrong on our side in logs, all good from your side.
Do let me know If I can close this ticket!!
s
Yes please
thank you
I'll keep bugging you guys though😁
s
That's goes without Saying, ThankYou for the co-operation.
h
I have spent more time trying to get voicemail to work on outbound call than the entire rest of the build
ive got it detecting pretty good now but it will not end the call
s
@Ham please tag me to your #1211483291191083018 ticket and share the Call ID as well.
a
Hi @Shubham Bajaj , I have the voicemail issue as well "voicemailDetection": { "provider": "twilio", "voicemailDetectionTypes": [ "machine_start", "machine_end_beep", "machine_end_silence", "machine_end_other" ], "enabled": true, "machineDetectionTimeout": 15, "machineDetectionSpeechThreshold": 3500, "machineDetectionSpeechEndThreshold": 4050, "machineDetectionSilenceTimeout": 6000 }, "startSpeakingPlan": { "waitSeconds": 0.8, "smartEndpointingEnabled": false }, "voicemailMessage": "my message", "firstMessageMode": "assistant-waits-for-user" If I add "human" in detection enums then it recognizes the voicemail, but it creates false positive when human picks the call, and ends the call
h
Plus one
Yeah the voicemail issue is quite annoying. I'm not sure really what the best settings are to get it to work. Do you havea ny suggestions? I've tried a variety of options. What are the best options currently to use?
Copy code
voicemailDetection: {
                provider: "twilio",
                voicemailDetectionTypes: [
                  "machine_end_beep",
                  "machine_end_silence",
                  "machine_end_other",
                ],
                enabled: true,
                machineDetectionTimeout: 30,
                machineDetectionSpeechThreshold: 2400,
                machineDetectionSpeechEndThreshold: 5000,
                machineDetectionSilenceTimeout: 5000,
              },
              // model: {
              //   provider: "openai",
              //   model: "gpt-4o-mini",
              //   tools: [{ type: "voicemail" }],
              // },
I've tried varieties and all of them seem to fail. The worst seems tobe when using the
tools: [{type: "voicemail"}]
where it will often trigger way to early. Are there any solutions?
h
turning off twilio and using a voicemail tool for detection seem to work best for detection, the issue is there is no way to prompt the message its pretty much text to speech. also sometimes it will say goodbye and then say good bye again when it ends the call, sometimes it will report i am ending the call now , its not always the same even if you send it to the exact same voicemail over and over
for my use case the lead has booked an appointment, so we outbound call to get them on the line then forward to the agent, the customer wants it to try a few times if they dont answer, so leaving the exact same voicemail message every time is not ideal
h
You think so hey? Did you notice anything with it starting early? I'm finding that it'll start the voicemail message like halfway through the voicemail
h
yes but it is better without the twilio detection, its still a bit early sometimes, it does not wait for the tone, but most of the message gets through usually. Its just hard to optimize because its doing different things without changing anything, even using the same voicemail to call I tried adding voicemail instructions to the prompt, sometimes it completely ignores them sometimes it uses them
sometimes it uses both the voicemail preset message and the prompt suggestion, but if you remove the voicemail preset it just says "goodbye" and hangs up sometimes it plays only the voicemail preset like a text to speech sometimes it uses the prompts adding ah um etc
s
@art3a. don't add human instead use unknown, and if your facing blockers because of this just create a #1211483291191083018 ticket and ping me over there.
26 Views