To get the camera events using WebSocket, do the following:
Send a JSON command to subscribe to event notification from the specified cameras (see Get list of telemetry devices for specified video source). This subscription allows you to receive all events listed 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 event notification;
exclude—disable the events notification.
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 type | Description | States |
---|---|---|
devicestatechanged | Camera state |
|
alert | Alarm | No states |
alert_state | Alarm state |
|
detector_event | Event from a detection tool | No states |
camera_record_state | State of recording to archive |
|
If the camera is disabled in Axxon One, no events are received from it using WebSocket, including the signal lost event. |
Example of a 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" |
Sample request to receive events via Web-Socket:
ws://root:root@localhost/events?schema=proto
Parameter | Description |
---|---|
schema | schema=proto means detailed response |
Sample detailed response:
|
Parameter | Description |
---|---|
vehicleBrand | Vehicle manufacturer |
vehicleClass | Vehicle class |
vehicleColor | Vehicle color |
vehicleModel | Vehicle model |
Using WebSocket, you can subscribe and unsubscribe to event notification about changes in camera configuration using the track and untrack commands.
{ "track": ["hosts/Server/DeviceIpint.1"] } |
{ "objects" : [ { "name" : "hosts/Server/DeviceIpint.1", "type" : "itemstatuschanged" } ] } { "objects" : [ { "source" : "hosts/Server/DeviceIpint.1/SourceEndpoint.video:0:0", "state" : "off", "type" : "camera_record_state" } ] } { "objects" : [ { "name" : "hosts/Server/DeviceIpint.1", "type" : "itemstatuschanged" } ] } { "objects" : [ { "source" : "hosts/Server/DeviceIpint.1/SourceEndpoint.video:0:0", "state" : "off", "type" : "camera_record_state" } ] } |
{ "untrack": ["hosts/Server/DeviceIpint.1"] } |
{ "objects" : [ { "source" : "hosts/Server/DeviceIpint.1/SourceEndpoint.video:0:0", "state" : "off", "type" : "camera_record_state" } ] } { "objects" : [ { "source" : "hosts/Server/DeviceIpint.1/SourceEndpoint.video:0:0", "state" : "off", "type" : "camera_record_state" } ] } |