ONVIF pullpoint MatchMessages error

We are developing a device which implements the ONVIF protocol. Events, such as tamper or line cross, occured in the device can be pulled via Pull Point Subscription. When tested with ODT (ONVIF Device Test Tool) and ODM (ONVIF Device Manager) everything works as expected. I added our device as an ONVIF conformant device and Milestone pulls the event messages. When I sniff the network with Wireshark the message seems to be correct but Milestone gives an error.

For line crossing the log in %ProgramData%\Milestone\XProtect Recording Server\Logs\Drivers\ONVIF and the Wireshark log as follows

I could’nt get the problem. The packet, in Milestone logs, seems to be corrputed.

Could you please provide support to fix this issue?

Thank you.

Logs:

0001836 2024-02-06T09:27:39.374448+03:00 DEBUG 0x00000eb0@0x0000273c NmMultiCodec::CmMetaDataMultiCodec::AddFrame()@MetaDataMultiCodec.cpp:260 Received metadata packet [192.168.1.81:21:80] (size=4363)

0001837 2024-02-06T09:27:39.393573+03:00 DEBUG 0x00000eb0@0x0000273c NmMultiCodec::OutputMetadataEventsDebug()@MetaDataMultiCodec.cpp:156 METADATA EVENT: Topic=‘tns1:RuleEngine/LineDetector/Crossed’

0001838 2024-02-06T09:27:39.393573+03:00 DEBUG 0x00000eb0@0x0000273c NmMultiCodec::OutputMetadataAnalyticsDebug()@MetaDataMultiCodec.cpp:195 METADATA ANALYTICS: ObjectId=‘1’ Class=‘’

0001839 2024-02-06T09:27:39.393573+03:00 DEBUG 0x00000eb0@0x0000273c NmMultiCodec::OutputMetadataAnalyticsDebug()@MetaDataMultiCodec.cpp:195 METADATA ANALYTICS: ObjectId=‘2’ Class=‘’

0001840 2024-02-06T09:27:39.393573+03:00 DEBUG 0x00000eb0@0x0000273c NmMultiCodec::OutputMetadataAnalyticsDebug()@MetaDataMultiCodec.cpp:195 METADATA ANALYTICS: ObjectId=‘3’ Class=‘’

0001843 2024-02-06T09:27:39.550438+03:00 ERROR 0x0000451c@0x0000273c NmONVIFDevice::CmOnvifEventPolling::MatchMessages()@ONVIFEvent.cpp:1503 Error: tns1:RuleEngine/LineDetector/Crossed<Message xmlns:SOAP-ENV=“http://www.w3.org/2003/05/soap-envelope” xmlns:SOAP-ENC=“http://www.w3.org/2003/05/soap-encoding” xsi=“http://www.w3.org/2001/XMLSchema-instance” xsd=“http://www.w3.org/2001/XMLSchema” xmlns:trc>

--------------------------------------------------------------------------------------------------------------------------------

Wireshark:

<?xml version="1.0" encoding="UTF-8"?>

<SOAP-ENV:Envelope

xmlns:SOAP-ENV=“http://www.w3.org/2003/05/soap-envelope

xmlns:tse=“http://www.onvif.org/ver10/search/wsdl”>

