Documentation for C-Werk 2.0.

Previous page gRPC API method calls  Client HTTP API Next page

To get the camera events using WebSocket, do the following:

  1. Connect to ws://[user_name]:[password]@[IP-address]:[port]/[prefix]/events.
  2. Send a JSON command to subscribe on events generated by the specified cameras (see Get list of video cameras and information about them). This subscription allows you to receive all the events shown in the table below.

    {
    "include":
    ["hosts/Server1/DeviceIpint.1/SourceEndpoint.video:0:0", "hosts/Server1/DeviceIpint.6/SourceEndpoint.video:0:0"],
    "exclude":[]
    }

    include – subscribe to the events receiving;
    exclude – disable the events receiving.

The response will contain the following JSON:

   {
    objecs: [
    {type: "devicestatechanged", name: "hosts/Server1/DeviceIpint.1", state: "signal restored"}
    ]
    }

List of event types and camera states:

Event typeDescriptionStates
devicestatechangedCamera state

signal restoredconnected, signal restored

signal lost – signal lost

alertAlarmNo states
alert_stateAlarm stateprocessingthe alarm is being processed
closedalarm processed
reactionalarm initiated
detector_eventDetection tool triggeringNo states
camera_record_state

Archive record state

onthe camera is recording to the archive
offthe camera is not linked to the archive
graythe camera is linked to the archive, but is not recording

Note

If the camera is disabled in C-Werk, no events are received from it using WebSocket, including the signal lost event.

Example of message:

objects: [{name: "hosts/Server1/DeviceIpint.1/SourceEndpoint.video:0:0", state: "signal restored",…},…]
0: {name: "hosts/Server1/DeviceIpint.1/SourceEndpoint.video:0:0", state: "signal restored",…}
name: "hosts/Server1/DeviceIpint.1/SourceEndpoint.video:0:0"
state: "signal restored"
type: "devicestatechanged"
  • No labels