https://retellai.com/?utm_source=discord&utm_medium=seo logo
Hi when testing my agent through the "Test Chat",...
# ❓・ai-evy-support
t
Hi @AI Evy when testing my agent through the "Test Chat", how do I simulate hanging up to trigger the ended_call webhook ?
a
​ To learn more, see the sources I considered: [[1] Setup guide](https://docs.retellai.com/features/register-webhook) [[2] Webhook Overview](https://docs.retellai.com/features/webhook-overview) ​
Thanks for tagging me @thomas_22569. I'll look through relevant sources and get back to you shortly.
### Answer --- To trigger the
call_ended
webhook when testing through "Test Chat," you need to end the call session. [(1) ]() The webhook setup guide recommends starting a web call in the dashboard to verify the webhook is triggered correctly. When a call completes, the
call_ended
event is triggered, which contains all fields from the call object except
call_analysis
. [(2) ]() After that, the
call_analyzed
event is triggered when call analysis is complete. For testing purposes, you can verify your webhook endpoint by starting a web call and ensuring it triggers correctly. [(1) ]() The webhook will POST the payload to your endpoint with a 10-second timeout, and will retry up to 3 times if no success status (2xx) is received. [(2) ]() **
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
t
If I'm using the "Test Chat" though there is noway to end the call session or am I missing something @AI Evy ?
a
Thanks for the follow-up, @thomas_22569. I'll get back to you soon.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
### Answer ⚠️ CRITICAL DATE DIRECTIVE ⚠️ *TODAY'S DATE IS: Friday, November 28, 2025 (2025-11-28) * --- You're correct that the LLM Playground's "Manual Chat" interface doesn't have an explicit "hang up" or "end call" button. [(1) ]() The Manual Chat testing environment is designed for rapid prototyping and testing agent responses in a text-based format. To test the
call_ended
webhook, you'll need to use actual call testing rather than the Manual Chat interface. The documentation recommends starting a web call in the dashboard to verify webhook triggers. [(2) ]() When a call completes, transfers, or encounters an error, the
call_ended
event is triggered with all fields from the call object except
call_analysis
. For the Manual Chat interface specifically, you can click the "delete" button to reset conversations, [(1) ]() but this won't simulate the full call lifecycle that triggers webhooks. If you need to test webhook behavior thoroughly, consider: - Making actual test calls (web or phone) rather than using Manual Chat - Using the simulation testing features available for conversation flow agents [(3) ]() **
​ To learn more, see the sources I considered: [[1] Manually test your agent](https://docs.retellai.com/test/llm-playground) [[2] Webhook Overview](https://docs.retellai.com/features/webhook-overview) [[3] Inside Retell AI | The Conversational AI Platform Behind Scalable AI Phone Systems | Retell AI](https://www.retellai.com/blog/inside-retell-ai-conversational-ai-phone-system) ​
Thanks for the follow-up, @thomas_22569. I'll get back to you soon.
### Answer ### Answer --- When creating a simulation test, you can control the conversation flow by defining the user's goal and personality in the user prompt. [(1) ]() To make the simulation end after a specific condition, include instructions in your user prompt that specify when the user should end the conversation. The recommended format for the user prompt includes a "Goal" section where you define the user's primary objective. For example, if you want the simulation to hang up after completing a task, you could structure it like:
Copy code
## Goal
Your primary objective is to [complete specific task]. Once this is accomplished, politely end the conversation and hang up.

## Personality
You are a [personality description]. If the conversation becomes too long or the goal is achieved, you will end the call.
The simulation uses an LLM model to generate user conversation based on your prompt. By clearly defining when the user should end the call in the prompt, the simulated user will naturally conclude the conversation at the appropriate point rather than looping indefinitely. After running the simulation, you can manually review the conversation to identify any issues, and then save it as a test case for future use. --- **
t
@AI Evy ok so if I use the simulation, how do I set up my test to hang up after something ? It seems it's looping through
a
​ To learn more, see the sources I considered: [[1] Automatically test your agent](https://docs.retellai.com/test/llm-simulation-testing) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Thanks for the follow-up, @thomas_22569. I'll get back to you soon.
t
@AI Evy looks like it's still looping and not hanging up : hank you very much! Goodbye! You're very welcome, Thomas! If you need any further assistance in the future, just let us know. Have a great day and goodbye! Goodbye! Goodbye, Thomas! Take care and have a great day! Goodbye! Goodbye! Wishing you a wonderful day ahead! Goodbye! Goodbye! If you ever need us again, we're just a call away. Have a fantastic day!
a
### Answer The looping you're experiencing is a known issue with simulation tests. [(1) ]() Several users have reported similar behavior where conversations loop even when there's no actual looping pattern. To address this, you should ensure your agent has an explicit
end_call
function configured. One user noted that even with extremely lax success criteria (1-2 lines) and an
end_call
function, they still encountered loops. The issue appears to stem from the loop detection mechanism being overly sensitive. According to community feedback, the
ConversationLoopError
can trigger even when success criteria are simple or when conversations are legitimately long by design rather than actually looping. Recommendations based on documented solutions: 1. Try using batch testing instead of individual simulation tests, as it skips the loop detection mechanism 2. Vary how your agent responds to avoid repeating the same phrasing 3. Track conversation progress to avoid circling back 4. Add clear end points in your conversation flow 5. Consider relaxing your success conditions slightly, as overly strict criteria can trigger the error You can find batch testing under: Simulation → LLM Simulation Testing → Batch test your agent in the Retell dashboard. If the issue persists and your flow is legitimately long by design (not actually looping) , you may need to reach out to Retell support to raise the limit or whitelist your use case. **
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] Simulation Tests – ConversationLoopError (Increase message limit)](https://discord.com/channels/1186424376300679209/1387066442276667517) ​
t
@AI Evy is there a setting to allow the agent to hang up themselves ?
a
Thanks for the follow-up, @thomas_22569. I'll get back to you soon.
### Answer --- Yes, you need to explicitly configure the agent to end calls. By default, the agent won't end the call automatically. [(1) ]() To enable the agent to hang up: 1. Add the "End Call" tool to your agent by clicking "+ Add" in the tools section and selecting "End Call" from the dropdown menu. 2. Define specific conditions under which the call should be terminated in your prompt. For example: "If the user says 'thank you', 'goodbye', or 'bye', use the end_call tool to terminate the conversation." 3. Update the agent's prompt to incorporate the end call conditions, including specific instructions about when to use the
end_call
tool. Additionally, you can configure automatic call termination settings at the agent level: - `end_call_after_silence_ms`: Set this (in milliseconds) to end the call after a period of silence. The default is 600000 ms (10 minutes) . [(2) ]() [(3) ]() [(4) ]() - `max_call_duration_ms`: Set this to limit the maximum duration of the call. The default is 3600000 ms (60 minutes) . These settings ensure the agent can terminate calls based on conversational cues or time limits. **
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
t
Doesn't look like the end_call function triggers the webhook ? @AI Evy
a
Thanks for the follow-up, @thomas_22569. I'll get back to you soon.
​ To learn more, see the sources I considered: [[1] Webhook Overview](https://docs.retellai.com/features/webhook-overview) [[2] Troubleshooting Guide](https://docs.retellai.com/integrate-llm/troubleshooting) [[3] Retell AI Webhooks | AI Voice Agents With Live Data | Retell AI](https://www.retellai.com/blog/retell-ai-webhooks-feature) [[4] Discord message from @_superwhale on 2025-01-24](https://discord.com/channels/1186424376300679209/1294891368505937952/1332171997744205925) ​
### Answer --- The
end_call
tool should trigger the
call_ended
webhook when the call terminates. [(1) ]() When a call completes, the
call_ended
event is triggered, which contains all fields from the call object except
call_analysis
. Troubleshooting steps: 1. **Verify webhook configuration**: Ensure your webhook URL is properly configured in the dashboard and that your endpoint is accessible. [(1) ]() [(2) ]() 2. **Check webhook signature**: Retell AI includes an
x-retell-signature
header with every webhook request for authentication. [(3) ]() Verify you're not blocking requests due to signature validation issues. 3. **Test with actual calls**: The webhook is triggered when calls complete through actual phone/web calls, not through the Manual Chat interface. [(2) ]() Simulation tests may not reliably trigger webhooks the same way production calls do. 4. **Add logging**: Add logging to your webhook endpoint to confirm whether requests are being received at all. 5. **Community insight**: One user noted that adding a unique identifier to the function name (e.g.,
end_call_152
) helps the AI identify it as a function. [(4) ]() You might try this approach. 6. **Verify response**: Your webhook endpoint must return a successful status code (2xx) . [(1) ]() Retell expects no body in the response. If your webhook endpoint isn't receiving the
call_ended
event after using the
end_call
tool, check your server logs to see if the request is arrivi
ng but failing validation, or if it's not being sent at all. --- **
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.