All the messages between the WebRTC endpoint and the Ingest REST API during the call are shown in the following figures, represented as sequence diagrams.
Before the webRTC endpoint initiates authentication procedure with callstats.io infrastructure, it must obtain a signed token provided by its own Authentication API. Please refer to Step 1 and Step 2 within this document.
At the beginning of the call, the service needs to be authenticated. When the authentication succeeds, a 'token' is sent back to the WebRTC endpoint. The received 'token' is then used for sending events and stats.
After the authentication process is completed, the endpoint initiates the monitoring process by a sending userJoined event along with the newly acquired 'token'. In case of success the response contains ucID. By acquiring ucID and 'token' the endpoint allowed to send events and stats.
Throughout the duration of the call the WebRTC endpoint is obligated to send userAlive event in every 10 seconds. For initiating the call the endpoint requires to send fabricSetup event.
Whenever a new media stream track appears, for example a new participant joins or a new media source is added, the SSRC map event MUST be sent. The newly added SSRC should be appended to the SSRC map rather than replacing the old SSRC
WebRTC endpoint can now send stats to REST API regularly and all the stats messages are acknowledged.
The WebRTC endpoint informs the REST API about the end of the call by sending fabricTermination event. After the event is acknowledged, the endpoint sends the userLeft event, which removes the user from the conference. Once the last participant sends the userLeft event, the conference is terminated.
Updated 5 months ago