diff --git a/PepperDashEssentials/AppServer/Messengers/AtcDdvc01Messenger.cs b/PepperDashEssentials/AppServer/Messengers/AtcDdvc01Messenger.cs index 8eb47aa4..882ad317 100644 --- a/PepperDashEssentials/AppServer/Messengers/AtcDdvc01Messenger.cs +++ b/PepperDashEssentials/AppServer/Messengers/AtcDdvc01Messenger.cs @@ -8,6 +8,7 @@ using Crestron.SimplSharpPro.EthernetCommunication; using PepperDash.Core; using PepperDash.Essentials.Core; +using PepperDash.Essentials.Devices.Common.Codec; namespace PepperDash.Essentials.AppServer.Messengers { @@ -55,6 +56,8 @@ namespace PepperDash.Essentials.AppServer.Messengers { "#", 212 }, }; + CodecActiveCallItem CurrentCallItem; + /// /// @@ -65,6 +68,10 @@ namespace PepperDash.Essentials.AppServer.Messengers : base(messagePath) { EISC = eisc; + + CurrentCallItem = new CodecActiveCallItem(); + CurrentCallItem.Type = eCodecCallType.Audio; + CurrentCallItem.Id = "-audio-"; } /// @@ -72,15 +79,12 @@ namespace PepperDash.Essentials.AppServer.Messengers /// void SendFullStatus() { - this.PostStatusMessage(new { - atc = new - { - callStatus = EISC.GetString(SHookState), - currentCallString = EISC.GetString(SCurrentCallString), - currentDialString = EISC.GetString(SCurrentDialString), - } + calls = GetCurrentCallList(), + callStatus = EISC.GetString(SHookState), + currentCallString = EISC.GetString(SCurrentCallString), + currentDialString = EISC.GetString(SCurrentDialString), }); } @@ -92,8 +96,28 @@ namespace PepperDash.Essentials.AppServer.Messengers { Action send = this.PostStatusMessage; EISC.SetStringSigAction(SCurrentDialString, s => send(new { currentDialString = s })); - EISC.SetStringSigAction(SCurrentCallString, s => send(new { currentCallString = s })); - EISC.SetStringSigAction(SHookState, s => send(new { callStatus = s })); + + EISC.SetStringSigAction(SHookState, s => + { + CurrentCallItem.Status = (eCodecCallStatus)Enum.Parse(typeof(eCodecCallStatus), s, true); + GetCurrentCallList(); + send(new + { + calls = GetCurrentCallList(), + callStatus = s + }); + }); + + EISC.SetStringSigAction(SCurrentCallString, s => + { + CurrentCallItem.Name = s; + CurrentCallItem.Number = s; + send(new + { + calls = GetCurrentCallList(), + currentCallString = s + }); + }); // Add press and holds using helper Action addPHAction = (s, u) => @@ -123,5 +147,21 @@ namespace PepperDash.Essentials.AppServer.Messengers } })); } + + /// + /// Turns the + /// + /// + List GetCurrentCallList() + { + if (CurrentCallItem.Status == eCodecCallStatus.Disconnected) + { + return new List(); + } + else + { + return new List() { CurrentCallItem }; + } + } } } \ No newline at end of file diff --git a/PepperDashEssentials/AppServer/RoomBridges/CotijaDdvc01RoomBridge.cs b/PepperDashEssentials/AppServer/RoomBridges/CotijaDdvc01RoomBridge.cs index 141dece9..d99534b4 100644 --- a/PepperDashEssentials/AppServer/RoomBridges/CotijaDdvc01RoomBridge.cs +++ b/PepperDashEssentials/AppServer/RoomBridges/CotijaDdvc01RoomBridge.cs @@ -650,86 +650,5 @@ namespace PepperDash.Essentials.Room.Cotija EISC.StringInput[StringJoin.UserCodeToSystem].StringValue = UserCode; EISC.StringInput[StringJoin.ServerUrl].StringValue = Parent.Config.ClientAppUrl; } - - /// - /// - /// - /// - /// - void SourceChange(string oldKey, string newKey) - { - /* Example message - * { -   "type":"/room/status", -   "content": { -     "selectedSourceKey": "off", -   } - } - */ - //if (type == ChangeType.WillChange) - //{ - // // Disconnect from previous source - - // if (info != null) - // { - // var previousDev = info.SourceDevice; - - // // device type interfaces - // if (previousDev is ISetTopBoxControls) - // (previousDev as ISetTopBoxControls).UnlinkActions(Parent); - // // common interfaces - // if (previousDev is IChannel) - // (previousDev as IChannel).UnlinkActions(Parent); - // if (previousDev is IColor) - // (previousDev as IColor).UnlinkActions(Parent); - // if (previousDev is IDPad) - // (previousDev as IDPad).UnlinkActions(Parent); - // if (previousDev is IDvr) - // (previousDev as IDvr).UnlinkActions(Parent); - // if (previousDev is INumericKeypad) - // (previousDev as INumericKeypad).UnlinkActions(Parent); - // if (previousDev is IPower) - // (previousDev as IPower).UnlinkActions(Parent); - // if (previousDev is ITransport) - // (previousDev as ITransport).UnlinkActions(Parent); - // } - - - // var huddleRoom = room as EssentialsHuddleSpaceRoom; - // JObject roomStatus = new JObject(); - // roomStatus.Add("selectedSourceKey", huddleRoom.CurrentSourceInfoKey); - - // JObject message = new JObject(); - - // message.Add("type", "/room/status/"); - // message.Add("content", roomStatus); - - // Parent.PostToServer(message); - //} - //else - //{ - // if (info != null) - // { - // var dev = info.SourceDevice; - - // if (dev is ISetTopBoxControls) - // (dev as ISetTopBoxControls).LinkActions(Parent); - // if (dev is IChannel) - // (dev as IChannel).LinkActions(Parent); - // if (dev is IColor) - // (dev as IColor).LinkActions(Parent); - // if (dev is IDPad) - // (dev as IDPad).LinkActions(Parent); - // if (dev is IDvr) - // (dev as IDvr).LinkActions(Parent); - // if (dev is INumericKeypad) - // (dev as INumericKeypad).LinkActions(Parent); - // if (dev is IPower) - // (dev as IPower).LinkActions(Parent); - // if (dev is ITransport) - // (dev as ITransport).LinkActions(Parent); - // } - //} - } } } \ No newline at end of file