Skip to main content
By default, the agent won’t end the call automatically. You’ll need to configure when and how the call should be terminated using the end call tool.
1

Add End Call Tool

Click ”+ Add” in the tools section and select “End Call” from the dropdown menu.
Adding end call tool
2

Configure Termination Conditions

Define specific conditions under which the call should be terminated. For example:
  • “If the user says ‘thank you’, ‘goodbye’, or ‘bye’, use the end_call tool to terminate the conversation.”
End Call dialog with a condition to hang up after resolving a delivery question, Custom SIP Headers outlined in blue with X-Ticket-ID set to the ticket_id dynamic variable, and Talk While Waiting enabled.

Set the end-call condition and optional custom SIP headers.

3

Update the Prompt

Enhance the agent’s understanding by incorporating the end call conditions into the prompt. Include specific instructions such as:“If the user says ‘thank you’, ‘goodbye’, or ‘bye’, use the end_call tool to terminate the conversation.”
Adding end call instructions to prompt

Custom SIP headers

For phone calls, add or edit the End Call tool and click Add under Custom SIP Headers. Enter a header name starting with X- or x-, then a static value or a dynamic variable, and save the tool. For example, use X-Ticket-ID with the value {{ticket_id}} to pass the ticket created during the conversation to your SIP system when the tool ends the call. You can also configure headers on End Call tools in subagent nodes. Headers are optional. See end-call SIP headers for allowed names, validation errors, and when the headers apply.

End a call using the API

The steps above configure the agent to hang up on its own. You can also work with call termination through the API:
  • Stop an ongoing call: Call Stop Call (POST /v2/stop-call/{call_id}) to immediately end a live call from your server.
  • Add the End Call tool programmatically: Include a tool with type: end_call in general_tools when you create or update a Retell LLM. This is equivalent to adding the tool in the dashboard.
  • Custom LLM integrations: If you bring your own LLM over WebSocket, set end_call: true in your response and Retell ends the call after the content is fully spoken. See the LLM WebSocket reference.