https://retellai.com/?utm_source=discord&utm_medium=seo logo
I'm stuck with the end_call during conversation pr...
# ❓・ai-evy-support
o
@AI Evy I'm stuck with the end_call during conversation problem: User: Let me transfer you to the operator. 0:44 Agent: Thanks for your help! I'll wait for the operator. 0:47 Tool Invocation: end_call tool_call_id: ba2353aa69dbce52 { "execution_message": "Thanks for your help! I'll wait for the operator." } It's happening with my all voice agents, what could be the reason?
a
Thanks for tagging me @osama_76272. I'll look through relevant sources and get back to you shortly.
### Answer Looking at your logs, the agent is correctly invoking the
end_call
function when the user mentions transferring to an operator [(1) ]() . This behavior suggests the agent is interpreting the transfer request as a signal to end the call. The issue appears to be with your function calling configuration or prompt instructions. Based on the documentation, when implementing function calling with OpenAI models, the LLM will either give a tool call or a text response, but not both . Here are potential causes and solutions: 1. Function Definition Issue Your
end_call
function may be too broadly defined. The documentation shows that functions should have clear, specific parameters . Make sure your function definition includes a
message
parameter so the agent can deliver a proper goodbye before ending . 2. Prompt Instructions Community discussions suggest structuring end call instructions clearly [(2) ]() : - When the conversation comes to an end or the user says "bye": 1. Say "have a great rest of your day". 2. Use "end_call" tool to end the call - Structuring with numbered steps usually helps 3. Transfer vs End Call Logic The agent shouldn't end the call when a user requests a transfer. You may need to implement a separate
transfer_call
function instead of using
end_call
for transfer scenarios [(3) ]() . 4. Global vs Node-Specific Configuration Consider whether you have
end_call
set as a global function when it should be node-specific, or vice versa [(2) ]() . You can also set max call duration and max silence duration as fallback
s . Check your function definitions and prompt instructions to ensure the agent only calls
end_call
when the conversation naturally concludes, not when transfers are requested.
​ To learn more, see the sources I considered: [[1] Integrate Function Calling](https://docs.retellai.com/integrate-llm/integrate-function-calling) [[2] Discord message from @sanava.ai on 2025-03-14](https://discord.com/channels/1186424376300679209/1294891368505937952/1350213549460553779) [[3] Debug call disconnection](https://docs.retellai.com/reliability/debug-call-disconnect) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.