Logs showing ended reason "Assistant Ended Call" w...
# support
g
We have lots of calls in our logs that are only lasting 6-7 seconds before they randomly end with reason "Assistant Ended Call". Further inspection into the logs reveals the tool call like this:
Copy code
{
    "role": "tool_calls",
    "time": 1758636590435,
    "message": "",
    "toolCalls": [
        "0": {
            "id": "hook-function-call-c6dee378",
            "type": "function",
            "function": {
            "name": "endCall",
            "arguments": "{\"callEndedReason\": \"customer-ended-call\"}"
            }
        }
    ],
    "secondsFromStart": 11.016
}
The callEndedReason here is always: "customer-ended-call". Does this mean the customer hung up, and if so, why is the
Ended Reason
showing up as "Assistant Ended Call"? A few example Call SIDs: * fdd448fd-1776-4686-8b9c-df964c904690 * 136eba39-8c68-4cdd-90b4-ed323943e406 * 789b5c7a-0b16-44db-b036-d8bf0b542df6
v
Based on the documentation, when the assistant triggers the
endCall
tool—even if it passes `"callEndedReason": "customer-ended-call"`—the system records the ended reason as "Assistant Ended Call" because the assistant initiated the termination, not the customer directly. This can lead to logs showing "Assistant Ended Call" even if the underlying reason was a customer action. If you need the logs to reflect the customer's action more accurately, consider reviewing your assistant's logic to ensure it only calls
endCall
when appropriate, or contact Vapi support for clarification on log mapping ([Vapi Call Ended Reasons](https://docs.vapi.ai/calls/call-ended-reason)). Source: - [Call ended reasons](https://docs.vapi.ai/calls/call-ended-reason)
g
Why would the assistant end the call with reason "customer-ended-call" that doesn't make sense to me...
c
Hi Grant, there's an important distinction here: 1. The
endCall
function in your logs shows
customer-ended-call
as an argument 2. However, when the assistant uses the
endCall
function (regardless of the reason provided in arguments), the final call ended reason will be
assistant-ended-call
because the assistant actively executed the end call action Here are the relevant ended reason codes: - `assistant-ended-call`: The assistant intentionally ended the call based on the user's response - `customer-ended-call`: The customer (end human user) ended the call for both inbound and outbound calls[1](https://docs.vapi.ai/calls/call-ended-reason) In your case, since the assistant is executing the
endCall
function (even if trying to indicate a customer ended it), the system records this as
assistant-ended-call
. This is because from a system perspective, the assistant made the decision to end the call by executing the function. If the customer actually hung up themselves, you would see
customer-ended-call
without any assistant tool calls.
2 Views