endCall is not called upon
# support
s
I have this simple prompt 'After first message you will use the endCall function.' but the bot is not calling endCall function when 'endCallFunctionEnabled' is enabled too.
v
You can continue this conversation by mentioning me in the message.
@Shahzad I'm here to help you with that. Could you please provide me with the exact phrases or conditions that should trigger the
endCall
function? Additionally, if there's a specific message you'd like the assistant to say before ending the call, please let me know.
s
I want the bot should speak 'We are not available for now' and end the call.
@Vapi
v
@Shahzad Certainly! To proceed, I'll need to know the name of the function that is used to make the bot speak. Once I have that information, I can help you set up the bot to say "We are not available for now" and then end the call using the
endCall
function. Could you please provide me with the name of the function or any additional details required to implement this?
s
you can simply invoke this statement @Vapi and I will adjust it into my system.
v
@Shahzad Understood. Here's the statement you can use to invoke the bot to say "We are not available for now" and then end the call:
Copy code
plaintext
We are not available for now. Ending the call now.
You can integrate this statement into your system where the
endCall
function is triggered when the
endCallFunctionEnabled
is set to true. If you need further assistance with the integration or have any more questions, feel free to ask!
s
@Vapi but this endCall is an in-built function isnit? I should be able to just mention it in the prompt to execuite it.
v
@Shahzad I apologize for any confusion. If
endCall
is an in-built function in your system and it is enabled, you should indeed be able to execute it by mentioning it in the prompt. Here's the statement that should trigger the
endCall
function: "We are not available for now." Please ensure that this phrase is included in the
endCallPhrases
array in your system to trigger the call to end. If you have any further questions or need additional assistance, feel free to reach out.
s
@Vapi I just did it like this "endCallPhrases": [ "HI, We are not available at the moment, you can contact us during the office timing. Good bye." ] } but still not disconnecitng itself.
v
@Shahzad I understand the issue now. To ensure that the
endCall
function is executed properly, the phrase spoken by the bot must exactly match one of the phrases listed in the
endCallPhrases
array. Since you've set the phrase to: "HI, We are not available at the moment, you can contact us during the office timing. Good bye." The bot must say this exact phrase to trigger the end of the call. If it's still not disconnecting, please double-check that the
endCallFunctionEnabled
is indeed set to true and that there are no other conditions or configurations that might be preventing the function from executing. If everything seems to be configured correctly and it's still not working, it might be a good idea to ask support for more info on this, as there could be an issue with the system that needs to be addressed.
s
Here is my full bot json { "name": "Sofia", "transcriber": { "language": "en-AU", "provider": "deepgram", "model": "nova-2" }, "model": { "provider": "openai", "model": "gpt-4o-mini", "temperature": 0, "systemPrompt": "After first message Sofia will use the endCall function to end the call.", "maxTokens": 200, "knowledgeBase": { "provider": "canonical", "topK": 1, "fileIds": [ "bb7108e7-b4c1-40c1-aef5-4396d735336f", "536eda28-e9d7-4a2c-950d-20378f169bd6", "1846cc44-fce3-46e7-84cf-4e79cf60f335", "8d7624cd-5f06-400f-b2e5-40da0347cafb" ] }, "tools": [], "emotionRecognitionEnabled": true }, "voice": { "provider": "11labs", "voiceId": "paula" }, "firstMessageMode": "assistant-speaks-first", "recordingEnabled": true, "endCallFunctionEnabled": true, "silenceTimeoutSeconds": 20, "backgroundSound": "off", "backchannelingEnabled": false, "firstMessage": "HI, We are not available at the moment, you can contact us during the office timing. Good bye.", "endCallMessage": "Have a great day", "endCallPhrases": [ "HI, We are not available at the moment, you can contact us during the office timing. Good bye." ] }
@Vapi
v
@Shahzad Thank you for providing the full bot JSON configuration. Based on the information you've provided, it seems that everything is set up correctly for the
endCall
function to be triggered after the first message is spoken by the bot. However, if the call is still not ending as expected, there might be an issue outside of the configuration that's preventing the
endCall
function from executing. This could be due to a variety of reasons such as a bug in the system, an issue with the voice API provider, or a misconfiguration elsewhere in the system. Since I am unable to directly troubleshoot or fix potential bugs in the system, I would recommend reaching out to the support team for your voice API provider or checking the system logs for any errors that might indicate what's going wrong. If there's anything else I can assist you with, please let me know!
s
@Sahil can you look into this please ?
s
@Shubham Bajaj
s
@Shahzad can you share the call id?
s
Well I have tried many calls but check these 474eebdd-af83-4bcf-8b64-acb7155605a2 e34d3341-0cb1-43a6-8bc1-0ca4527517da
s
This won't work:
After first message Sofia will use the endCall function to end the call.
set first message to empty and then first message mode to model generated message and add the following:
trigger the endCall function
If this doesn't works let the user speaks and then trigger the end call function.
s
ok let me try this
So "trigger the endCall function" be the first message ?
I got it worked 'Somehow' 🙂
s
no it has to be your assistant prompt.
8 Views