How to simulate Motion Events

We’re working on a SCADA system integration to get Motion events with as low latency as possible using the Alarm Command protocol. Our previous solution is based on the Recorder Status Protocol which has too high latency for our use case.

​The approach of sending a SOAP StartEventLineSession request followed by GetSessionEventLines requests seems to work using a predefined test event. Now we need to simulate Motion events to finish the integration.

We’ve got a camera simulator with different streams. The Siemens Siveillance VMS Video Client shows that there are pending motion events that can also be acquitted. But these events don’t show up in the GetSessionEventLinesResponse.

The StartEventLineSession request:

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <env:Body>
    <StartEventLineSession xmlns="http://videoos.net/2/CentralServerAlarmCommand"><token>TOKEN#4721970c-d005-493e-9670-6299b15a6ce4#configcenter//ServerConnector#</token><filter xmlns:a="http://schemas.datacontract.org/2004/07/VideoOS.Platform.Proxy.Alarm" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
   <a:Conditions/>
   <a:Orders>
      <a:OrderBy>
         <a:Order>Descending</a:Order>
         <a:Target>Timestamp</a:Target>
      </a:OrderBy>
   </a:Orders>
</filter>
</StartEventLineSession>
  </env:Body>

The GetSessionEventLines request:

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <env:Body>
    <GetSessionEventLines xmlns="http://videoos.net/2/CentralServerAlarmCommand">
      <token>TOKEN#0dc961ff-50cd-48aa-8e77-36434aeca26c#configcenter//ServerConnector#</token>
      <sessionId>5cec94a1-abd4-45a6-9c3e-cd8f5b3b49c5</sessionId>
      <maxCount>20</maxCount>
    </GetSessionEventLines>
  </env:Body>
</env:Envelope>

The GetSessionEventLinesResponse for the test event:

<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Body>
    <GetSessionEventLinesResponse xmlns="http://videoos.net/2/CentralServerAlarmCommand">
      <GetSessionEventLinesResult xmlns:a="http://schemas.datacontract.org/2004/07/VideoOS.Platform.Proxy.Alarm" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        <a:Deleted xmlns:b="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>
        <a:Inserted>
          <a:EventLine>
            <a:CameraId>00000000-0000-0000-0000-000000000000</a:CameraId>
            <a:CustomTag i:nil="true"/>
            <a:Id>864bc2da-3eaa-4139-929d-d9749e837dae</a:Id>
            <a:LocalId>10014</a:LocalId>
            <a:Message>External Event</a:Message>
            <a:Name>External Event</a:Name>
            <a:ObjectValue i:nil="true"/>
            <a:RuleType i:nil="true"/>
            <a:SourceId>191754f0-7ff7-49fa-8724-4e19aa3d08a1</a:SourceId>
            <a:SourceName>ghfgh</a:SourceName>
            <a:Timestamp>2022-03-07T14:54:10.4898705Z</a:Timestamp>
            <a:Type>System Event</a:Type>
            <a:VendorName i:nil="true"/>
          </a:EventLine>
        </a:Inserted>
      </GetSessionEventLinesResult>
    </GetSessionEventLinesResponse>
  </s:Body>
</s:Envelope>
  1. How to get Motion events over Alarm Command protocol?

  2. How to simulate Motion events?

We’ve defined a rule to get motion events and these now come in the response:

<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Body>
    <GetSessionEventLinesResponse xmlns="http://videoos.net/2/CentralServerAlarmCommand">
      <GetSessionEventLinesResult xmlns:a="http://schemas.datacontract.org/2004/07/VideoOS.Platform.Proxy.Alarm" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        <a:Deleted xmlns:b="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>
        <a:Inserted>
          <a:EventLine>
            <a:CameraId>00000000-0000-0000-0000-000000000000</a:CameraId>
            <a:CustomTag i:nil="true"/>
            <a:Id>a1937d8f-64a8-452f-9ac9-d838711dbd80</a:Id>
            <a:LocalId>20045</a:LocalId>
            <a:Message>External Event</a:Message>
            <a:Name>External Event</a:Name>
            <a:ObjectValue i:nil="true"/>
            <a:RuleType i:nil="true"/>
            <a:SourceId>f6cd98df-56f0-4853-9664-636ce668c623</a:SourceId>
            <a:SourceName>Bewegung</a:SourceName>
            <a:Timestamp>2022-03-09T08:15:36.6629879Z</a:Timestamp>
            <a:Type>System Event</a:Type>
            <a:VendorName i:nil="true"/>
          </a:EventLine>
        </a:Inserted>
      </GetSessionEventLinesResult>
    </GetSessionEventLinesResponse>
  </s:Body>
</s:Envelope>

The problem is that the camera ID is always 00000000-0000-0000-0000-000000000000. How to get the camera ID for the camera associated with the Motion event?

Is this possibly related to the bug and hotfix mentioned in https://developer.milestonesys.com/s/question/0D53X00006SAyIISA1/cameraid-is-empty-for-events-triggered-after-starteventlinesession ? Our versions are more up-to-date though: “Siemens Siveillance VMS Video Pro 2021 R1”

Let me go one step back..

You want to do this because you want something quicker than Recorder Status. The Event Server and Alarm Command get the information from the Status API and then after that starts creating event etc.

So instead of analyzing why this doesn’t work I am sort of saying, don’t use it.