Go to documentation repository
Documentation for Axxon One 2.0. Documentation for other versions of Axxon One is available too.
To get the camera events using WebSocket, do the following:
- Connect to ws://[user_name]:[password]@[IP address]:[port]/[prefix]/events.
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 |
|
Note
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 |
Managing the subscription to event notification about changes in camera configuration
Using WebSocket, you can subscribe and unsubscribe to event notification about changes in camera configuration using the track and untrack commands.
- Example of subscription to event notification about changes in camera configuration:Example of a message after subscription:
{ "track": ["hosts/Server/DeviceIpint.1"] }
where the type parameter displays the itemstatuschanged value when the configuration is changed.{ "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" } ] }
- Example of unsubscription to event notification about changes in camera configuration:Example of a message after unsubscription:
{ "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" } ] }