Agent doens't end call
# support
o
Hey 🙂 I'm calling the agent via the api and I'm curious why it's not ending the call after saying goodbye. I would expect that the agent recognizes that and ends the call from its side. Here is my call Id
61b80194-c949-48fd-966d-a52fec5f37eb
these fields are added to my call:
Copy code
json
"endCallMessage": 
"Danke für dein Interesse! Bis Bald!",
"endCallPhrases": 
[
"Danke fürs Gespräch! Ciao"
],
"clientMessages": 
[
"transcript",
"hang",
"speech-update",
"metadata",
"conversation-update",
"tool-calls",
"tool-calls-result"
],
"serverMessages": 
[
"end-of-call-report",
"status-update",
"hang",
"tool-calls"
],
v
Hey there! 😊 It sounds like you're experiencing an issue with the call not ending after the agent says goodbye. Here are a few things to check that might help resolve this: 1. **End Call Functionality**: Ensure that the
endCallFunctionEnabled
is set to true in your configuration. This setting allows the call to end correctly after the goodbye message is delivered. 2. **End Call Phrases**: Make sure that the phrases in your
endCallPhrases
array are being recognized by the system. If the agent doesn't detect the phrase "Danke fürs Gespräch! Ciao," it won't trigger the end call function. 3. **Check for Repetition**: If the agent is repeating goodbye messages, it might be due to the configuration. You can adjust the logic to prevent redundancy, which can help the call end more smoothly. 4. **Silence Handling**: If the caller doesn't respond, ensure that your system is set to detect silence and trigger a hang-up after a certain duration. 5. **Logs and Errors**: Review your server logs for any errors or messages that might indicate why the call isn't terminating as expected. If you've checked all these and the issue persists, it might be worth looking into the specific configurations or reaching out for further assistance. Let me know if you need more help! 😊 Sources: - [Expected Behaviors of Vapi Voice AI Platform](https://discord.com/channels/1211482211119796234/1211483291191083018/1313293840580612166) - [Handling Call Termination After End Call Message](https://discord.com/channels/1211482211119796234/1211483291191083018/1336004944150401166) - [Troubleshooting Steps for Unexpected Call Termination](https://discord.com/channels/1211482211119796234/1211483291191083018/1334114042876264518)
k
Vapi automatically includes several date-related variables by default:
Copy code
// These variables are automatically available:
{
  now: "Apr 30, 2024, 11:30 AM",  // Current date and time
  date: "Apr 30, 2024",           // Current date
  time: "11:30 AM",               // Current time
  year: "2024",                   // Current year
  month: "April",                 // Current month
  day: "30"                       // Current day
}
In your assistant configuration, use the Liquid template syntax to reference these variables:
Copy code
//example

Hello! Today is {{date}} and the current time is {{time}}.
For Berlin timezone
Copy code
Hello! In Berlin, it's now {{'now' | date: '%b %d, %Y, %I:%M %p', 'Europe/Berlin'}}
Note: The syntax you tried had incorrect curly braces. The correct format is {{'now' | date: '%b %d, %Y, %I:%M %p', 'Europe/Berlin'}} (double curly braces with single quotes around 'now').
o
hey @Shubham Bajaj thanks for responding but this is not answering the actuall question?
s
@Onur Sorry I mixed up your ticket with someone else, who has now your answer 😇
o
hahah no worries maybe you can share it again here
s
transcript
AI: Hi and only, this is Nadja from GO2 KI. Nice to reach you.\nUser: Hi.\nAI: I'm speaking to the person responsible for the at Banana Peak GmbH,\nUser: Yes. Exactly, that's me.\nAI: So. To make cold calls better and more efficient. Is it right now for a short conversation? Or would another time be better?\nUser: Yes, that's fine. We can do that.\nAI: Great, thank you. Many companies have difficulty making cold calls efficiently. Often important follow-ups are forgotten or there is no clear system for turning calls into real deals.\n "endCallMessage": "Danke für dein Interesse! Bis Bald!", "endCallPhrases": ["Danke fürs Gespräch! Ciao"], @Onur can you check the call ID again because I don't see model generating end call phrase. Correct me if I am wrong!! https://cdn.discordapp.com/attachments/1345749919302156381/1346917215634718740/Screenshot_2025-03-06_at_12.17.27_AM.png?ex=67c9ede8&is=67c89c68&hm=3c5472d79fab2027c480c4bfd2d548dc15c845166b2343d9a20f64d71ce5a85d&
o
hey @Shubham Bajaj here a fresh id
bd11e734-5e27-4c04-9de5-ee6ec9ad9190
where I try to say goodbye several times but the agent is not edning the call even after saying goodbye by herself
k
"transcript": "AI: Hi Onur, hier ist Nadja von GO2 KI. Schön, dass ich dich erreiche.\\nUser: Hi, ich hab leider kein Interesse. Zu dir.\\nAI: Verstehe, Onur. Falls sich euer Bedarf in der Zukunft ändern sollte, können wir uns gerne später noch mal austauschen. Darf ich mich in ein paar Monaten nochmals bei dir melden?\\nUser: Nein, danke. Ich hab wirklich kein Interesse.\\nAI: Alles\\nUser: Schönen Tag noch.\\nAI: Danke dir ebenfalls, mach's gut.\\nUser: Auf Wiedersehen.\\nAI: Auf Wiedersehen und nur.\\n", "endCallPhrases": \["Danke fürs Gespräch! Ciao"\], @Onur the agent has to say the exact phrase to trigger the end call function. As you can see in the transcript the agent never voiced out your end call phrases keyword.
o
@Shubham Bajaj yeah thats our problem doenst the endCallPhrase tell the agent do say exactly that phrase? So do we have to add this to the prompt?
okay it worked out after adding it to the prompt thansk @Shubham Bajaj
k
Glad to hear it worked for you. If you need any more help we'll be here!