startSpeakingPlan not working
# support
a
For this call id: 019c480c-e060-7eea-a218-27d72e32b5aa I have this startSpeakingPlan: "startSpeakingPlan": {"customEndpointingRules": [{"regex": ".*beep.*", "timeoutSeconds": 7, "type": "assistant"}, {"regex": ".*(leave your message|leave a message).*", "timeoutSeconds": 3, "type": "assistant"}]}} But the assistant didn't even wait 1 second for the next message it said, and it said "beep", it should have waited 7 seconds. This sometimes works and sometimes it doesn't, what is the issue here ? https://cdn.discordapp.com/attachments/1472003000150265960/1472003000393269398/Screenshot_2026-02-13_at_3.53.35_p.m..png?ex=6990fd1f&is=698fab9f&hm=b9724742a435e87ceb950f8d9096412e3c1910a8f8bd98fab1d0f4e612e0e6a2&
j
This usually happens because “beep” is being detected inside a longer TTS message, so the rule triggers immediately instead of waiting. In VAPI, regex endpointing runs as soon as it matches the assistant’s audio stream, not after the whole message finishes playing. If the beep is embedded in the same response, the timeout can behave inconsistently. It works better when the beep is sent as a separate audio segment or followed by a short pause. Are you generating the beep in the same TTS message, or as its own audio output? @alep
a
@James Christopher Thanks for the response, it is in the same TTS message. I am considering instead of using startSpeakingPlan to use call control and speech-update webhook for what I want to achieve. The goal is for the assistant to wait until the user finished it's voicemail message after the beep
j
Great point, this happens because the beep is in the same TTS message, so VAPI matches it instantly and the timeout becomes unreliable. For voicemail flows, the stable approach is to separate the beep and move to call control + speech-update. Play the beep first, then explicitly switch the call into listening mode. From there, track when the user starts speaking and when silence occurs, and end the recording based on real speech activity instead of regex timing. This removes the race conditions you’re seeing and gives you full control over start/stop. I’ve implemented this pattern in production setups and it’s much more reliable, happy to walk you through it, let's discuss more privately @alep