ZeroBot.ai
06/19/2024, 6:59 PMVapi
06/19/2024, 7:00 PMVapi
06/19/2024, 7:01 PMmaxDurationSeconds
parameter to limit the call duration, this indeed restricts a single session to 1 hour. However, if the user opens multiple tabs, each tab is typically treated as a separate session.
To prevent a user from using beyond the given time across multiple sessions, you would need to implement a tracking system on your backend. This system would keep track of the total time the user has spent on calls and deduct it from their purchased time. Once the total allotted time is reached, you would then restrict the user from initiating new calls.
This could involve:
1. Generating a unique token for each purchase that is associated with the time purchased.
2. Recording the start and end time of each call session for the user.
3. Calculating the total time used and comparing it with the purchased time.
4. Disabling the user's ability to initiate a call once their purchased time is used up.
If you need assistance with implementing such a system or have any other questions, please let me know!Vapi
06/19/2024, 7:01 PMZeroBot.ai
06/19/2024, 7:36 PMmaxDurationSeconds
to the updated available time and keep all tabs in-sync?ZeroBot.ai
06/19/2024, 7:41 PMVapi
06/19/2024, 7:41 PMmaxDurationSeconds
parameter with the updated available time to ensure that all tabs remain in sync with the user's remaining time. To achieve this, you would need to:
1. Ensure that your backend is aware of the total time the user has left at any given moment.
2. When a new call is initiated from any tab, query your backend for the current remaining time.
3. Set the maxDurationSeconds
parameter for the new call based on the remaining time provided by your backend.
4. Use a mechanism like WebSockets or long polling to push updates to all open tabs if the available time changes (e.g., if a call ends and the remaining time is updated).
By doing this, each new call initiated from any tab will have the correct maxDurationSeconds
value that reflects the user's remaining time. Additionally, if you're using WebSockets or another real-time communication method, you can inform all active sessions to end the call if the user's total purchased time has been used up.
If you need further assistance with setting this up or have any other questions, feel free to ask!Sahil
06/19/2024, 9:47 PMSahil
06/19/2024, 9:47 PMZeroBot.ai
06/19/2024, 9:49 PMSahil
06/19/2024, 10:31 PMWilliham
08/14/2024, 4:45 PMSahil
08/14/2024, 5:44 PM