Voicemail detection issue
# support
t
When making a call via the API, with voicemail settings turned on, the call status is 'silence-timed-out', but the AI does not leave a voicemail message, it just talks to the user's voicemail itself.
v
@Trent™ It sounds like there might be an issue with the voicemail detection settings in your VAPI configuration. When voicemail detection is enabled and working correctly, the API should be able to distinguish between a human answer and a voicemail system, and act accordingly. To address this, we should review and possibly adjust the voicemail detection settings. Could you please provide me with the current configuration settings for the voicemail detection feature? This will help me understand how it's set up and guide you on how to fix the issue.
You can continue this conversation by mentioning me in the message.
t
Copy code
'assistant': {
      "backgroundSound": noise,
      "voicemailDetection": {
        "provider": "twilio",
        "voicemailDetectionTypes": [
          "machine_end_beep",
          "machine_end_silence"
        ],
        "enabled": info.info.agent.voicemail,
        "machineDetectionTimeout": 3,
        "machineDetectionSpeechThreshold": 1000,
        "machineDetectionSpeechEndThreshold": 500,
        "machineDetectionSilenceTimeout": 2000
      },
      "voicemailMessage": info.info.agent.voicemail_message,
@Vapi
v
@Trent™ Thank you for providing the configuration details. It seems that the voicemail detection settings are configured to use Twilio's provider with specific detection types and timeouts. Here are a few things to consider: 1. **Machine Detection Timeout**: The
machineDetectionTimeout
is set to 3 seconds. This might be too short for the system to accurately detect voicemail greetings. Consider increasing this value to give the system more time to make a correct assessment. 2. **Speech and Silence Thresholds**: The
machineDetectionSpeechThreshold
,
machineDetectionSpeechEndThreshold
, and
machineDetectionSilenceTimeout
parameters are set to 1000, 500, and 2000 milliseconds respectively. These values determine how the system interprets speech and silence, which can affect voicemail detection accuracy. You may need to adjust these thresholds based on the typical length of the greetings in the voicemails you are encountering. 3. **Voicemail Message**: The
voicemailMessage
is set to
info.info.agent.voicemail_message
. Ensure that this variable is correctly populated with the message you want to leave when a voicemail system is detected. If you're still experiencing issues with the AI not leaving a voicemail message, you might want to test the system with different threshold values or reach out to Twilio support for further assistance with their voicemail detection features. If you need to adjust the configuration, please provide the new values, and I can assist you with updating the settings. If you believe the configuration is correct and the issue persists, it may be best to contact support for more in-depth troubleshooting.
t
@Vapi The machineDetectionTimeout is in seconds, correct?
v
@Trent™ Yes, that's correct. The
machineDetectionTimeout
parameter is typically specified in seconds. It defines the number of seconds that the system should attempt to detect an answering machine before timing out. If you're experiencing issues with the voicemail detection, you might want to consider adjusting this timeout to a higher value to allow more time for accurate detection. The default timeout is usually 30 seconds, but you can set it to the value that best suits your needs.
t
What are the typical defaults for "machineDetectionSpeechThreshold", "machineDetectionSpeechEndThreshold", "machineDetectionSilenceTimeout"?
@Vapi
v
@Trent™ The typical default values for these settings can vary depending on the provider and the specific use case, but generally, you might see defaults around the following ranges: - **machineDetectionSpeechThreshold**: This is the minimum amount of time in milliseconds that is considered speech. A common default might be around 100-500 milliseconds. - **machineDetectionSpeechEndThreshold**: This is the amount of time in milliseconds that indicates the end of speech. A typical default could be around 500-1000 milliseconds. - **machineDetectionSilenceTimeout**: This is the amount of time in milliseconds that the system waits during silence before considering it the end of an answering machine greeting. A default value might be around 2000-5000 milliseconds. Please note that these values can be highly dependent on the specific characteristics of the voicemail systems you are dealing with and the provider's implementation. It's often necessary to fine-tune these thresholds based on empirical results from testing with your target audience's voicemail systems. If you're unsure about the best values to use, you may want to conduct some tests or consult with the provider's documentation or support team for recommendations tailored to your situation.
s
Hey @Trent™ To help track down this issue, could you share: - The call ID - When exactly this happened (the timestamp) - What response you expected to get - What response you actually got instead This would really help me figure out what went wrong!
t
I changed the settings and am going to be testing.
Copy code
"voicemailDetection": {
        "provider": "twilio",
        "voicemailDetectionTypes": [
          "machine_end_beep",
          "machine_end_silence"
        ],
        "enabled": info.info.agent.voicemail,
        "machineDetectionTimeout": 30,
        "machineDetectionSpeechThreshold": 1000,
        "machineDetectionSpeechEndThreshold": 1000,
        "machineDetectionSilenceTimeout": 5000
      },
      "voicemailMessage": info.info.agent.voicemail_message,
That's the code I am using in my voicemail detection: Call ID: 8b0a2ce9-4a49-4b07-96b7-f90dde1117f5 Around the 10 second mark, the AI starts to talk again after the initial voice mail message. I expected the AI to recognize that it's voicemail, and wait until the prompt to leave the specified voicemailMessage. It did not wait for the voicemail to leave a message, instead marked the call as 'Customer did not answer', and hung up.
@Shubham Bajaj @Vapi
v
@Trent™ Great, it looks like you've updated the voicemail detection settings with the following values: - `machineDetectionTimeout`: 30 seconds - `machineDetectionSpeechThreshold`: 1000 milliseconds - `machineDetectionSpeechEndThreshold`: 1000 milliseconds - `machineDetectionSilenceTimeout`: 5000 milliseconds These settings should provide a more robust framework for detecting voicemail systems. However, since you've mentioned that the AI did not wait to leave the voicemail message and instead marked the call as 'Customer did not answer', there might be a few things to check: 1. **Voicemail Detection Enabled**: Confirm that
info.info.agent.voicemail
is set to
true
to ensure that voicemail detection is actually enabled. 2. **Voicemail Message**: Verify that
info.info.agent.voicemail_message
contains the correct message you intend to leave on the voicemail. 3. **Call ID and Timestamp**: With the Call ID
8b0a2ce9-4a49-4b07-96b7-f90dde1117f5
and the issue occurring around the 10-second mark, you should review the call logs to see if there are any indicators of why the AI did not wait for the beep to leave the voicemail message. 4. **Testing**: Since you are going to be testing the new settings, monitor the calls closely to see if the adjustments have resolved the issue. If the problem persists, you may need to further tweak the settings or reach out to the provider's support for more detailed analysis. Keep an eye on the system's behavior with these new settings during your tests. If the issue continues, please provide any additional information or error messages you receive, and I'll be happy to assist further.
t
The voice mail settings should be nested under the 'assistant', right? 'assistant': { "backgroundSound": noise, "voicemailDetection": { "provider": "twilio", "voicemailDetectionTypes": [ "machine_end_beep", "machine_end_silence" ], "enabled": info.info.agent.voicemail, "machineDetectionTimeout": 30, "machineDetectionSpeechThreshold": 1000, "machineDetectionSpeechEndThreshold": 1000, "machineDetectionSilenceTimeout": 5000 }, "voicemailMessage": info.info.agent.voicemail_message,
@Vapi
v
@Trent™ Yes, that's correct. The
voicemailDetection
settings should indeed be nested under the
assistant
object in your configuration. The structure you've provided looks appropriate:
Copy code
json
'assistant': {
  "backgroundSound": noise,
  "voicemailDetection": {
    "provider": "twilio",
    "voicemailDetectionTypes": [
      "machine_end_beep",
      "machine_end_silence"
    ],
    "enabled": info.info.agent.voicemail,
    "machineDetectionTimeout": 30,
    "machineDetectionSpeechThreshold": 1000,
    "machineDetectionSpeechEndThreshold": 1000,
    "machineDetectionSilenceTimeout": 5000
  },
  "voicemailMessage": info.info.agent.voicemail_message,
}
Make sure that the
info.info.agent.voicemail
is set to
true
to enable voicemail detection, and that
info.info.agent.voicemail_message
contains the message you want to leave when the voicemail system is detected. With these settings in place, your system should attempt to detect voicemail systems using Twilio's provider and, upon detection, leave the message specified in
info.info.agent.voicemail_message
. If you encounter any further issues during your testing, please provide the details, and I'll be glad to assist you.
t
New call ID: 67549d17-b2e2-47da-a2a7-98f623e368d0
@Shubham Bajaj thoughts?
s
@Trent™ you need to set the first message mode to assistant waits for the user and change your twilio voice mail settings to find it out if it's voicemail at earliest. 1. Set Assistant first message mode to wait for user to speak 2. use the following twilio voice mail detection settings:
Copy code
json
voicemailDetection: {
    provider: "twilio",
    voicemailDetectionTypes: [
        "machine_start",          
        "machine_end_beep",       
        "machine_end_silence",    
        "unknown",                
        "machine_end_other"       
    ],
    enabled: true,
    machineDetectionTimeout: 15,  
    machineDetectionSpeechThreshold: 2500, 
    machineDetectionSpeechEndThreshold: 2050, 
    machineDetectionSilenceTimeout: 2000    
}
Lear More From here: https://www.notion.so/vapi/Handling-Voicemail-in-Calls-142008c8393f80f1abb8de8ecb17842d
t
Ok so this kind of works...
Here's the transcript: 'User: Your call has been forwarded to an automatic voice message system. 6 0 5 8 8 0 5 4 9 6 is not available. At the tone, please record your message. When you have finished recording, you may hang up or\n'
Basically I think the agent is talking during the automated message, therefore not actually leaving one, because it's not waiting for a beep.
Thoughts? @Vapi @Shubham Bajaj
v
@Trent™ Based on the transcript you've provided, it appears that the voicemail detection system is not correctly identifying the end of the automated greeting, which is typically indicated by a beep. Since the agent is speaking during the automated message, it suggests that the system might be misinterpreting the speech as coming from a live person rather than a voicemail system. Here are a few steps you can take to improve voicemail detection: 1. **Adjust Detection Types**: Ensure that
machine_end_beep
is included in the
voicemailDetectionTypes
to detect the beep that signals the end of the voicemail greeting. 2. **Tune Speech Thresholds**: The
machineDetectionSpeechThreshold
and
machineDetectionSpeechEndThreshold
may need to be adjusted. These settings determine what the system considers as speech versus silence or a beep. Since voicemail greetings can vary, finding the right balance for these thresholds can be crucial. 3. **Silence Timeout**: The
machineDetectionSilenceTimeout
should be set to a value that allows the system to recognize the end of the voicemail greeting. If this timeout is too short, the system might not wait for the beep. 4. **First Message Mode**: As you mentioned, setting the assistant's first message mode to wait for the user to speak can help prevent the agent from talking over the voicemail greeting. 5. **Testing and Monitoring**: Continue testing with different settings and closely monitor the calls to see if the adjustments lead to the desired behavior. 6. **Provider Support**: If the issue persists, consider reaching out to Twilio's support for guidance on their voicemail detection capabilities and best practices. By fine-tuning these settings and observing the system's behavior, you should be able to achieve more accurate voicemail detection and ensure that the agent waits for the beep before leaving a message. If you need further assistance with specific settings or troubleshooting, please let me know.
t
When there's a voicemail it seems like the Agent is using the prompt to make a response, but at the end of the response it also includes the voicemail message...? @Vapi
v
@Trent™ It sounds like the voicemail detection system may be recognizing the voicemail prompt as a point to start speaking, but it's not distinguishing between leaving a response to a live person and leaving a voicemail message. This could result in the agent starting its response during the voicemail prompt and then appending the intended voicemail message at the end, which is not the correct behavior. To address this, you may need to: 1. **Review Voicemail Detection Logic**: Ensure that the system is designed to differentiate between a live conversation and a voicemail prompt. The agent should only start speaking after the voicemail beep has been detected, not during the voicemail greeting. 2. **Adjust Timing Settings**: Fine-tune the
machineDetectionSpeechThreshold
,
machineDetectionSpeechEndThreshold
, and
machineDetectionSilenceTimeout
settings to better match the characteristics of the voicemail systems you're encountering. 3. **Check Implementation**: Verify that the implementation of the voicemail detection logic in your code correctly interprets the detection results and triggers the voicemail message at the appropriate time. 4. **Test and Monitor**: Conduct thorough testing with different voicemail systems to see how the agent behaves and adjust the settings accordingly. If you're still having trouble with the agent's behavior during voicemail detection, it might be helpful to look at the detailed logs or reach out to the API provider's support for further assistance. They may be able to provide insights or recommendations based on common patterns they've observed with their service.
s
call id please.
a
im also facing the same issue: callid: 37d9beac-6d44-4ead-b55f-742bbd37edd1
h
Is there something wrong with Vapi voice library? I don't seem to be able to scroll in the accent option and also I don't see the voice ID for the voices anymore. How do we select the voice we want? @User @User
s
@Harry we are working on this, and soon it will be fixed.
@Alamin H create a support ticket for your issue.
@Trent™ because of no response closing this ticket!!
t
my apologise
I will get that call ID.
Id is: d895dba1-a487-4e7e-b8bd-42be91f43386
Copy code
"voicemailDetection": {
        "provider": "twilio",
        "voicemailDetectionTypes": [
          "machine_end_beep"
        ],
        "enabled": info.info.agent.voicemail,
        "machineDetectionTimeout": 59,
        "machineDetectionSpeechThreshold": 5000,
        "machineDetectionSpeechEndThreshold": 5000,
        "machineDetectionSilenceTimeout": 10000
      },
      "voicemailMessage": info.info.agent.voicemail_message,
basically once the voicemail tone ends with the beep to leave the message, the ai will actually run the AI talk for a little bit, then once that's done, it'll then leave the 'voicemail message'.
@Shubham Bajaj
s
set firstMessageMode to "assistant-waits-for-user"
t
That's the only way to make voicemail work properly?
4 Views