SOAP-ENV:Header

 <wsa5:MessageID>urn:uuid:bf449065-e772-4df3-a9ed-0008dc37865d</wsa5:MessageID>

 <wsa5:ReplyTo SOAP-ENV:mustUnderstand="true">

    <wsa5:Address>[http://www.w3.org/2005/08/addressing/anonymous</wsa5:Address>](http://www.w3.org/2005/08/addressing/anonymous%3C/wsa5:Address%3E "http://www.w3.org/2005/08/addressing/anonymous%3C/wsa5:Address%3E")

 </wsa5:ReplyTo>

 <wsa5:To SOAP-ENV:mustUnderstand="true">[http://192.168.1.81:80/onvif/device\_service/25eb1651</wsa5:To>](http://192.168.1.81:80/onvif/device_service/25eb1651%3C/wsa5:To%3E "http://192.168.1.81:80/onvif/device_service/25eb1651%3C/wsa5:To%3E")

 <wsa5:Action SOAP-ENV:mustUnderstand="true">[http://www.onvif.org/ver10/events/wsdl/PullPointSubscription/PullMessagesResponse</wsa5:Action>](http://www.onvif.org/ver10/events/wsdl/PullPointSubscription/PullMessagesResponse%3C/wsa5:Action%3E "http://www.onvif.org/ver10/events/wsdl/PullPointSubscription/PullMessagesResponse%3C/wsa5:Action%3E")

</SOAP-ENV:Header>

SOAP-ENV:Body

 <tev:PullMessagesResponse>

    <tev:CurrentTime>2024-02-02T07:46:06Z</tev:CurrentTime>

    <tev:TerminationTime>2024-02-02T07:47:06Z</tev:TerminationTime>

    <wsnt:NotificationMessage>

       <wsnt:Topic Dialect="[http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet](http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet "http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet")">**tns1:RuleEngine/LineDetector/Crossed**</wsnt:Topic>

       <wsnt:Message>

          <tt:Message

             xmlns:tse="[http://www.onvif.org/ver10/search/wsdl](http://www.onvif.org/ver10/search/wsdl "http://www.onvif.org/ver10/search/wsdl")" UtcTime="2024-02-02T07:46:06Z" PropertyOperation="Changed">

             <tt:Source>

                <tt:SimpleItem Name="Rule" Value="Line 2"></tt:SimpleItem>

             </tt:Source>

             <tt:Data>

                <tt:SimpleItem Name="ObjectId" Value="1"></tt:SimpleItem>

                <tt:SimpleItem Name="ObjectId" Value="2"></tt:SimpleItem>

                <tt:SimpleItem Name="ObjectId" Value="3"></tt:SimpleItem>

             </tt:Data>

          </tt:Message>

       </wsnt:Message>

    </wsnt:NotificationMessage>

 </tev:PullMessagesResponse>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

Hi Serkan,

Can you attach here the Wireshark trace and the file with logs where you found match error?

Hi Kalin,

You can find the Wireshark log and the logs which Milestone generated attached.

Thank you.

posted a file.

Hi Serkan,

In the Wireshark trace I don’t see GetEventPropertiesResponse where I can see how the events are declared from the device. We get the event list from there and we register them in our product. Then we wait to receive event in PullMessageRespose which match exactly the described in GetEventPropertiesResponse event. Here is an example of GetEventPropertiesResponse in left and real event on the right:

If I can see GetEventPropertiesResponse from the device I can be more specific on why we don’t match this event.

Hi Kalin,

I added the GetEventPropertiesResponse Wireshark log. I also added the logs I get from ODT (ONVIF Device Test Tool).

  • GetEventProperties.pcapng: Wireshark log capturing the GetEventPropertiesResponse.
  • PullMessages.pcapng: Wireshark log capturing the PullMessage activity.
  • ONVIF_20240214_105153_3080_0.log: Milestone log.
  • ODT.png: Screenshot showing the GetEventProperties response from ODT.
  • ODT_PP.png: Screenshot displaying ODT pull point events.

PS: I think Milestone requests GetEventProperties after pull point subscription is established (CreatePullPointSubscription) when a device added. As far as I can see Milestones does not periodically request GetEventProperties.

Thank you.

Hi Serkan,

I don’t think ONVIF Device Test tool is actually matching events. It only extracts information from the event tags. XProtect is requesting GetEventProperties before pull point subscription is established. We don’t periodically request GetEventProperties because it’s not needed.

Regarding the matching of the mentioned event RuleEngine/LineDetector/Crossed try to add one source in Source tag like “VideoSource” type string and provide eal source token. And maybe “State” in Data tag type Boolean with value true/false or 0/1. This will help matching the event and the state of the event activated/deactivated.

Hi Kalin,

When I added “VideoSource” tag in GetEventProperties [1], nothing was changed. I still get the same error.

But if I add the VideoSourceConfigurationToken and VideoAnalyticsConfigurationToken according to the https://www.onvif.org/specs/core/ONVIF-Core-Specification.pdf [2] Milestone does not send any CreatePullPointSubscription request. Wireshark log and Milestone logs are attached. If I only add VideoAnalyticsConfigurationToken, Milestone sends CreatePullPointSubscription and pulls messages but I get the same matching error messages.

Thank you.

[1]:

<tns1:RuleEngine

xmlns:_1=“wstop” _1:topic=“true”

xmlns:tns1=“http://www.onvif.org/ver10/topics”>

<LineDetector

  xmlns:wstop="[http://docs.oasis-open.org/wsn/t-1](http://docs.oasis-open.org/wsn/t-1)" wstop:topic="true">

  <Crossed wstop:topic="true">

     <tt:MessageDescription IsProperty="true"

        xmlns:tt="[http://www.onvif.org/ver10/schema](http://www.onvif.org/ver10/schema)">

        <tt:Source>

           **<tt:SimpleItemDescription Name="VideoSource" Type="tt:ReferenceToken" />**

           <tt:SimpleItemDescription Name="Rule" Type="tt:String" />

        </tt:Source>

        <tt:Data>

           <tt:SimpleItemDescription Name="ObjectId" Type="xsd:int" />

        </tt:Data>

     </tt:MessageDescription>

  </Crossed>

</tns1:RuleEngine>

[2]:

<wstop:TopicSet

xmlns=””>

tns1:RuleEngine

  <LineDetector>

     <Crossed wstop:topic="true">

        <tt:MessageDescription>

           <tt:Source>

              <tt:SimpleItemDescription Name="**VideoSourceConfigurationToken**" Type="tt:ReferenceToken"/>

              <tt:SimpleItemDescription Name="**VideoAnalyticsConfigurationToken**"

Type=“tt:ReferenceToken”/>

              <tt:SimpleItemDescription Name="Rule" Type="xs:string"/>

           </tt:Source>

           <tt:Data>

              <tt:SimpleItemDescription Name="ObjectId" Type="xs:integer"/>

           </tt:Data>

        </tt:MessageDescription>

     </ Crossed>

  </LineDetector>

Comment in onvif.xsd:

<xs:complexType name=“MessageDescription”>

The set of tokens identify the component within the WS-Endpoint, which is responsible for the producing the message. For analytics events the token set shall include the VideoSourceConfigurationToken, the VideoAnalyticsConfigurationToken and the name of the analytics module or rule.

posted a file.

posted a file.

posted a file.

posted a file.

posted a file.