Alexve
03/13/2025, 7:34 PMVapi Support Bot
03/13/2025, 7:35 PMjson
{
"model": {
"provider": "openai",
"model": "gpt-4o-mini",
"tools": [
{
"type": "endCall"
}
]
}
}
### 2. For your prompt instructions, be explicit and use function calling syntax:
Instead of just mentioning the tool in your instructions, try using more explicit language that triggers the model to use function calling:
When the conversation should end, you MUST call the endCall function directly without explaining that you're doing so. Do not say "I'll end the call now" or similar phrases - just call the function.
### 3. Common issues to check:
- Make sure endCallFunctionEnabled
is set to true in your dashboard
- The model might log the function call but not actually end the call if parameters aren't passed correctly
- Check for conflicts with other tool calls that might be preventing execution
### 4. Example implementation:
When implementing the endCall function, you might need to structure it with parameters like:
json
{
"callId": "your_call_id",
"reason": "User finished interaction",
"timestamp": "2023-04-14T12:34:56Z"
}
If you're still having issues, you might need to check your implementation code. Here's a sample code snippet for invoking the endCall tool:
```bash
# Assuming you have a defined CALL_ID for the current conversation
CALL_ID="your_call_id"
CONTROL_URL="https://aws-us-west-2-production1-phone-call-websocket.vapi.ai/$CALL_ID/control"
# First send any final message
curl -X POST "$CONTROL_URL" \
-H 'content-type: application/json' \
--data-raw '{
"type": "add-message",
"message": {Vapi Support Bot
03/13/2025, 7:35 PMAlexve
03/13/2025, 7:41 PMcw
03/13/2025, 8:00 PMAlexve
03/13/2025, 9:06 PMAlexve
03/13/2025, 9:29 PMVapi Support Bot
03/13/2025, 9:31 PMassistantOverrides
section
4. Within this section, you'll find the endCallPhrases
parameter where you can specify the phrases
Here's an example of how the configuration should look:
json
{
"assistantOverrides": {
"endCallPhrases": [
"you've reached",
"press 0 for",
"to speak to a representative"
]
}
}
These phrases are designed to help your assistant automatically end calls when it detects specific phrases (like those from auto-attendants), which can save you minutes when dealing with automated systems.
After adding or modifying the phrases, make sure to save your configuration and test it to ensure it works as expected!
Note that the exact UI navigation might vary slightly depending on platform updates, but the configuration parameter remains the same.
Source:
- [Vapi Discord](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1334188247676358656)Sahil
03/14/2025, 3:53 AMFrikster
03/15/2025, 3:46 PM{
"model": {
"provider": "openai",
"model": "gpt-4o-mini",
"tools": [
{
"type": "endCall"
}
]
}
}
This does not work. When I create an agent using this as the payload the created agent still has the endCall toggle switched off and when I talk to it it cannot end the call
https://cdn.discordapp.com/attachments/1349827929571590234/1350495431502856277/image.png?ex=67d6f261&is=67d5a0e1&hm=02fbe9a65ed3228dd22f405fa07d2285367a40c4c57f8b8e692761c0f26b9a25&Frikster
03/15/2025, 3:49 PMFrikster
03/15/2025, 3:49 PMFrikster
03/15/2025, 3:50 PMSahil
03/15/2025, 4:14 PM