endcallmessage not working
# support
b
how do u get your assistant to say a message when the maximum duratino you set for the call (say 10 seconds) is up. Like i'd want the assistant when the time is up to say "have a nice day" Can i do this within the vapi webapp?
v
@beta1 Yes, you can achieve this within the VAPI webapp by setting up a timer or a scheduled event that triggers when the maximum duration for the call is reached. You would need to implement logic in your application to track the call duration and then use the
.send()
method to send a message to the assistant to say "Have a nice day" when the 10-second duration is up. Here's a general outline of how you could set this up: 1. Start a timer when the call begins. 2. Check the timer to see if 10 seconds have passed. 3. When the timer reaches 10 seconds, use the
.send()
method to instruct the assistant to say the message. Would you like to proceed with setting this up, or do you need further assistance with the implementation details?
You can continue this conversation by mentioning me in the message.
b
yes where do i do that within the webapp do i need to code that?
^need an answer on this
s
@beta1 The assistant doesn't track call duration. Instead, you need to track the call duration yourself and use live call control to play messages and end calls or perform other required actions. You can learn more about this functionality from here https://docs.vapi.ai/calls/call-features and about API spec from here https://api.vapi.ai/api-json#