Events
When events are enabled in the Management Client, the driver creates a pull point subscription and starts sending PullMessagesRequests periodically (every 5 seconds by default) looking for a PullMessagesResponse with notification messages. The notification messages contain information representing that an event occurred, otherwise they are empty. So, for the driver to recognize that an event occurred, the driver must match the message from PullMessagesResponse with some already predefined filters. They are described in the following sections for every event that our current ONVIF driver implementation supports.
The PullMessagesResponse that the driver receives must contain some of the following data, not all of them are required:
-
The driver explicitly checks for PropertyOperation = “Changed”. All Notification messages with status “Changed” will be detected by the driver. Therefore, messages with PropertyOperation = “Changed” must be send only if event status is changed, otherwise there will be a lot of unnecessary triggered events. Notification messages that do not have this value are ignored.
-
The message topic must be the same or similar in order to match the Topics filter list below for each event. (i.e., If Topic description is Motion as predefine filter in the driver, then Topic category in the received response must contain either/or: Motion, MotionAlarm, SomethingMotionAlarm or MotionAlarmSomething).
-
The Source must contain Name and Value attributes. Name must have the exact match with the description in the Name categories listed (i.e., If Name is InputToken as predefine filter in driver, then Name category in the response must contain InputToken). The Value category needs to refer to the type of the value and not the value itself. (i.e. (negation) means “false”, “off”, “inactive”).
The value types can be:
Value types |
Meaning |
---|---|
(VSToken) |
String token of a Video Source (i.e., “VideoSourceToken”) |
(inputToken) |
String token of a Digital Input (i.e., “InputToken”) |
(negation) |
“true”/”false”; “on”/"off"; “up”/"down"; “high”/"low", “active”/"inactive”, ”1”/"0", “Triggered”/”Normal” |
(input) |
String which contains number (zero-based index) |
(inputNumber) |
String which contains number (one-based index) |
(source) |
String which contains number (zero -based index) |
(int) |
Number |
(window) |
Window number |
(AEConfToken) |
String token of an Audio Encoder Configuration |
io |
String |
(dateTime) |
Date and time as string |
-
Data must follow the same logic as the Source category above in terms of Name and Value.
-
Key must follow the same logic as the Source category above in terms of Name and Value.
The next description presents an example of PullMessagesResponse:
<env:Body> <tev:PullMessagesResponse> <tev:CurrentTime>2017-08-29T09:30:25Z</tev:CurrentTime> <tev:TerminationTime>2017-08-30T21:43:45Z</tev:TerminationTime> <wsnt:NotificationMessage> <wsnt:TopicDialect="http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet">tns1:RuleEngine /CellMotionDetector/Motion</wsnt:Topic> <wsnt:Message> <tt:Message UtcTime="2017-08-29T09:30:25Z" PropertyOperation="Changed"> <tt:Source> <tt:SimpleItem Name="VideoSourceConfigurationToken" Value="VideoSourceToken"/> <tt:SimpleItem Name="VideoAnalyticsConfigurationToken" Value="VideoAnalyticsToken"/> <tt:SimpleItem Name="Rule" Value="MyMotionDetectorRule"/> </tt:Source> <tt:Data> <tt:SimpleItem Name="IsMotion" Value="false"/> </tt:Data> </tt:Message> </wsnt:Message> </wsnt:NotificationMessage> </tev:PullMessagesResponse> </env:Body>
There are one Topic, PropertyOperation with status “Changed”, three sources and one Data. Each Response can contain more than one Source and more than one Data inputs. The driver requirements for proper match are described for each event below.
Note: After successful creation of a pull point subscription the ONVIF driver will send SetSynchronizationPoint command in order to retrieve the current state of all events.