How to end the call if customer speak in any other...
# support
t
I have an agent who can only talk in English, but if a customer starts to speak in any other language, I want an agent to say I can only understand English, and if a customer still speaks in another language, then I want to end the call
v
To achieve this, add the
endCall
tool to your assistant's configuration and implement logic to detect non-English speech. When a non-English language is detected, have the agent say "I can only understand English." If the customer continues in another language, trigger the
endCall
function:
Copy code
json
"tools": [
  { "type": "endCall" }
]
You'll need to handle language detection in your prompt or via a custom function, as Vapi does not provide built-in language detection. Source: - [Default Tools – End Call](https://docs.vapi.ai/tools/default-tools#end-call)
k
Use prompt engineering to call the endCall tool when non-English language is detected
k
Configure with a multilingual transcriber, use a function to detect if the input isn’t English, respond with “I can only understand English,” and end the call if the user continues in another language.