I want to trigger alarm in XProtect Smart Client from third party system using Component Integration approach. For learning and understanding the method of triggering I am consulting the code sample named “AnalyticsEventTriggerViaLibrary” provided with MIP SDK. The sample shows the Item Picker Form to select the Camera item. In the source code, the Name and FQID value of the selected camera item is used to create Eventsource object. However, in the real time scenario, this will not happen. There will be need to pick the pre-stored value from the database field. Either FQID has to be stored in the database or any other helpful value. I observe, the FQID is not a value type object, rather it is structure. In this context I want to ask, is there any way other than using FQID to create Eventsource object. A comment is written by Milestone in the sample code which says “If FQID is null, then the Name can be an IP address, and the event server will make a lookup to find the camera”. I tried this method and passed the IP of the camera to the Name property but it is not working.
If FQID is a must, is there any code sample which is guiding how to store FQID structure in the database field and then again generate the FQID using the value saved in the database.
Thank you for your reply.
Could you please confirm that GUID value for Camera Kind which is “5135ba21-f1dc-4321-806a-6ce2017343c0”, it is a fixed value and it does not change within different versions of XProtect.
Ok, thank you for this confirmation.
Hi, Bo Ellegård
As you suggested, we are using VideoOS.Platform.Configuration.Instance.GetItem() to get the Camera Item in our application. We hold the Camera Item object variable and does not call GetItem() again and again for each individual alarm. The alarm gets triggered successfully in Smart Client Software using Camera Item, EventSource, EventHeader, AnalyticsEvent, EnvironmentManager.Instance.SendMessage() etc. However, it is observed that while the application is running and during this time if we disable the Camera in XProtect Management Software, the alarm still can reach to XProtect Smart Client. Is this an expected/defined behaviour ? Does SendMessage() internally not re-check the availability of the EventSource?
I believe the explanation is that the Event Server that is hosting the messaging is not immeidately aware that a camera has been removed. To disable a camera has the same effect as removing it but not instantaneously. I believe that a disabled camera should not be available when you do the GetItem(), when the change has been properly propagated and updated through out the system.
There is another observation. We decided to call GetItem() before sending each alarm to XProtect. It was returning the Camera Item, even if the application was running, and during this time we disabled the camera using XProtect Mgmt Interface. The GetItem() remined returning the Camera Item successfully till we stop and re-started the application.
There is also vice versa. Means if Camera was disabled when the first time application called GetItem(). It did not return the Camera Item. And behaviour remained same even during running the application that Camera was enabled from XProtect Mgmt UI. The GetItem() returned the Camera Item successfully when the application is stopped and re-started. It looks upon first call of GetItem(), it is caching the status locally and then not fetching the true availability of Camera for the successive calls.
A regular MIP SDK based application will only read the configuration at restart. This can easily be observed using the samples. As an example: You start the ImageViewerClient sample and can pick any camera for showing the footage live or playback, if you then in the Management Client add a camera you cannot see the camera, only when you restart the client sample can you use the new camera.
One sample is special and can detect configuration change, this is the ConfigUpdated sample.
https://doc.developer.milestonesys.com/html/index.html?base=samples/componentsamples/configupdated/readme.html&tree=tree_2.html
If you want to develop an application that will be aware when a camera has been removed please explore that sample.