Get Camera ip from event server's background plugin

In my event server’s background plugin, i have to store ip of a camera device.

I have come across the following posts in this forum:

  1. https://developer.milestonesys.com/s/article/how-to-get-camera-IP-address-using-MIP-SDK

  2. https://developer.milestonesys.com/s/question/0D50O00003V8ByrSAF/

  3. https://force.milestonesys.com/support/MccSupportCommunity?id=90620000000H4EpAAK#!/feedtype=SINGLE_QUESTION_SEARCH_RESULT&id=90620000000k9kjAAA

When i requested for the ip address of a camera using the below code:

//Register for Messages
MessageCommunicationManager.Start(EnvironmentManager.Instance.MasterSite.ServerId);
_messageCommunication = MessageCommunicationManager.Get(EnvironmentManager.Instance.MasterSite.ServerId);
_obj4 = _messageCommunication.RegisterCommunicationFilter(IPAddressResponseHandler, new CommunicationIdFilter(MessageId.Server.GetIPAddressResponse));
 
//request
EnvironmentManager.Instance.SendMessage(new VideoOS.Platform.Messaging.Message(VideoOS.Platform.Messaging.MessageId.Server.GetIPAddressRequest, deviceFQID));
//or using
_messageCommunication.TransmitMessage(new VideoOS.Platform.Messaging.Message(VideoOS.Platform.Messaging.MessageId.Server.GetIPAddressRequest, deviceFQID), null, null, null);
 
//response
private object IPAddressResponseHandler(VideoOS.Platform.Messaging.Message message, FQID destination, FQID sender)
        {
            string ip = (string)message.Data;
            //MessageBox.Show(ip, _selectItem1.Name);
            return null;
        }

IPAddressResponseHandler isn’t getting called after request. Can we use these request and response from event server plugin ?

Even tried to fetch ip address of cameras using Configuration Api

Item cameraItem = Configuration.Instance.GetItem(deviceFqid);

cameraItem contained 3 properties out of which one is “IPAddress”, but the value of it is null.

The same configuration api worked from admin plugin though. Ip address can be found in “Address” property, in case of management client’s admin plugin.

Why does the same API function differently in management client plugin and event server plugin ?

Is there any way, i can get ip address of camera inside event server’s background plugin ?

Thank you.

The ConfigDump tool sample shows (in BackgroundDump.cs) how to use the GetIPAddressRequest in an Event Server plugin.

There might be more background information in the MIP Documentation “Introduction to MIP Message Communication”.

The Items you can get, and the properties they have is not the same across the environments. If you run the ConfigDump tool sample in Management Client and Smart Client you can get an overview of what you get in those environments.