End call that is dialing
# support
n
Hi, I am trying to end call that is dialing. The endCall function does not work.
v
To end a call that is still dialing, ensure you are using the correct API method to cancel the call and check for the
manually-canceled
ended reason.
For example, if using an API, you might send a request like:
Copy code
json
PATCH /calls/<call_id>
{
  "status": "canceled"
}
If the call does not end, review the call logs for
endedReason
values such as
manually-canceled
or any call start errors to diagnose the issue further
(see the [Call ended reasons documentation](https://docs.vapi.ai/calls/call-ended-reason)). Source: - [Call ended reasons documentation](https://docs.vapi.ai/calls/call-ended-reason)
z
If the call is still dialing / ringing, endCall() (the assistant tool) often won’t fire because the assistant isn’t “in-call” yet — it’s meant for ending an active conversation once the assistant is connected. Real fix (works while dialing): cancel the call via the Calls API using the callId you got from “Create Call”. Vapi supports cancelling a scheduled/ongoing outbound attempt with: DELETE https://api.vapi.ai/call/:id (This is the recommended way to cancel a call attempt from your backend/app, instead of relying on the model tool.) Example (curl): curl -X DELETE "https://api.vapi.ai/call/" \ -H "Authorization: Bearer " If you want to double-check you’re targeting the right call, first GET the call and confirm its status/state, then DELETE it.
n
This is really useful, thank you. Am I able to use this API to cancel in-progress calls, or should I keep using
endCall()
tool just for in-progress calls? (note, I dont need AI to say goodbye, I just want to finish the call as quickly as possible).
z
Yes you can use the DELETE /call/:id endpoint even if the call is already in progress. If you just want the call to stop immediately (no AI goodbye, no extra delay), the API cancel is actually the better option. It ends the call at the system level right away.
n
From what I understand DELETE /call/:id deletes call logs with that, which is not the behaviour I would like to have. I just would like to end call (no AI goodbye, no extra delay, + during dialing) without deleting the logs, is this possible in Vapi?
z
ok then keep using keep using endCall() for your system
n
but then we are back to square one, with
end-call
control message I am unable to end call that is dialing + AI says goodbye and extra delay. It would be really great if there was an API call that we (clients) can make to end call instantly, that would end call on Twilio side instantly and shutdown all of the Vapi LLM setup. Does not seem to be so complicated either, when endCall() exists already.
seems like someone else had the same issue but it doesnt seem to be addressed - https://vapi.ai/community/m/1390391007387975750
c
can you please share your call id so we can investigate it more
n
Here is an example calle -
019cbcf4-c404-7ee4-a624-52290e259793
I made two
end-call
control message calls, 1st one during dialing which resulted in timeout (Vapi server did not respond with anything from >5s) and 2nd during Voicemail which worked because the call has been picked up.
c
Hi, We identified the root cause of the issue. The end-call message was being routed through the
sayQueue
, which is a serial queue with concurrency set to 1. During dialing, the first message task could block this queue because it waits for a
bot-end
event that may never fire when the transport connection is not fully established. As a result, the end-call request remained stuck waiting behind it. Our team has implemented a fix (PR #10400): 1. Primary fix: The end-call action now bypasses the
sayQueue
entirely and directly triggers call termination. This ensures the call can end regardless of the speech queue state. 2. Additional safeguard: Hang detection for the
sayQueue
has been improved. If the queue becomes stuck, it will now automatically resolve after 10 seconds instead of only logging a warning. This should prevent similar blocking issues going forward. Best regards, Oshi Customer Support Team | Vapi
n
This is extremely useful, just what I was hoping for, thank you for your and devs support on this! I have tried end-call ing dialing call just now, and I was not able to, getting no reply from the Vapi's control url. Could you please let me know when that PR gets merged and released, as it seems like it hasnt yet?
c
At the moment, we don’t have a specific timeline to share for this. We’ll keep you updated as soon as we have more information. Thank you for your patience.
n
No problem, thank you for keeping me updated. I will be awaiting your update!