OpenVidu CDR
OpenVidu Server offers a CDR logging system, so you can easily keep record of every session and its internal behavior. To start OpenVidu Server with CDR enabled, set configuration property OPENVIDU_CDR=true. The CDR file location is given by configuration property OPENVIDU_CDR_PATH (default to /opt/openvidu/cdr).
The CDR file is a plain UTF-8 text file complying with JSON Lines format: one standard JSON entry for each line. All JSON entries have the following structure:
{"EVENT_NAME": {"sessionId": "SESSION_ID", "timestamp": TIMESTAMP, "PROP_1": "VAL_1","PROP_2": "VAL_2", ... }}
So every entry is a JSON object with a single key (the event name) and a JSON object as value (the event content). For all available events, the event content always has as properties the sessionId identifying the video-session (that would be SESSION_ID in the example above) for which the event was registered and the timestamp (with fake value TIMESTAMP in the example above). Besides this two common properties shared by all events, there are custom properties for every specific event with useful information (those would be PROP_1, PROP_2 ...). The complete list of possible JSON entries is available below.
Events in OpenVidu CDR 🔗
- sessionCreated
- sessionDestroyed
- participantJoined
- participantLeft
- webrtcConnectionCreated
- webrtcConnectionDestroyed
- recordingStatusChanged
- filterEventDispatched
sessionCreated 🔗
Recorded when a new session has been created.
| Property | Description | Value |
|---|---|---|
sessionId |
Session for which the event was triggered | A string with the session unique identifier |
timestamp |
Time when the event was triggered | UTC milliseconds |
Example:
{"sessionCreated":{"sessionId":"fds4e07mdug1ga3h","timestamp":1538481330577}}
sessionDestroyed 🔗
Recorded when a session has finished.
| Property | Description | Value |
|---|---|---|
sessionId |
Session for which the event was triggered | A string with the session unique identifier |
timestamp |
Time when the event was triggered | UTC milliseconds |
startTime |
Time when the session started | UTC milliseconds |
duration |
Total duration of the session | Seconds |
reason |
Why the session was destroyed | ["lastParticipantLeft","sessionClosedByServer","openviduServerStopped"] |
Example:
{"sessionDestroyed":{"sessionId":"fds4e07mdug1ga3h","timestamp":1538481699154,"startTime":1538481330577,"duration":368,"reason":"lastParticipantLeft"}}
participantJoined 🔗
Recorded when a user has connected to a session.
| Property | Description | Value |
|---|---|---|
sessionId |
Session for which the event was triggered | A string with the session unique identifier |
timestamp |
Time when the event was triggered | UTC milliseconds |
participantId |
Identifier of the participant | A string with the participant unique identifier |
location |
Geo location of the participant PRO |
A string with format "CITY, COUNTRY" (or "unknown") |
platform |
Complete description of the platform used by the participant to connect to the session | A string with the platform description |
clientData |
Metadata associated to this participant from the client side. This corresponds to parameter metadata of openvidu-browser method Session.connect |
A string with the participant client-side metadata (generated when calling Session.connect method) |
serverData |
Metadata associated to this participant from the server side. This corresponds to parameter data of REST API operation POST /api/tokens or its Java/Node server SDKs variants |
A string with the participant server-side metadata (generated with the token) |
Example:
{"participantJoined":{"sessionId":"ses_SuXO99zeb1","timestamp":1584008771500,"participantId":"con_ZTMYOmVuZB","location":"Berlin, Germany","platform":"Chrome 80.0.3987.132 on Linux 64-bit","clientData":"Mike","serverData":"{'user': 'client1'}"}}
participantLeft 🔗
Recorded when a user has left a session.
| Property | Description | Value |
|---|---|---|
sessionId |
Session for which the event was triggered | A string with the session unique identifier |
timestamp |
Time when the event was triggered | UTC milliseconds |
participantId |
Identifier of the participant | A string with the participant unique identifier |
location |
Geo location of the participant PRO |
A string with format "CITY, COUNTRY" (or "unknown") |
platform |
Complete description of the platform used by the participant to connect to the session | A string with the platform description |
clientData |
Metadata associated to this participant from the client side. This corresponds to parameter metadata of openvidu-browser method Session.connect |
A string with the participant client-side metadata (generated when calling Session.connect method) |
serverData |
Metadata associated to this participant from the server side. This corresponds to parameter data of REST API operation POST /api/tokens or its Java/Node server SDKs variants |
A string with the participant server-side metadata (generated with the token) |
startTime |
Time when the participant joined the session | UTC milliseconds |
duration |
Total duration of the participant's connection to the session | Seconds |
reason |
How the participant left the session | ["disconnect","forceDisconnectByUser","forceDisconnectByServer","sessionClosedByServer","networkDisconnect","openviduServerStopped"] |
Example:
{"participantLeft":{"sessionId":"ses_SuXO99zeb1","timestamp":1584009224993,"startTime":1584008771500,"duration":453,"reason":"disconnect","participantId":"con_ZTMYOmVuZB","location":"Berlin, Germany","platform":"Chrome 80.0.3987.132 on Linux 64-bit","clientData":"Mike","serverData":"{'user': 'client1'}"}}
webrtcConnectionCreated 🔗
Recorded when a new media stream has been established. Can be an "INBOUND" connection (the user is receiving a stream from a publisher of the session) or an "OUTBOUND" connection (the user is a publishing a stream to the session).
| Property | Description | Value |
|---|---|---|
sessionId |
Session for which the event was triggered | A string with the session unique identifier |
timestamp |
Time when the event was triggered | UTC milliseconds |
participantId |
Identifier of the participant | A string with the participant unique identifier |
connection |
Whether the media connection is an inbound connection (the participant is receiving media from OpenVidu) or an outbound connection (the participant is sending media to OpenVidu) | ["INBOUND","OUTBOUND"] |
receivingFrom |
If connection is "INBOUND", the participant from whom the media stream is being received |
A string with the participant (sender) unique identifier |
audioEnabled |
Whether the media connection has negotiated audio or not | [true,false] |
videoEnabled |
Whether the media connection has negotiated video or not | [true,false] |
videoSource |
If videoEnabled is true, the type of video that is being transmitted |
["CAMERA","SCREEN"] |
videoFramerate |
If videoEnabled is true, the framerate of the transmitted video |
Number of fps |
videoDimensions |
If videoEnabled is true, the dimensions transmitted video |
String with the dimensions (e.g. "1920x1080") |
Example:
{"webrtcConnectionCreated":{"sessionId":"fds4e07mdug1ga3h","timestamp":1538481419726,"participantId":"ges2furjsjjmyi0b","connection":"INBOUND","receivingFrom":"wsalcr1r72goj8sk","videoSource":"CAMERA","videoFramerate":30,"videoDimensions":"{\"width\":640,\"height\":480}","audioEnabled":true,"videoEnabled":true}}
webrtcConnectionDestroyed 🔗
Recorded when any media stream connection is closed.
| Property | Description | Value |
|---|---|---|
sessionId |
Session for which the event was triggered | A string with the session unique identifier |
timestamp |
Time when the event was triggered | UTC milliseconds |
participantId |
Identifier of the participant | A string with the participant unique identifier |
connection |
Whether the media connection is an inbound connection (the participant is receiving media from OpenVidu) or an outbound connection (the participant is sending media to OpenVidu) | ["INBOUND","OUTBOUND"] |
receivingFrom |
If connection is "INBOUND", the participant from whom the media stream is being received |
A string with the participant (sender) unique identifier |
audioEnabled |
Whether the media connection has negotiated audio or not | [true,false] |
videoEnabled |
Whether the media connection has negotiated video or not | [true,false] |
videoSource |
If videoEnabled is true, the type of video that is being transmitted |
["CAMERA","SCREEN"] |
videoFramerate |
If videoEnabled is true, the framerate of the transmitted video |
Number of fps |
videoDimensions |
If videoEnabled is true, the dimensions transmitted video |
String with the dimensions (e.g. "1920x1080") |
startTime |
Time when the media connection was established | UTC milliseconds |
duration |
Total duration of the media connection | Seconds |
reason |
How the WebRTC connection was destroyed | ["unsubscribe","unpublish","disconnect","forceUnpublishByUser","forceUnpublishByServer","forceDisconnectByUser","forceDisconnectByServer","sessionClosedByServer","networkDisconnect","openviduServerStopped","mediaServerDisconnect"] |
Example:
{"webrtcConnectionDestroyed":{"sessionId":"fds4e07mdug1ga3h","timestamp":1538481449060,"startTime":1538481419726,"duration":29,"reason":"disconnect","participantId":"ges2furjsjjmyi0b","connection":"INBOUND","receivingFrom":"wsalcr1r72goj8sk","videoSource":"CAMERA","videoFramerate":30,"videoDimensions":"{\"width\":640,\"height\":480}","audioEnabled":true,"videoEnabled":true}}
recordingStatusChanged 🔗
Recorded when the status of a recording has changed. The status may be:
started: the session is being recorded. This means the associated video(s) already exists and its size is greater than 0. NOTE: when using COMPOSED recording with video, this event does not mean there are publisher's streams being recorded in the video file. It only ensures the video file exists and its size is greater than 0stopped: the recording process has stopped and files are being processed. The recording entity's duration and size properties will still be set to 0.ready: the recorded file has been successfully processed and is available for download. The recording entity's duration and size properties are properly defined nowfailed: the recording process has failed. The final state of the recorded file cannot be guaranteed to be stable
| Property | Description | Value |
|---|---|---|
sessionId |
Session for which the event was triggered | A string with the session unique identifier |
timestamp |
Time when the event was triggered | UTC milliseconds |
startTime |
Time when the recording started | UTC milliseconds |
id |
Unique identifier of the recording | A string with the recording unique identifier |
name |
Name given to the recording file | A string with the recording name |
outputMode |
Output mode of the recording (COMPOSED or INDIVIDUAL) |
A string with the recording output mode |
hasAudio |
Wheter the recording file has audio or not | [true,false] |
hasVideo |
Wheter the recording file has video or not | [true,false] |
recordingLayout |
The type of layout used in the recording. Only defined if outputMode is COMPOSED and hasVideo is true |
A RecordingLayout value (BEST_FIT, PICTURE_IN_PICTURE, CUSTOM ...) |
resolution |
Resolution of the recorded file. Only defined if outputMode is COMPOSED and hasVideo is true |
A string with the width and height of the video file in pixels. e.g. "1280x720" |
size |
The size of the video file. 0 until status is stopped | Bytes |
duration |
Duration of the video file. 0 until status is stopped | Seconds |
status |
Status of the recording | ["started","stopped","ready","failed"] |
reason |
Why the recording stopped. Only defined when status is stopped or ready | ["recordingStoppedByServer","lastParticipantLeft","sessionClosedByServer","automaticStop","openviduServerStopped", "mediaServerDisconnect"] |
Example:
{"recordingStatusChanged":{"sessionId":"TestSession","timestamp":1549015640859,"startTime":1549015630563,"duration":5.967,"id":"TestSession","name":"MyRecording","outputMode":"COMPOSED","hasAudio":true,"hasVideo":true,"recordingLayout":"BEST_FIT","resolution":"1920x1080","size":617509,"status":"stopped","reason":"sessionClosedByServer"}}
filterEventDispatched 🔗
Recorded when a filter event has been dispatched. This event can only be triggered if a filter has been applied to a stream and a listener has been added to a specific event offered by the filter. See Voice and video filters to learn more.
| Property | Description | Value |
|---|---|---|
sessionId |
Session for which the event was triggered | A string with the session unique identifier |
timestamp |
Time when the event was triggered | UTC milliseconds |
participantId |
Identifier of the participant | A string with the participant unique identifier |
streamId |
Identifier of the stream for which the filter is applied | A string with the stream unique identifier |
filterType |
Type of the filter applied to the stream | A string with the type of filter |
eventType |
Event of the filter that was triggered | A string with the type of event |
data |
Data of the filter event | A string with the data returned by the filter event. Its value will depend on the type of filter and event |
Example:
{"filterEventDispatched":{"sessionId":"TestSession","timestamp":1568645808285,"participantId":"oklnb2wgsisr0sd3","streamId":"oklnb2wgsisr0sd3_CAMERA_GXTRU","filterType":"ZBarFilter","eventType":"CodeFound","data":"{timestampMillis=1568645808285, codeType=EAN-13, source=23353-1d3c_kurento.MediaPipeline/1f56f4a5-807c-71a30d40_kurento.ZBarFilter, type=CodeFound, value=0012345678905, tags=[], timestamp=1568645808}"}}