feat(essentials): Adds hold/resume/duration features to call status

This commit is contained in:
Neil Dorin
2021-11-10 13:49:43 -07:00
parent e7ca32207c
commit 6dd882b1a0
5 changed files with 106 additions and 14 deletions

View File

@@ -30,7 +30,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
IHasScheduleAwareness, IOccupancyStatusProvider, IHasCodecLayouts, IHasCodecSelfView,
ICommunicationMonitor, IRouting, IHasCodecCameras, IHasCameraAutoMode, IHasCodecRoomPresets,
IHasExternalSourceSwitching, IHasBranding, IHasCameraOff, IHasCameraMute, IHasDoNotDisturbMode,
IHasHalfWakeMode
IHasHalfWakeMode, IHasCallHold
{
private bool _externalSourceChangeRequested;
@@ -847,6 +847,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
changeDetected = true;
}
}
if(call.Duration != null)
{
if(!string.IsNullOrEmpty(call.Duration.Value))
{
tempActiveCall.Duration = call.Duration.DurationValue;
changeDetected = true;
}
}
if(call.PlacedOnHold != null)
{
tempActiveCall.IsOnHold = call.PlacedOnHold.BoolValue;
changeDetected = true;
}
if (changeDetected)
{
@@ -865,7 +878,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
Name = call.DisplayName.Value,
Number = call.RemoteNumber.Value,
Type = CodecCallType.ConvertToTypeEnum(call.CallType.Value),
Direction = CodecCallDirection.ConvertToDirectionEnum(call.Direction.Value)
Direction = CodecCallDirection.ConvertToDirectionEnum(call.Direction.Value),
Duration = call.Duration.DurationValue,
IsOnHold = call.PlacedOnHold.BoolValue,
};
// Add it to the ActiveCalls List
@@ -1348,7 +1363,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
{
SendText(string.Format("xCommand Dial Number: \"{0}\" Protocol: {1} CallRate: {2} CallType: {3} BookingId: {4}", number, protocol, callRate, callType, meetingId));
}
public override void EndCall(CodecActiveCallItem activeCall)
{
SendText(string.Format("xCommand Call Disconnect CallId: {0}", activeCall.Id));
@@ -1372,6 +1388,20 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
SendText("xCommand Call Reject");
}
#region IHasCallHold Members
public void HoldCall(CodecActiveCallItem activeCall)
{
SendText(string.Format("xCommand Call Hold CallId: {0}", activeCall.Id));
}
public void ResumeCall(CodecActiveCallItem activeCall)
{
SendText(string.Format("xCommand Call Resume CallId: {0}", activeCall.Id));
}
#endregion
public override void SendDtmf(string s)
{
SendText(string.Format("xCommand Call DTMFSend CallId: {0} DTMFString: \"{1}\"", GetCallId(), s));

View File

@@ -1949,9 +1949,30 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public string Value { get; set; }
}
public class Duration
public class Duration : ValueProperty
{
public string Value { get; set; }
private string _Value;
public string Value
{
get
{
return _Value;
}
set
{
_Value = value;
OnValueChanged();
}
}
public TimeSpan DurationValue
{
get
{
return new TimeSpan(0, 0, Int32.Parse(_Value));
}
}
}
public class FacilityServiceId
@@ -1964,9 +1985,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public string Value { get; set; }
}
public class PlacedOnHold
public class PlacedOnHold : ValueProperty
{
public string Value { get; set; }
public bool BoolValue { get; private set; }
public string Value
{
set
{
// If the incoming value is "True" it sets the BoolValue true, otherwise sets it false
BoolValue = value == "True";
OnValueChanged();
}
}
}
public class Protocol
@@ -2014,6 +2045,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
{
CallType = new CallType();
Status = new Status2();
Duration = new Duration();
}
}