Hello,
We want to use an event for send an http request to an external system,
how can i recover the name of an specific event for send this request when the event occured ?
Hello,
We want to use an event for send an http request to an external system,
how can i recover the name of an specific event for send this request when the event occured ?
I use the ConfigDump in the MIPSDK for example.
Please explore the StatusViewer sample.
Hello mister Kito,
This sample was usefull thanks,
but I want to be sure that i can use the name of the events with something like that ?
if (baseEventData.EventHeader.Name == “MyEvent”)
{
// Code for send the http request here
}
this code would be placed in a loop that watch each event and wait that one occured
StatusViewer filters the messages so that you only see those pertaining to the devices shown in the tree, so based on this you might or might not see “MyEvent” in the sample. Observe however that you will get all events by the subscription to NewEventsIndication as that sample shows.
I do something like that but it’s dosen’t work :
_obj = _messageCommunication.RegisterCommunicationFilter(MessageHandler,
new VideoOS.Platform.Messaging.CommunicationIdFilter(VideoOS.Platform.Messaging.MessageId.Server.NewEventIndication
if (message.MessageId == VideoOS.Platform.Messaging.MessageId.Server.NewEventIndication)
{
EventData eventData = message.Data as EventData;
BaseEvent baseEvent = message.Data as BaseEvent;
if (eventData != null || baseEvent != null)
{
UpdateState(eventData.EventHeader.Source.FQID, eventData.EventHeader.Message);
if ([eventData.EventHeader.Name](https://eventData.EventHeader.Name) == "MyUserEvent")
{
var web = new System.Net.WebClient();
web.Headers.Add("Content-type", "application/json");
web.UploadString("[http://127.0.0.1:3030/journal-events](http://127.0.0.1:3030/journal-events)", "{\\"type\\": \\"ALARM\\", \\"sourceType\\": \\"VMS\\", \\"source\\": \\" \[@IP\_VMS\] \\", \\"systemType\\": \\"SENSOR\\", \\"system\\": 0, \\"description\\": \\"\[ALARM DESCRIPTION\]\\"}");
}
}
Do you have any idea why it dosen’t work ?
Try to single-step debug and narrow down whether the handler is never called or some thing goes wrong when it is called.
Depending on the environment for your plugin:
https://developer.milestonesys.com/s/article/debugging-techniques-for-Smart-Client-plugins
https://developer.milestonesys.com/s/article/debugging-techniques-for-Event-Server-plugins
https://developer.milestonesys.com/s/article/debugging-techniques-for-Management-Client-plugins