I want to receive the alarm from event server.
and I want to receive the new alarm from the event server.
But, the event server does not push..
So, I connect the event server (default 22331 port) and send the GetAlarmLines message to the server periodically.
POST /Central/AlarmServiceToken HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://videoos.net/2/CentralServerAlarmCommand/IAlarmCommandToken/GetAlarmLines"
Host: 10.250.46.235:22331
Content-Length: 569
Expect: 100-continue
Accept-Encoding: gzip, deflate
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<GetAlarmLines xmlns="http://videoos.net/2/CentralServerAlarmCommand">
<token>TOKEN#BE107F5F-AFBC-42BF-8D9F-032544EA6681#127.0.0.1:7080#</token>
<from>0</from>
<maxCount>10</maxCount>
<filter xmlns:a="http://schemas.datacontract.org/2004/07/VideoOS.Platform.Proxy.Alarm" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:Conditions i:nil="true" />
<a:Orders>
<a:OrderBy>
<a:Order>Descending</a:Order>
<a:Target>Timestamp</a:Target>
</a:OrderBy>
</a:Orders>
</filter>
</GetAlarmLines>
</s:Body>
</s:Envelope>
Is this the best way?
In my application is running on linux. so I must use the Protocol Integration.
Please guide to me
For getting latest alarm the recommended approach is to use StartAlarmLineSession and then regularly call GetSessionEventLines with the session ID you receive. (and finally call StopAlarmLineSession once you are done)
It is still pull based, but will ensure you get all alarms.
OK…
but I cannot find the SOAP Message Format of StopAlarmLineSession.
Where can i fine the format in MIPSDK?
and,
What’s the different of GetSessionAlarmLines?
The StopAlarmLineSession is just a simple void method taking a Guid as argument (the Guid that is returned as response from StartAlarmLineSession). The interface is described in the documentation (AlarmCommandClient).
Difference between GetAlarmLines and GetSessionAlarmLines is that the latter will on the server side keep track of which alarm lines you have received and thus you don’t have to do any intelligence on your side in order to keep track of what the next lines to request are.
Thanks,
but, I mistake the question… sorry.
I wanna know about the message format of StartAlarmLineSession, and GetSessionAlarmLines.
and
what’s the different of StartEventLineSession and GetSessionEventLines?
as you metioned the “AlarmCommandClient”
But, I cannot find the soap message in the MIPSDK html
So, Is there any example using the StartAlarmLineSession for find the soap format on wireshark?
I want know the soap message format. and what’s the mean each tag value…
The AlarmList sample shows how to use the AlarmCommandClient. Unfortunately it contains a quite old auto-generated proxy client, but if you remove the AlarmCommand.cs from the project it will automatically use one that is included with the SDK instead and you can then easily modify it to call StartAlarmLineSession and GetSessionAlarmLines so that you can wireshark it.
The Event versions works in a very similar way, but for events instead of alarms.
I just realized that I wrote that you should call GetSessionEventLines in my initial response. You probably already figured out, but just to make sure there is no confusion it should of course have been GetSessionAlarmLines.
Sorry about this.
Thank you very much.
Now I do the test like below
StartAlarmLineSession
<StartAlarmLineSession xmlns="http://videoos.net/2/CentralServerAlarmCommand">
<token>TOKEN#F3005090-6789-4BDB-AD7F-D0A0793416EA#127.0.0.1:7080#</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 i:nil="true" />
<a:Orders>
<a:OrderBy>
<a:Order>Descending</a:Order>
<a:Target>Timestamp</a:Target>
</a:OrderBy>
</a:Orders>
</filter>
</StartAlarmLineSession>
and receive the response like below
<StartAlarmLineSessionResponse xmlns="http://videoos.net/2/CentralServerAlarmCommand">
<StartAlarmLineSessionResult>e5d91730-5db6-4442-aa38-3ae507815319</StartAlarmLineSessionResult>
</StartAlarmLineSessionResponse>
GetSessionAlarmLines
<GetSessionAlarmLines xmlns="http://videoos.net/2/CentralServerAlarmCommand">
<token>TOKEN#F3005090-6789-4BDB-AD7F-D0A0793416EA#127.0.0.1:7080#</token>
<sessionId>e5d91730-5db6-4442-aa38-3ae507815319</sessionId>
<maxCount>10</maxCount>
</GetSessionAlarmLines>
=> Questions
- If I missing the <token> then -> server response 500 error
- So, I add the <token> then -> server response 200 ok
- Is this right?
- If it is right then I got the new token after login -> using new token value?
Yes, this is all correct.
Thanks.
But, When I using the GetSessionAlarmLines after motion
the response is 500 internal server error
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring>Unhandled exception: System.NullReferenceException: ...... ......... ......... ............... ............ ................
......: VideoOS.Event.Server.Alarm.AlarmLineFetchSessionCache.MatchFilter(AlarmFilter filter, AlarmLine item)
......: VideoOS.Event.Server.Alarm.LineFetchSessionCache`2.CheckUpdate(FetchCacheData`1 item)
......: VideoOS.Event.Server.Alarm.LineFetchSessionCache`2.Update(ICollection`1 data, Int32 size, FetchSessionUpdateData`1 output)
......: VideoOS.Event.Server.Alarm.AlarmLineFetchSession.GetLines(Int32 maxCount)
......: VideoOS.Event.Server.Alarm.LineFetchManager.GetLines(Guid sessionId, Int32 maxCount)
......: VideoOS.Event.Server.DB.AlarmDbManager.Get(Int32 maxCount, Guid sessionId, UserId[] userIds)
......: VideoOS.Event.Server.WebService.Alarm.AlarmCommandToken.GetSessionAlarmLines(String token, Int32 maxCount, Guid sessionId)</faultstring><detail><AlarmServiceFault xmlns="http://schemas.datacontract.org/2004/07/VideoOS.Platform.Proxy.Alarm" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><ErrorDescription>Unhandled exception: System.NullReferenceException: ...... ......... ......... ............... ............ ................
......: VideoOS.Event.Server.Alarm.AlarmLineFetchSessionCache.MatchFilter(AlarmFilter filter, AlarmLine item)
......: VideoOS.Event.Server.Alarm.LineFetchSessionCache`2.CheckUpdate(FetchCacheData`1 item)
......: VideoOS.Event.Server.Alarm.LineFetchSessionCache`2.Update(ICollection`1 data, Int32 size, FetchSessionUpdateData`1 output)
......: VideoOS.Event.Server.Alarm.AlarmLineFetchSession.GetLines(Int32 maxCount)
......: VideoOS.Event.Server.Alarm.LineFetchManager.GetLines(Guid sessionId, Int32 maxCount)
......: VideoOS.Event.Server.DB.AlarmDbManager.Get(Int32 maxCount, Guid sessionId, UserId[] userIds)
......: VideoOS.Event.Server.WebService.Alarm.AlarmCommandToken.GetSessionAlarmLines(String token, Int32 maxCount, Guid sessionId)</ErrorDescription><ErrorReason>Unknown</ErrorReason></AlarmServiceFault></detail></s:Fault></s:Body></s:Envelope>
Why?
I attach the full packet dump using by wireshark
Help me.
Could you please try using:
<a:Conditions />
instead of:
<a:Conditions i:nil=“true” />
Thanks.
working is well done ^^
I have another question.
Can I check the cameras status via protocol integration?
(resolution, active, responding or not responding, conneting… and so on)
I believe you already have another thread going on this topic. Please keep each topic in its own thread and don’t have multiple threads regarding the same.
Sorry,
I thought you could help me better.