Tracking Call Duration in Active Call
# support
z
Hi! We are working on integrating Vapi into ZeroBot and would like to know if theres a way to track the duration of a call while the call is active. We are planning to sell Minutes powered by Vapi and would like to end the call when the user runs out of Minutes. For now we're primarily focusing on integrating web calls and planning to integrate phone calls as well. Thank you! https://cdn.discordapp.com/attachments/1252629008407855227/1252629008638545963/Screenshot_2024-06-18_at_10.18.05_AM.png?ex=6672e92c&is=667197ac&hm=2baf188e53cb2921013c3b00674d3ee4c0e35106a6fa3700de885309aa869986&
v
message has been deleted
@ZeroBot.ai Hello! It's great to hear that you're integrating VAPI into ZeroBot. Yes, you can track the duration of a call while it's active. VAPI provides real-time call event webhooks that you can use to monitor the status and duration of calls. You can set up a webhook to listen for call progress events and then use that information to track the call duration. When a user is about to run out of minutes, you can programmatically end the call using VAPI's call control features. You would need to implement logic in your application that checks the user's remaining minutes against the call duration and then sends a command to end the call when the minutes are exhausted. For web calls, you can use similar mechanisms provided by the VAPI for web-based communication. Make sure to handle the logic for both web and phone calls to ensure a seamless experience for your users. If you need more detailed information on how to set this up or if you have any specific questions about the implementation, please let me know!
You can continue this conversation by mentioning me in the message.
z
Great, could you provide a link for documentation or information on how to set up a webhook that ends the call when the minutes are exhausted?
@Vapi
v
@ZeroBot.ai Please ask support for more info on this.
s
Can you elaborate more on your use case?
z
I realized there is a maxDurationSeconds parameter, I think this is the solution! 🙂
s
Yup.
9 Views