Eric Alexandre
03/10/2025, 5:43 PMVapi Support Bot
03/10/2025, 5:45 PMendCall
function not working properly. Let's troubleshoot this issue:
First, I can see you've correctly included the endCall
tool in your tools array, which is good! Here are some things to check:
1. **Dashboard Configuration**: Ensure the endCallFunctionEnabled
parameter is set to true
in the VAPI dashboard [(source)](https://discord.com/channels/1211482211119796234/1211483291191083018/1313293840580612166).
2. **Function Parameters**: Verify that the endCall
function is being called with the correct parameters:
json
{
"callId": "your-call-id",
"reason": "Call completed",
"timestamp": "YYYY-MM-DDTHH:MM:SSZ"
}
[(source)](https://discord.com/channels/1211482211119796234/1211483291191083018/1305929557144240159)
3. **Trigger Implementation**: Make sure you're properly triggering the function in your code. Consider adding explicit triggers like detecting when a user says "goodbye" [(source)](https://discord.com/channels/1211482211119796234/1211483291191083018/1313293840580612166).
4. **Idle Messages**: Configure idle messages to detect when the user is silent for a few seconds, which can trigger the call end [(source)](https://discord.com/channels/1211482211119796234/1211483291191083018/1313293840580612166).
5. **Network/API Issues**: There might be network or API issues causing unreliability in call terminations. Check your logs for any error messages [(source)](https://discord.com/channels/1211482211119796234/1211483291191083018/1305929557144240159).
6. **Implementation Logic**: Review your code to ensure the function is triggered at the correct point in your logic and that all questions have been answered before calling it [(source)](https://discord.com/channels/1211482211119796234/1211483291191083018/1305929557144240159).
Let me know if any of these steps help resolve the issue or if you need more specific guidance!
Sources:Vapi Support Bot
03/10/2025, 5:45 PMEric Alexandre
03/11/2025, 1:17 PMKings Big
03/12/2025, 3:19 PMmarkdown
Your agent has the `endCall` tool configured in its settings, but it's not actively invoking the tool when it should hang up the call. This happens because:
1. The model needs to be explicitly instructed to use the `endCall` tool in the system prompt
2. The agent needs to know exactly when it should end the call
## The Solution
You need to update your system prompt to include explicit instructions about when and how to use the `endCall` tool. Here's how you should modify your setup:
1. Update your system prompt to include clear instructions about ending the call, including:
- When to end the call (specific scenarios)
- How to properly invoke the `endCall` tool
2. The format for calling the endCall tool should be included in the agent's response like this:
I'll help you with that. [Conversation content]
Now that we've completed our conversation, I'll end the call.
{
"tools": [
{
"type": "endCall",
}
]
}
In your systemPrompt, add instructions like these:
[Your existing prompt content]
IMPORTANT: When the conversation should end, such as after providing final information, answering the last question, or when the caller explicitly wants to end the call, you MUST use the endCall tool to hang up.
Make sure to clearly define scenarios when the call should end, such as:
- When the caller explicitly asks to end the call
- After delivering the requested information if no follow-up is needed
- When all tasks have been completed
Eric Alexandre
03/13/2025, 1:53 PM