Issue with "Infinite Loop" IVRs: Agent waits for s...
# support
t
Hi Vapi Support, I am building an AI agent specifically designed to navigate IVR phone trees. I am running into a critical failure case with IVRs that loop continuously without pausing (specifically the Costco customer support line). Call ID for investigation: 019b025e-784a-7ff6-b98a-a40e418f9fc5 Timestamp: 09 Dec, 2025, 14:08 The Issue: The Costco IVR reads a very long list of hours and then loops the menu options repeatedly without any silence gap between the end of the menu and the start of the loop. Because the IVR never stops speaking for more than a fraction of a second, the agent's VAD (Voice Activity Detection) or Endpointing logic never triggers the "User Finished Speaking" state. Consequently, the LLM is never called to process the transcript, and the agent sits there recording the loop indefinitely until the call fails or times out. What I have tried: I have updated the System Prompt with strict instructions to "Interrupt immediately upon detecting a repeated phrase" and "Do not wait for silence," but this hasn't worked. I suspect this is because the System Prompt is only evaluated after the turn is considered complete (which never happens due to the continuous audio). My Questions: Is there a configuration setting to make the agent process the transcript stream in real-time and trigger a tool while the other party is still speaking? Can I adjust the VAD silence threshold to be more sensitive (e.g., trigger on < 500ms gaps)? Is there a way to force an interruption or "barge-in" programmatically if the user/IVR has been speaking for X seconds without a break? Example Transcript (Looping): "...To reach the pharmacy press 4. To reach the administrative staff press 1. For warehouse hours... [Loop continues instantly]" Any guidance on how to handle continuous audio streams without silence gaps would be appreciated. Thanks.
v
To aggressively handle looping IVRs, configure Assembly's turn detection for fast endpointing. Add this to your assistant's config:
Copy code
json
{
  "endOfTurnConfidenceThreshold": 0.4,
  "minEndOfTurnSilenceWhenConfident": 160,
  "maxTurnSilence": 400
}
This setup triggers on very short gaps (as low as 160ms), allowing your agent to process input even when the IVR rarely pauses. Test and adjust these values as needed for your IVR scenario. For more details, see the documentation on aggressive endpointing for IVRs. Source: - [Voice Pipeline Configuration](https://docs.vapi.ai/customization/voice-pipeline-configuration)
c
Hi TheNoob-\_-, To address the issue with IVRs that loop continuously without pauses: 1. **Real-time Transcript Processing**: The current system processes transcripts after a turn is considered complete, so real-time transcript processing during uninterrupted speech is not directly supported. However, you can adjust endpointing sensitivity to help. 2. **Adjust VAD Sensitivity**: You cannot directly adjust VAD sensitivity via API. Instead, configure aggressive endpointing using [Assembly's Turn Detection](https://docs.vapi.ai/customization/voice-pipeline-configuration) with low
minEndOfTurnSilenceWhenConfident
values:
Copy code
json
   {
     "endOfTurnConfidenceThreshold": 0.4,
     "minEndOfTurnSilenceWhenConfident": 160,
     "maxTurnSilence": 400
   }
This setup detects very short pauses and could help process input when the IVR rarely pauses. 3. **Force Interruption or "Barge-In"**: Consider configuring
customEndpointingRules
that recognize specific repeating patterns or phrases in the transcription which can immediately clear the pipeline. This might help in recognizing repeated loops and forcing a response. Test these configurations and adjust based on your specific IVR setup for optimal results.
t
I successfully fixed the loop detection by applying the "Aggressive" AssemblyAI configuration from your documentation The Result: **The Good: **This successfully fixes the infinite loop! The agent cuts the stream and can identifying the repetition. The Bad: It is now too aggressive. On secondary menus, as soon as the agent hears the first option (e.g., "Press 1 for Pharmacy..."), it detects the tiny pause after that phrase as an "End of Turn" and interrupts immediately before hearing options 2, 3, or 4. **My Question:**I am planning to switch to the "Balanced" settings (increasing minEndOfTurnSilenceWhenConfident to 400 and maxTurnSilence to 1280) to fix the premature interruption. However, I am worried that increasing the silence duration might cause the "Infinite Loop" issue to return (since the Costco loop has very little silence). Is there a recommended "Sweet Spot" configuration for IVRs that balances Loop Detection (requires fast cutting) with Menu Patience (requires waiting for the full list)? Thanks!
c
Hi, Based on your specific needs, here's a hybrid approach that should handle both scenarios effectively: Custom AssemblyAI Configuration
Copy code
{
  "transcriber": {
    "provider": "assembly",
    "endOfTurnConfidenceThreshold": 0.5,
    "minEndOfTurnSilenceWhenConfident": 300,
    "maxTurnSilence": 800
  }
}
This configuration sits between aggressive and balanced, providing: - Faster loop detection than balanced (300ms vs 400ms) - More patience than aggressive (300ms vs 160ms) for menu options - Reasonable timeout (800ms) to prevent excessive waiting Time-Based Dynamic Configuration For even better results, use a time-based approach that adapts to call progression
Copy code
{
  "startSpeakingPlan": {
    "smartEndpointingPlan": {
      "provider": "livekit",
      "waitFunction": "t < 30 ? (x * 500 + 300) : (20 + 500 * sqrt(x) + 2500 * x^3)"
    }
  }
}
This function uses
t
(time elapsed in seconds) to: - **First 30 seconds**: More conservative for IVR menus (300-800ms wait times) - **After 30 seconds**: Faster responses for human conversations Alternative Approaches 1. Prompt-Based Menu Handling Enhance your assistant's prompt to better handle IVR scenarios
Copy code
[When navigating an IVR tree]- WAIT for all options to be spoken before proceeding- Once you have heard all options, use the dtmf tool with an input digit- Avoid saying anything if using the dtmf tool at the same time[When waiting]- Reply with an empty string like " " to ensure nothing is spoken
2. Hybrid Detection Strategy Consider using Vapi's voicemail detection principles for loop detection while maintaining patient menu navigation:
Copy code
{
  "voicemailDetection": {
    "provider": "vapi",
    "backoffPlan": {
      "maxRetries": 3,
      "startAtSeconds": 5,
      "frequencySeconds": 2.5
    }
  }
}
This can help identify repetitive patterns (like loops) while your main endpointing remains patient for menus.