In the event server background plugin: Find out when a camera has been renamed.

I have tried subscribing to the following event without any success.

I get some events firing when the event server starts but after that, nothing.

_MC_LocalChanged = EnvironmentManager.Instance.RegisterReceiver(ConfigurationChanged, new MessageIdFilter(MessageId.System.LocalConfigurationChangedIndication));
                _MC_SystemChanged = EnvironmentManager.Instance.RegisterReceiver(ConfigurationChanged, new MessageIdFilter(MessageId.System.SystemConfigurationChangedIndication));
                _MC_ServerChanged = EnvironmentManager.Instance.RegisterReceiver(ConfigurationChanged, new MessageIdFilter(MessageId.Server.ConfigurationChangedIndication));
                _MC_SettingsChanged = EnvironmentManager.Instance.RegisterReceiver(ConfigurationChanged, new MessageIdFilter(MessageId.Server.SettingsChangedMessage)); 

Can someone please tell me how I can detect a camera channel being renamed from inside an Event Server Background plugin please?

Please try the ConfigDump tool sample in the Event Server, if it works for you try to compare the code.

https://doc.developer.milestonesys.com/html/index.html?base=samples/configurationdump_sample.html&tree=tree_1.html

Hi again Rie :slight_smile:

Thanks for your answer. This is already how I am doing it.

Item cameraItem = Configuration.Instance.GetItem(new Guid(“656be09f-2ca9-4e3f-b307-84d2b23f8e7e”), Kind.Camera);

The problem is that it’s taking allot of resources because I have hundreds of cameras to check every second.

I wanted a way for the Milestone server to notify me when a name is changed.. This way I don’t have to scan the entire config all the time.

Can you guys add support for SettingsChangedMessage or ConfigurationChangedIndication in the event server please?

If you subscribe to SystemConfigurationChangedIndication you will in the handler get a Message object. Message.Data is a list of FQIDs containing the cameras that have been renamed. I verified that the handler does trigger after a camera rename, and that the camera FQID is there, in a BackgroundPlugin class in Event Server.