https://retellai.com/?utm_source=discord&utm_medium=seo logo
t
Hi @AI Evy . I have created an agent with phone number and gave proper prompt. the problem is when the conversation is over the agent is not ending the call. I want the agent to hang up the call.
a
Thanks for tagging me @tahjib.leon. I'll look through relevant sources and get back to you shortly.
### Answer To make your Retell AI agent end (hang up) the call automatically when the conversation is over, you need to configure the agent to use the "End Call" tool. Here’s how you can do it: 1. In your agent setup, add the End Call Tool by clicking "+ Add" in the tools section and selecting "End Call" from the dropdown menu. 2. Define the conditions for ending the call. For example, set it so that if the user says “thank you”, “goodbye”, or “bye”, the agent will use the end_call tool to terminate the conversation. 3. Update your agent’s prompt with clear instructions, such as: “If the user says ‘thank you’, ‘goodbye’, or ‘bye’, use the end_call tool to terminate the conversation.” [(1) ]() You can find more details here: [End call]()
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] End call](https://docs.retellai.com/build/single-multi-prompt/end-call) ​
t
When I test it with Retell in build Test call. its working fine. but whenever I call with a real number to the agent I am not getting all the responses. I get only call_inbound event Details: every call is made to the agent gets 3-4 api calls in the webhook. first : event:call_started second: event:call_ended last: event:call_analyzed These I am getting when I am testing in Test call in Retell. but Whenever I call from a real number. I get only call_stared event. I need to have all api calls
Hi @AI Evy When I test it with Retell in build Test call. its working fine. but whenever I call with a real number to the agent I am not getting all the responses. I get only call_inbound event Details: every call is made to the agent gets 3-4 api calls in the webhook. first : event:call_started second: event:call_ended last: event:call_analyzed These I am getting when I am testing in Test call in Retell. but Whenever I call from a real number. I get only call_stared event. I need to have all api calls
a
Thanks for the follow-up, @tahjib.leon. I'll get back to you soon.
### Answer When using Retell AI webhooks, you should receive the following events for a call: call_started, call_ended, and call_analyzed, each containing relevant call data [(1) ]() . The webhook payloads are sent as POST requests to your endpoint, and all three events are expected to be triggered in order for a normal call flow . If you are only seeing call_started when calling from a real number, but receive all events in the test environment, there may be an issue with how the call is being completed or with the webhook delivery for those specific events. Some things to check: - The webhook will retry up to 3 times if your endpoint does not return a 2xx status within 10 seconds . - If your webhook endpoint is not returning a success status for call_ended or call_analyzed, those events may not be delivered successfully . - The call_ended and call_analyzed events are only triggered after the call has completed and analysis is done . You can review the webhook setup guide for best practices on endpoint configuration and troubleshooting [(2) ]() : - [Webhook Overview]() - [Setup guide]() If your endpoint is working for test calls but not for real phone calls, review your webhook logs for delivery attempts and responses, and confirm that the real call is actually completing (not left open or disconnected abnormally) . Also, check if the phone number and agent are properly configured for inbound calls [(3) ]() . If you need further help, please provide details on your webhook endpoint responses for the real call case, and consider reviewing the webhook configuration steps in the docs above.
​ To learn more, see the sources I considered: [[1] Webhook Overview](https://docs.retellai.com/features/webhook-overview) [[2] Setup guide](https://docs.retellai.com/features/register-webhook) [[3] Inbound call webhook](https://docs.retellai.com/features/inbound-call-webhook) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
t
@AI Evy [ { "headers": { "host": "n8n.srv1001428.hstgr.cloud", "user-agent": "axios/1.11.0", "content-length": "161", "accept": "application/json, text/plain, */*", "accept-encoding": "gzip, compress, deflate, br", "content-type": "application/json", "x-forwarded-for": "100.20.5.228", "x-forwarded-host": "n8n.srv1001428.hstgr.cloud", "x-forwarded-port": "443", "x-forwarded-proto": "https", "x-forwarded-server": "e2eb6dedb48e", "x-real-ip": "100.20.5.228", "x-retell-signature": "v=1758224223211,d=143157342b85b7704d95ce79eebc5d44c7fa38210edf2f089dd4edfc0f61f22e" }, "params": {}, "query": {}, "body": { "event": "call_inbound", "call_inbound": { "agent_id": "agent_7f91c59c1c61c0738edaa2f850", "agent_version": 0, "from_number": "+14377778844", "to_number": "+14389059929" } }, "webhookUrl": "https://n8n.srv1001428.hstgr.cloud/webhook/5dfcc127-e8d2-4420-bf29-4352506b6e85", "executionMode": "production" } ] this is only response when I call it with a Real number
a
Thanks for the follow-up, @tahjib.leon. I'll get back to you soon.
### Answer If you are only receiving the call_inbound event when calling your Retell AI agent from a real phone number, but receive the full set of events (call_started, call_ended, call_analyzed) during test calls, this suggests a difference in how the call is being handled or completed in the live scenario. Make sure of the following: - Your webhook endpoint must return a 200 status code within the required timeout, or Retell AI will retry up to 3 times and may not proceed to further events if it does not receive a valid response [(1) ]() . - For inbound calls, if the webhook is not successful or does not respond as expected, Retell AI will retry up to 3 times. If all attempts fail, it checks for an inbound agent ID and either connects the call or disconnects it if none is set . - Ensure your phone number is properly configured with an inbound agent ID and the inbound webhook is enabled , [(2) ]() . - The call must be completed (not left open or disconnected abnormally) for call_ended and call_analyzed events to be triggered [(1) ]() . You can review your number and agent configuration using the [Get Phone Number API]() [(2) ]() . For further troubleshooting, review your webhook logs for delivery attempts and status codes, and ensure your endpoint handles all incoming POST requests correctly. If these steps do not resolve the issue, check your agent and number settings for any misconfiguration.
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] Inbound call webhook](https://docs.retellai.com/features/inbound-call-webhook) [[2] Get Phone Number](https://docs.retellai.com/api-references/get-phone-number) ​
3 Views