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:
-
https://developer.milestonesys.com/s/article/how-to-get-camera-IP-address-using-MIP-SDK
-
https://developer.milestonesys.com/s/question/0D50O00003V8ByrSAF/
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.