diff --git a/PepperDashEssentials/AppServer/CotijaSystemController.cs b/PepperDashEssentials/AppServer/CotijaSystemController.cs index b2e3c9dd..23af9779 100644 --- a/PepperDashEssentials/AppServer/CotijaSystemController.cs +++ b/PepperDashEssentials/AppServer/CotijaSystemController.cs @@ -47,6 +47,8 @@ namespace PepperDash.Essentials long ServerReconnectInterval = 5000; + DateTime LastAckMessage; + string SystemUuid; List RoomBridges = new List(); @@ -307,14 +309,17 @@ namespace PepperDash.Essentials code = "Not available"; } var conn = WSClient == null ? "No client" : (WSClient.Connected ? "Yes" : "No"); + var secSinceLastAck = DateTime.Now - LastAckMessage; + CrestronConsole.ConsoleCommandResponse(@"Mobile Control Information: Server address: {0} System Name: {1} System UUID: {2} System User code: {3} - Connected?: {4}", url, name, SystemUuid, - code, conn); + Connected?: {4} + Seconds Since Last Ack: {5}", url, name, SystemUuid, + code, conn, secSinceLastAck.Seconds); } /// @@ -430,7 +435,12 @@ namespace PepperDash.Essentials if (WSClient != null && WSClient.Connected) { string message = JsonConvert.SerializeObject(o, Formatting.None, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore }); - Debug.Console(1, this, "Message TX: {0}", message); + + if (!message.Contains("/system/heartbeat")) + Debug.Console(1, this, "Message TX: {0}", message); + //else + // Debug.Console(1, this, "TX messages contains /system/heartbeat"); + var messageBytes = System.Text.Encoding.UTF8.GetBytes(message); var result = WSClient.Send(messageBytes, (uint)messageBytes.Length, WebSocketClient.WEBSOCKET_PACKET_TYPES.LWS_WS_OPCODE_07__TEXT_FRAME); if (result != WebSocketClient.WEBSOCKET_RESULT_CODES.WEBSOCKET_CLIENT_SUCCESS) @@ -656,7 +666,14 @@ namespace PepperDash.Essentials if(string.IsNullOrEmpty(message)) return; - Debug.Console(1, this, "Message RX: {0}", message); + if (!message.Contains("/system/heartbeat")) + Debug.Console(1, this, "Message RX: {0}", message); + else + { + LastAckMessage = DateTime.Now; + //Debug.Console(1, this, "RX message contains /system/heartbeat"); + } + try { var messageObj = JObject.Parse(message); diff --git a/PepperDashEssentials/AppServer/Messengers/AtcDdvc01Messenger.cs b/PepperDashEssentials/AppServer/Messengers/AtcDdvc01Messenger.cs index c1491f83..8e28d995 100644 --- a/PepperDashEssentials/AppServer/Messengers/AtcDdvc01Messenger.cs +++ b/PepperDashEssentials/AppServer/Messengers/AtcDdvc01Messenger.cs @@ -31,11 +31,19 @@ namespace PepperDash.Essentials.AppServer.Messengers /// /// 211 /// - const uint SCurrentCallString = 211; + const uint SCurrentCallNumber = 211; + /// + /// 212 + /// + const uint SCurrentCallName = 212; /// /// 221 /// const uint SHookState = 221; + /// + /// 222 + /// + const uint SCallDirection = 222; /// /// @@ -79,12 +87,14 @@ namespace PepperDash.Essentials.AppServer.Messengers /// void SendFullStatus() { + + this.PostStatusMessage(new { calls = GetCurrentCallList(), - callStatus = EISC.GetString(SHookState), - currentCallString = EISC.GetString(SCurrentCallString), + currentCallString = EISC.GetString(SCurrentCallNumber), currentDialString = EISC.GetString(SCurrentDialString), + isInCall = EISC.GetString(SHookState) == "Connected" }); } @@ -94,31 +104,33 @@ namespace PepperDash.Essentials.AppServer.Messengers /// protected override void CustomRegisterWithAppServer(CotijaSystemController appServerController) { - Action send = this.PostStatusMessage; - EISC.SetStringSigAction(SCurrentDialString, s => send(new { currentDialString = s })); + //EISC.SetStringSigAction(SCurrentDialString, s => PostStatusMessage(new { currentDialString = s })); EISC.SetStringSigAction(SHookState, s => { CurrentCallItem.Status = (eCodecCallStatus)Enum.Parse(typeof(eCodecCallStatus), s, true); - GetCurrentCallList(); - send(new - { - calls = GetCurrentCallList(), - callStatus = s - }); + //GetCurrentCallList(); + SendCallsList(); }); - EISC.SetStringSigAction(SCurrentCallString, s => + EISC.SetStringSigAction(SCurrentCallNumber, s => { - CurrentCallItem.Name = s; CurrentCallItem.Number = s; - send(new - { - calls = GetCurrentCallList(), - currentCallString = s - }); + SendCallsList(); }); + EISC.SetStringSigAction(SCurrentCallName, s => + { + CurrentCallItem.Name = s; + SendCallsList(); + }); + + EISC.SetStringSigAction(SCallDirection, s => + { + CurrentCallItem.Direction = (eCodecCallDirection)Enum.Parse(typeof(eCodecCallDirection), s, true); + SendCallsList(); + }); + // Add press and holds using helper Action addPHAction = (s, u) => AppServerController.AddAction(MessagePath + s, new PressAndHoldAction(b => EISC.SetBool(u, b))); @@ -126,9 +138,9 @@ namespace PepperDash.Essentials.AppServer.Messengers // Add straight pulse calls Action addAction = (s, u) => AppServerController.AddAction(MessagePath + s, new Action(() => EISC.PulseBool(u, 100))); - addAction("/endCall", BDialHangup); - addAction("/incomingAnswer", BIncomingAnswer); - addAction("/incomingReject", BIncomingReject); + addAction("/endCallById", BDialHangup); + addAction("/acceptById", BIncomingAnswer); + addAction("/rejectById", BIncomingReject); addAction("/speedDial1", BSpeedDial1); addAction("/speedDial2", BSpeedDial2); addAction("/speedDial3", BSpeedDial3); @@ -148,6 +160,14 @@ namespace PepperDash.Essentials.AppServer.Messengers })); } + void SendCallsList() + { + PostStatusMessage(new + { + calls = GetCurrentCallList(), + }); + } + /// /// Turns the /// diff --git a/PepperDashEssentials/AppServer/Messengers/AudioCodecBaseMessenger.cs b/PepperDashEssentials/AppServer/Messengers/AudioCodecBaseMessenger.cs new file mode 100644 index 00000000..b37b80da --- /dev/null +++ b/PepperDashEssentials/AppServer/Messengers/AudioCodecBaseMessenger.cs @@ -0,0 +1,102 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; + +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; + +using PepperDash.Essentials.Devices.Common.Codec; +using PepperDash.Essentials.Devices.Common.AudioCodec; + +namespace PepperDash.Essentials.AppServer.Messengers +{ + /// + /// Provides a messaging bridge for an AudioCodecBase device + /// + public class AudioCodecBaseMessenger : MessengerBase + { + /// + /// Device being bridged + /// + public AudioCodecBase Codec { get; set; } + + /// + /// Constuctor + /// + /// + /// + /// + public AudioCodecBaseMessenger(string key, AudioCodecBase codec, string messagePath) + : base(key, messagePath) + { + if (codec == null) + throw new ArgumentNullException("codec"); + + Codec = codec; + codec.CallStatusChange += new EventHandler(codec_CallStatusChange); + + } + + protected override void CustomRegisterWithAppServer(CotijaSystemController appServerController) + { + appServerController.AddAction(MessagePath + "/fullStatus", new Action(SendAtcFullMessageObject)); + appServerController.AddAction(MessagePath + "/dial", new Action(s => Codec.Dial(s))); + appServerController.AddAction(MessagePath + "/endCallById", new Action(s => + { + var call = GetCallWithId(s); + if (call != null) + Codec.EndCall(call); + })); + appServerController.AddAction(MessagePath + "/endAllCalls", new Action(Codec.EndAllCalls)); + appServerController.AddAction(MessagePath + "/dtmf", new Action(s => Codec.SendDtmf(s))); + appServerController.AddAction(MessagePath + "/rejectById", new Action(s => + { + var call = GetCallWithId(s); + if (call != null) + Codec.RejectCall(call); + })); + appServerController.AddAction(MessagePath + "/acceptById", new Action(s => + { + var call = GetCallWithId(s); + if (call != null) + Codec.AcceptCall(call); + })); + } + + /// + /// Helper to grab a call with string ID + /// + /// + /// + CodecActiveCallItem GetCallWithId(string id) + { + return Codec.ActiveCalls.FirstOrDefault(c => c.Id == id); + } + + void codec_CallStatusChange(object sender, CodecCallStatusItemChangeEventArgs e) + { + SendAtcFullMessageObject(); + } + + /// + /// Helper method to build call status for vtc + /// + /// + void SendAtcFullMessageObject() + { + + var info = Codec.CodecInfo; + PostStatusMessage(new + { + isInCall = Codec.IsInCall, + calls = Codec.ActiveCalls, + info = new + { + phoneNumber = info.PhoneNumber + } + }); + } + } +} \ No newline at end of file diff --git a/PepperDashEssentials/AppServer/Messengers/SystemMonitorMessenger.cs b/PepperDashEssentials/AppServer/Messengers/SystemMonitorMessenger.cs index 6f59cf05..7b56ab29 100644 --- a/PepperDashEssentials/AppServer/Messengers/SystemMonitorMessenger.cs +++ b/PepperDashEssentials/AppServer/Messengers/SystemMonitorMessenger.cs @@ -27,8 +27,10 @@ namespace PepperDash.Essentials.AppServer.Messengers foreach (var p in SysMon.ProgramStatusFeedbackCollection) { - p.Value.AggregatedProgramInfoFeedback.OutputChange += new EventHandler(AggregatedProgramInfoFeedback_OutputChange); + p.Value.ProgramInfoChanged += new EventHandler(ProgramInfoChanged); } + + CrestronConsole.AddNewConsoleCommand(s => SendFullStatusMessage(), "SendFullSysMonStatus", "Sends the full System Monitor Status", ConsoleAccessLevelEnum.AccessOperator); } /// @@ -36,19 +38,10 @@ namespace PepperDash.Essentials.AppServer.Messengers /// /// /// - void AggregatedProgramInfoFeedback_OutputChange(object sender, PepperDash.Essentials.Core.FeedbackEventArgs e) + void ProgramInfoChanged(object sender, ProgramInfoEventArgs e) { - SendProgramInfoStatusMessage(e.StringValue); - } - - // Deserializes the program info into an object that can be setn in a status message - void SendProgramInfoStatusMessage(string serializedProgramInfo) - { - var programInfo = JsonConvert.DeserializeObject(serializedProgramInfo); - - Debug.Console(2, "Posting Status Message: {0}", programInfo.ToString()); - - PostStatusMessage(programInfo); + Debug.Console(1, "Posting Status Message: {0}", e.ProgramInfo.ToString()); + PostStatusMessage(e.ProgramInfo); } /// @@ -67,13 +60,13 @@ namespace PepperDash.Essentials.AppServer.Messengers foreach (var p in SysMon.ProgramStatusFeedbackCollection) { - SendProgramInfoStatusMessage(p.Value.AggregatedProgramInfoFeedback.StringValue); + PostStatusMessage(p.Value.ProgramInfo); } } void SendSystemMonitorStatusMessage() { - Debug.Console(2, "Posting System Monitor Status Message."); + Debug.Console(1, "Posting System Monitor Status Message."); // This takes a while, launch a new thread CrestronInvoke.BeginInvoke((o) => diff --git a/PepperDashEssentials/AppServer/Messengers/VideoCodecBaseMessenger.cs b/PepperDashEssentials/AppServer/Messengers/VideoCodecBaseMessenger.cs index 3076cb56..5e545aac 100644 --- a/PepperDashEssentials/AppServer/Messengers/VideoCodecBaseMessenger.cs +++ b/PepperDashEssentials/AppServer/Messengers/VideoCodecBaseMessenger.cs @@ -13,7 +13,7 @@ using PepperDash.Essentials.Devices.Common.VideoCodec; namespace PepperDash.Essentials.AppServer.Messengers { /// - /// Provides a messaging bridge for a VideoCodecBase + /// Provides a messaging bridge for a VideoCodecBase device /// public class VideoCodecBaseMessenger : MessengerBase { @@ -41,7 +41,31 @@ namespace PepperDash.Essentials.AppServer.Messengers { dirCodec.DirectoryResultReturned += new EventHandler(dirCodec_DirectoryResultReturned); } + + var recCodec = codec as IHasCallHistory; + if (recCodec != null) + { + recCodec.CallHistory.RecentCallsListHasChanged += new EventHandler(CallHistory_RecentCallsListHasChanged); + } } + + /// + /// + /// + /// + /// + void CallHistory_RecentCallsListHasChanged(object sender, EventArgs e) + { + var recents = (sender as CodecCallHistory).RecentCalls; + + if (recents != null) + { + PostStatusMessage(new + { + recentCalls = recents + }); + } + } /// /// @@ -50,7 +74,6 @@ namespace PepperDash.Essentials.AppServer.Messengers /// void dirCodec_DirectoryResultReturned(object sender, DirectoryEventArgs e) { - var dir = e.Directory; PostStatusMessage(new { currentDirectory = e.Directory @@ -102,6 +125,7 @@ namespace PepperDash.Essentials.AppServer.Messengers appServerController.AddAction(MessagePath + "/directoryRoot", new Action(GetDirectoryRoot)); appServerController.AddAction(MessagePath + "/directoryById", new Action(s => GetDirectory(s))); appServerController.AddAction(MessagePath + "/directorySearch", new Action(s => DirectorySearch(s))); + appServerController.AddAction(MessagePath + "/getCallHistory", new Action(GetCallHistory)); appServerController.AddAction(MessagePath + "/privacyModeOn", new Action(Codec.PrivacyModeOn)); appServerController.AddAction(MessagePath + "/privacyModeOff", new Action(Codec.PrivacyModeOff)); appServerController.AddAction(MessagePath + "/privacyModeToggle", new Action(Codec.PrivacyModeToggle)); @@ -111,6 +135,24 @@ namespace PepperDash.Essentials.AppServer.Messengers appServerController.AddAction(MessagePath + "/standbyOff", new Action(Codec.StandbyDeactivate)); } + void GetCallHistory() + { + var codec = (Codec as IHasCallHistory); + + if (codec != null) + { + var recents = codec.CallHistory.RecentCalls; + + if (recents != null) + { + PostStatusMessage(new + { + recentCalls = recents + }); + } + } + } + public void GetFullStatusMessage() { @@ -228,7 +270,9 @@ namespace PepperDash.Essentials.AppServer.Messengers sipURI = info.SipUri }, showSelfViewByDefault = Codec.ShowSelfViewByDefault, - hasDirectory = Codec is IHasDirectory + hasDirectory = Codec is IHasDirectory, + hasRecents = Codec is IHasCallHistory, + hasCameras = Codec is IHasCameraControl }); } } diff --git a/PepperDashEssentials/AppServer/RoomBridges/CotijaEssentialsHuddleSpaceRoomBridge.cs b/PepperDashEssentials/AppServer/RoomBridges/CotijaEssentialsHuddleSpaceRoomBridge.cs index 36ae6c03..976cb484 100644 --- a/PepperDashEssentials/AppServer/RoomBridges/CotijaEssentialsHuddleSpaceRoomBridge.cs +++ b/PepperDashEssentials/AppServer/RoomBridges/CotijaEssentialsHuddleSpaceRoomBridge.cs @@ -12,6 +12,7 @@ using PepperDash.Essentials.Core; using PepperDash.Essentials.Room.Cotija; using PepperDash.Essentials.Devices.Common.Codec; using PepperDash.Essentials.Devices.Common.VideoCodec; +using PepperDash.Essentials.Devices.Common.AudioCodec; namespace PepperDash.Essentials { @@ -22,6 +23,8 @@ namespace PepperDash.Essentials public VideoCodecBaseMessenger VCMessenger { get; private set; } + public AudioCodecBaseMessenger ACMessenger { get; private set; } + /// /// /// @@ -92,30 +95,25 @@ namespace PepperDash.Essentials sscRoom.CurrentSingleSourceChange += new SourceInfoChangeHandler(Room_CurrentSingleSourceChange); var vcRoom = Room as IHasVideoCodec; - if (vcRoom != null) + if (vcRoom != null && vcRoom.VideoCodec != null) { var codec = vcRoom.VideoCodec; var key = vcRoom.VideoCodec.Key + "-" + parent.Key; VCMessenger = new VideoCodecBaseMessenger(key, vcRoom.VideoCodec, "/device/videoCodec"); VCMessenger.RegisterWithAppServer(Parent); - // May need to move this or remove this - codec.CallStatusChange += new EventHandler(codec_CallStatusChange); - vcRoom.IsSharingFeedback.OutputChange += new EventHandler(IsSharingFeedback_OutputChange); - - //Parent.AddAction("/device/videoCodec/dial", new Action(s => codec.Dial(s))); - //Parent.AddAction("/device/videoCodec/endCall", new Action(s => - //{ - // var call = codec.ActiveCalls.FirstOrDefault(c => c.Id == s); - // if (call != null) - // { - // codec.EndCall(call); - // } - //})); - //Parent.AddAction("/device/videoCodec/endAllCalls", new Action(() => codec.EndAllCalls())); } + var acRoom = Room as IHasAudioCodec; + if (acRoom != null && acRoom.AudioCodec != null) + { + var codec = acRoom.AudioCodec; + var key = acRoom.AudioCodec.Key + "-" + parent.Key; + ACMessenger = new AudioCodecBaseMessenger(key, acRoom.AudioCodec, "/device/audioCodec"); + ACMessenger.RegisterWithAppServer(Parent); + } + var defCallRm = Room as IRunDefaultCallRoute; if (defCallRm != null) { @@ -170,18 +168,18 @@ namespace PepperDash.Essentials }); } - /// - /// Handler for codec changes - /// - void codec_CallStatusChange(object sender, CodecCallStatusItemChangeEventArgs e) - { - PostStatusMessage(new - { - calls = GetCallsMessageObject(), - //vtc = GetVtcCallsMessageObject() - }); + ///// + ///// Handler for codec changes + ///// + //void codec_CallStatusChange(object sender, CodecCallStatusItemChangeEventArgs e) + //{ + // PostStatusMessage(new + // { + // calls = GetCallsMessageObject(), + // //vtc = GetVtcCallsMessageObject() + // }); - } + //} /// /// Helper for posting status message @@ -426,52 +424,52 @@ namespace PepperDash.Essentials PostStatusMessage(new { - calls = GetCallsMessageObject(), + //calls = GetCallsMessageObject(), isOn = room.OnFeedback.BoolValue, selectedSourceKey = sourceKey, - vtc = GetVtcCallsMessageObject(), + //vtc = GetVtcCallsMessageObject(), volumes = volumes }); } - /// - /// Helper to return a anonymous object with the call data for JSON message - /// - /// - object GetCallsMessageObject() - { - var callRm = Room as IHasVideoCodec; - if (callRm == null) - return null; - return new - { - activeCalls = callRm.VideoCodec.ActiveCalls, - callType = callRm.CallTypeFeedback.IntValue, - inCall = callRm.InCallFeedback.BoolValue, - isSharing = callRm.IsSharingFeedback.BoolValue, - privacyModeIsOn = callRm.PrivacyModeIsOnFeedback.BoolValue - }; - } + ///// + ///// Helper to return a anonymous object with the call data for JSON message + ///// + ///// + //object GetCallsMessageObject() + //{ + // var callRm = Room as IHasVideoCodec; + // if (callRm == null) + // return null; + // return new + // { + // activeCalls = callRm.VideoCodec.ActiveCalls, + // callType = callRm.CallTypeFeedback.IntValue, + // inCall = callRm.InCallFeedback.BoolValue, + // isSharing = callRm.IsSharingFeedback.BoolValue, + // privacyModeIsOn = callRm.PrivacyModeIsOnFeedback.BoolValue + // }; + //} - /// - /// Helper method to build call status for vtc - /// - /// - object GetVtcCallsMessageObject() - { - var callRm = Room as IHasVideoCodec; - object vtc = null; - if (callRm != null) - { - var codec = callRm.VideoCodec; - vtc = new - { - isInCall = codec.IsInCall, - calls = codec.ActiveCalls - }; - } - return vtc; - } + ///// + ///// Helper method to build call status for vtc + ///// + ///// + //object GetVtcCallsMessageObject() + //{ + // var callRm = Room as IHasVideoCodec; + // object vtc = null; + // if (callRm != null) + // { + // var codec = callRm.VideoCodec; + // vtc = new + // { + // isInCall = codec.IsInCall, + // calls = codec.ActiveCalls + // }; + // } + // return vtc; + //} } /// diff --git a/PepperDashEssentials/ControlSystem.cs b/PepperDashEssentials/ControlSystem.cs index a63ceee6..bd33a276 100644 --- a/PepperDashEssentials/ControlSystem.cs +++ b/PepperDashEssentials/ControlSystem.cs @@ -212,12 +212,13 @@ namespace PepperDash.Essentials void Load() { LoadDevices(); - LinkSystemMonitorToAppServer(); LoadTieLines(); LoadRooms(); LoadLogoServer(); DeviceManager.ActivateAll(); + + LinkSystemMonitorToAppServer(); } void LinkSystemMonitorToAppServer() @@ -235,9 +236,7 @@ namespace PepperDash.Essentials messenger.RegisterWithAppServer(appServer); - DeviceManager.AddDevice(messenger); - - + DeviceManager.AddDevice(messenger); } } diff --git a/PepperDashEssentials/PepperDashEssentials.csproj b/PepperDashEssentials/PepperDashEssentials.csproj index 71a6a1d6..6d07f6fa 100644 --- a/PepperDashEssentials/PepperDashEssentials.csproj +++ b/PepperDashEssentials/PepperDashEssentials.csproj @@ -109,6 +109,7 @@ + diff --git a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs b/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs index 72b0d7f7..62b11e49 100644 --- a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs +++ b/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs @@ -12,11 +12,12 @@ using PepperDash.Essentials.Core.Config; using PepperDash.Essentials.Room.Config; using PepperDash.Essentials.Devices.Common.Codec; using PepperDash.Essentials.Devices.Common.VideoCodec; +using PepperDash.Essentials.Devices.Common.AudioCodec; namespace PepperDash.Essentials { public class EssentialsHuddleVtc1Room : EssentialsRoomBase, IHasCurrentSourceInfoChange, - IPrivacy, IHasCurrentVolumeControls, IRunRouteAction, IRunDefaultCallRoute, IHasVideoCodec + IPrivacy, IHasCurrentVolumeControls, IRunRouteAction, IRunDefaultCallRoute, IHasVideoCodec, IHasAudioCodec { public event EventHandler CurrentVolumeDeviceChange; public event SourceInfoChangeHandler CurrentSingleSourceChange; @@ -27,10 +28,10 @@ namespace PepperDash.Essentials public BoolFeedback InCallFeedback { get; private set; } - /// - /// Make this more specific - /// - public List ActiveCalls { get; private set; } + ///// + ///// Make this more specific + ///// + //public List ActiveCalls { get; private set; } /// /// States: 0 for on hook, 1 for video, 2 for audio, 3 for telekenesis @@ -108,6 +109,8 @@ namespace PepperDash.Essentials public VideoCodecBase VideoCodec { get; private set; } + public AudioCodecBase AudioCodec { get; private set; } + public bool ExcludeFromGlobalFunctions { get; set; } /// @@ -197,7 +200,6 @@ namespace PepperDash.Essentials CCriticalSection SourceSelectLock = new CCriticalSection(); - public EssentialsHuddleVtc1Room(DeviceConfig config) : base(config) { @@ -212,6 +214,11 @@ namespace PepperDash.Essentials if (VideoCodec == null) throw new ArgumentNullException("codec cannot be null"); + AudioCodec = DeviceManager.GetDeviceForKey(PropertiesConfig.AudioCodecKey) as + PepperDash.Essentials.Devices.Common.AudioCodec.AudioCodecBase; + if (AudioCodec == null) + Debug.Console(0, this, "No Audio Codec Found"); + DefaultAudioDevice = DeviceManager.GetDeviceForKey(PropertiesConfig.DefaultAudioKey) as IBasicVolumeControls; Initialize(); @@ -261,9 +268,30 @@ namespace PepperDash.Essentials }; } - InCallFeedback = new BoolFeedback(() => VideoCodec.IsInCall); + + // Combines call feedback from both codecs if available + InCallFeedback = new BoolFeedback(() => + { + bool inAudioCall = false; + bool inVideoCall = false; + + if(AudioCodec != null) + inAudioCall = AudioCodec.IsInCall; + + if(VideoCodec != null) + inVideoCall = AudioCodec.IsInCall; + + if (inAudioCall || inVideoCall) + return true; + else + return false; + }); + VideoCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate(); + if (AudioCodec != null) + AudioCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate(); + IsSharingFeedback = new BoolFeedback(() => VideoCodec.SharingContentIsOnFeedback.BoolValue); VideoCodec.SharingContentIsOnFeedback.OutputChange += (o, a) => this.IsSharingFeedback.FireUpdate(); diff --git a/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs b/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs index be65410e..13bf6a85 100644 --- a/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs +++ b/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs @@ -484,9 +484,9 @@ namespace PepperDash.Essentials.UIDrivers.VC TriList.SetString(timeTextOffset + i, timeText); string iconName = null; - if (c.OccurenceType == eCodecOccurrenceType.Received) + if (c.OccurrenceType == eCodecOccurrenceType.Received) iconName = "Misc-18_Light"; - else if (c.OccurenceType == eCodecOccurrenceType.Placed) + else if (c.OccurrenceType == eCodecOccurrenceType.Placed) iconName = "Misc-17_Light"; else iconName = "Delete";