Thank you for the support.
I’m trying to go with the MessageCommunication, but actually I am not able to send the event.
I tried also to test it changing the sample code of AnalyticsEventTrigger to use MessageCommucation, but i get the same exception: Unable To Transmit - Discarding message ‘Server.NewEventCommand’ as sending Indication and Command messages are not allowed.
I changed the sample code in this way:
EventSource eventSource = new EventSource()
{
// Send empty - it is possible to send without an eventsource, but the intended design is that there should be a source
// the FQID is primamry used to match up the ObjectId with the a camera.
FQID = \_selectedItem.FQID,
// If FQID is null, then the Name can be an IP address, and the event server will make a lookup to find the camera
Name = \_selectedItem.Name
};
EventHeader eventHeader = new EventHeader()
{
ID = Guid.NewGuid(),
Type = “Ganimede”,
Timestamp = DateTime.Now,
Message = txtAnalyticsEventName.Text,
Source = eventSource,
CustomTag = “TagFromC#”
};
AnalyticsEvent analyticsEvent = new AnalyticsEvent();
analyticsEvent.EventHeader = eventHeader;
analyticsEvent.Location = “Event location 1”;
analyticsEvent.Description = “Analytics event description.”;
analyticsEvent.Vendor = new Vendor();
analyticsEvent.Vendor.Name = “My Smart Video”;
if (chkIncludeOverlay.Checked)
{
analyticsEvent.ObjectList = new AnalyticsObjectList();
analyticsEvent.ObjectList.Add(GetRectangle());
}
//EnvironmentManager.Instance.SendMessage(
// new VideoOS.Platform.Messaging.Message(MessageId.Server.NewEventCommand)
// { Data = analyticsEvent });
MessageCommunicationManager.Start(EnvironmentManager.Instance.MasterSite.ServerId);
MessageCommunication messageCommunication = MessageCommunicationManager.Get(EnvironmentManager.Instance.MasterSite.ServerId);
messageCommunication.TransmitMessage(
new VideoOS.Platform.Messaging.Message(MessageId.Server.NewEventCommand) { Data = analyticsEvent },
null, null, null);
I really hope you can help me.
Thank you.