Objective
Calculating usage for billing purposes with the Session Monitoring API.
Applies To
- Session Monitoring API
- Billing
- Usage
- Video API
Procedure
To track and maintain call logs, you need to have a database of all the calls happening on a particular API key. For this, you can use the Session Monitoring API on the server side. On the server, the app will get all the events happening on clients, allowing logging for billing and other purpose.
On the client side, you have the following options:
An alternative to using Session Monitoring, or as a redundant method, is to log the events using AJAX calls from you clients to your server and have your server persist the event data.
You can listen to the Connection and Stream Events in your client application. These events are fired by the Tokbox APIs as and when they happen. Your application can log the time when the connection was created or destroyed and when the publisher started or stopped streaming in the application (through StreamCreated Event).
- ConnectionEvent - When the user creates or destroys the connection.
- StreamEvent - These events are dispatched by the Session object when another client starts or stops publishing a stream to a session.
- StreamDestroyed - The Publisher object dispatches a streamDestroyed event when it stops streaming to the session.
- Detecting when Clients have connected or disconnected
Using these APIs you can track the total minutes the two users are connected to each other. Post monitoring and capturing the data, the users can send the information to your hosted server. Or they can keep the information logged with themselves and send them in batches to your server.
Articles in this section
- Meetings API - Migration Options
- How to use Experience Composer
- Video API (in unified environment) Trial
- Does Vonage Video API have code samples available?
- Where do I find documentation on Vonage Video API?
- Do you have any sample apps or demos for Vonage Video API?
- How can I quickly build a Video API prototype?
- How can I build a web-to-mobile interoperable app with the Video API?
- How to Access the Live Chat with Support Agent
- How can I build a multi-party conferencing app?