Analytics Event using Protocol Integration from Java Application

I am Java developer and new to MIPSDK. I need the best approach to send Analytics event to trigger Alarm. Event triggered from Non-Camera device (Using Multiple BLE Sensor).

Currently I am doing integration using Java socket programming to send below Analytics Event XML to “Event Server”.

Is this correct approach to send Analytics Event to Event server?

Analytics Event XML :

<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<AnalyticsEvent xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:milestone-systems">
	<EventHeader>
		<ID>00000000-0000-0000-0000-000000000000</ID>
		<Timestamp>2018-07-09T15:19:39.7342498+08:00</Timestamp>
		<Message>TestAnalyticsEvent</Message>
		<CustomTag>TagFromXML</CustomTag>
                  <Source>
      <Name>127.0.0.1</Name>
    </Source>
	</EventHeader>
	<Description>Analytics event description.</Description>
	<Location>Event location 1</Location>
	<Vendor>
		<Name>My Smart Video</Name>
	</Vendor>
</AnalyticsEvent>

Thanks in advance.

Yes and no.

I would like to tell you what I did to verify that the XML is correct because you can use this if you want to expand on it. Using the TriggerAnalyticsEventXML sample you can see that the XML is correct against the schema. Even though this sample is not programmed in Java I believe you will find the sample useful.

The reason I also say no is that an Analytics Event requires a source, so I believe the Event Server will reject this because 127.0.0.1 is not the IP of one of the cameras on your XProtect VMS.

Hi Bo,

Currently I am working in development environment. I don’t have real camera to configure as of now.

Is there any options to configure dummy camera IP for source to test Analytics Event alarm?

Regards,

Sudha.M

Yes.

A dummy camera can be set up that use an AVI file or similar.

https://developer.milestonesys.com/s/article/Set-up-DirectShow-Driver

A camera like that will have the IP 0.0.0.1

I just tested to make sure it also works when submitting Analytics Events.

Hi Bo,

Thank You.

I can able to send alarm when submitting Analytics Events, but not able to view avi file. I can see below error in webclient

“Error : Error getting permitted users for alarm[Object Object]”

Also not able to change the state as"In Progress".

Event Server Log :

2018-07-16 11:31:48 PM UTC+08:00 Error AlarmSecurityCredentials Unhandled exception in web service with message: ManageAlarms feature is not enabled on target system

Exception details:

VideoOS.Event.Server.WebService.Alarm.AlarmServiceFaultException: ManageAlarms feature is not enabled on target system —> System.Exception: ManageAlarms feature is not enabled on target system

at VideoOS.Event.Server.DB.AlarmDbHandlers.AlarmSecurityHandler.CheckWriteAccess(UserId[] userIds)

at VideoOS.Event.Server.Alarm.AlarmSecurityManagerVMO.CheckGlobalAuthorization(UserId[] userIds)

at VideoOS.Event.Server.Alarm.AlarmSecurityManagerVMO.GetPermittedRoleIds(String objectId)

— End of inner exception stack trace —

at VideoOS.Event.Server.Alarm.AlarmSecurityManagerVMO.GetPermittedRoleIds(String objectId)

at VideoOS.Event.Server.Alarm.AlarmSecurityManagerVMO.GetUsersPermittedByObject(String objectId)

at VideoOS.Event.Server.WebService.Configuration.AlarmSecurityCredentials.GetUsersPermittedByObject(String objectId)

The Alarm Manager is not enabled in XProtect Essential+

https://content.milestonesys.com/web/5af9808632384317/product-overview-tables/?mediaId=462CC41E-6D0F-4BB4-8B4EEB1F0030C2CF

My guess is that this is the version you have.

If you customers have a better product you might have to install a test version. You can use a try -catch to make your code not crash in XProtect Essential+.