From 0e5cecbfc3e885c6797deb6a2aafbca7f8f97e2c Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Fri, 11 Feb 2022 14:16:40 -0700 Subject: [PATCH] fix(essentials): #901 Refines initial synchronization sequence Makes sure that the AddedContact feedback subscription is excluded right away, but later included after the phonebook is retrieved. This should ensure we get the initial phonebook and all subsequent additions at runtime while also minimizing initial data volume. --- .../VideoCodec/ZoomRoom/ZoomRoom.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs index f3891dde..1db04f0c 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs @@ -102,6 +102,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom PhonebookSyncState = new CodecPhonebookSyncState(Key + "--PhonebookSync"); + PhonebookSyncState.InitialSyncCompleted += (o, a) => ResubscribeForAddedContacts(); + PortGather = new CommunicationGather(Communication, Delimiters) {IncludeDelimiter = true}; PortGather.LineReceived += Port_LineReceived; @@ -1017,10 +1019,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom // Currently the feedback exclusions don't work when using the API in JSON response mode // But leave these here in case the API gets updated in the future // These may work as of 5.9.4 - if (_props.DisablePhonebookAutoDownload) - { - SendText("zFeedback Register Op: ex Path: /Event/Phonebook/AddedContact"); - } + + // In 5.9.4 we're getting sent an AddedContact message for every contact in the phonebook on connect, which is redunant and way too much data + // We want to exclude these messages right away until after we've retrieved the entire phonebook and then we can re-enable them + SendText("zFeedback Register Op: ex Path: /Event/Phonebook/AddedContact"); + SendText("zFeedback Register Op: ex Path: /Event/InfoResult/Info/callin_country_list"); SendText("zFeedback Register Op: ex Path: /Event/InfoResult/Info/callout_country_list"); SendText("zFeedback Register Op: ex Path: /Event/InfoResult/Info/toll_free_callinLlist"); @@ -1028,6 +1031,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom SendText("zStatus SystemUnit"); } + /// + /// Removes the feedback exclusion for added contacts + /// + private void ResubscribeForAddedContacts() + { + SendText("zFeedback Register Op: in Path: /Event/Phonebook/AddedContact"); + } + /// /// Processes non-JSON responses as their are received ///