mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 12:44:58 +00:00
Touchups to ddvc mob codec messages
This commit is contained in:
@@ -8,6 +8,7 @@ using Crestron.SimplSharpPro.EthernetCommunication;
|
|||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Devices.Common.Codec;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.AppServer.Messengers
|
namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
{
|
{
|
||||||
@@ -55,6 +56,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
{ "#", 212 },
|
{ "#", 212 },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
CodecActiveCallItem CurrentCallItem;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -65,6 +68,10 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
: base(messagePath)
|
: base(messagePath)
|
||||||
{
|
{
|
||||||
EISC = eisc;
|
EISC = eisc;
|
||||||
|
|
||||||
|
CurrentCallItem = new CodecActiveCallItem();
|
||||||
|
CurrentCallItem.Type = eCodecCallType.Audio;
|
||||||
|
CurrentCallItem.Id = "-audio-";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -72,15 +79,12 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
void SendFullStatus()
|
void SendFullStatus()
|
||||||
{
|
{
|
||||||
|
|
||||||
this.PostStatusMessage(new
|
this.PostStatusMessage(new
|
||||||
{
|
{
|
||||||
atc = new
|
calls = GetCurrentCallList(),
|
||||||
{
|
callStatus = EISC.GetString(SHookState),
|
||||||
callStatus = EISC.GetString(SHookState),
|
currentCallString = EISC.GetString(SCurrentCallString),
|
||||||
currentCallString = EISC.GetString(SCurrentCallString),
|
currentDialString = EISC.GetString(SCurrentDialString),
|
||||||
currentDialString = EISC.GetString(SCurrentDialString),
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,8 +96,28 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
{
|
{
|
||||||
Action<object> send = this.PostStatusMessage;
|
Action<object> send = this.PostStatusMessage;
|
||||||
EISC.SetStringSigAction(SCurrentDialString, s => send(new { currentDialString = s }));
|
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
|
// Add press and holds using helper
|
||||||
Action<string, uint> addPHAction = (s, u) =>
|
Action<string, uint> addPHAction = (s, u) =>
|
||||||
@@ -123,5 +147,21 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Turns the
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
List<CodecActiveCallItem> GetCurrentCallList()
|
||||||
|
{
|
||||||
|
if (CurrentCallItem.Status == eCodecCallStatus.Disconnected)
|
||||||
|
{
|
||||||
|
return new List<CodecActiveCallItem>();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return new List<CodecActiveCallItem>() { CurrentCallItem };
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -650,86 +650,5 @@ namespace PepperDash.Essentials.Room.Cotija
|
|||||||
EISC.StringInput[StringJoin.UserCodeToSystem].StringValue = UserCode;
|
EISC.StringInput[StringJoin.UserCodeToSystem].StringValue = UserCode;
|
||||||
EISC.StringInput[StringJoin.ServerUrl].StringValue = Parent.Config.ClientAppUrl;
|
EISC.StringInput[StringJoin.ServerUrl].StringValue = Parent.Config.ClientAppUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="oldKey"></param>
|
|
||||||
/// <param name="newKey"></param>
|
|
||||||
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);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user