Search code examples
tokbox

Downloading/Fetching Client session metadata from tokbox Inspector


Given a session ID or for the last 10 sessions the Inspector tool provides interesting metrics regarding bitrate, packetloss and latency. Is there an existing API or a way in which we can download this information for each session ID?

Also would it be possible to fetch information of the sessions which are not the recent 10 via an API? If there's no API, is there a way I can log this information from each of the ClientEvent or ClientQos network requests to a database?


Solution

  • I am still learning Tokbox API. Currently, inspector is limited to 10 last sessions, and I never came across a method to call inspector using Tokbox API. Therefore, the best thing is to log the information by yourself.

    In GitHub example [https://github.com/opentok/opentok-network-test], Tokbox has mentioned that using network stat API information regarding the packet drops and audio/ video framerates can be fetched if you are using Tokbox media router. Tokbox js developer reference has the same information, which I copy pasted below. https://tokbox.com/developer/sdks/js/reference/Subscriber.html#getStats

    getStats(completionHandler)

    Returns the details on the subscriber stream quality, including the following:

    • Total audio and video packets lost

    • Total audio and video packets received

    • Total audio and video bytes received

    • Current video frame rate

    You should be able to save periodically the stats received by calling getStats() method to a database.

    I will publish an example, based on my free time.