Fixed incoming call popup issue with CiscoCodec call direction value not being stored to ActiveCallItem

This commit is contained in:
Neil Dorin
2017-09-28 14:05:13 -06:00
parent 46cce6559c
commit 0bcb776ac5
2 changed files with 37 additions and 1 deletions

View File

@@ -11,4 +11,31 @@ namespace PepperDash.Essentials.Devices.Common.Codec
{
Unknown = 0, Incoming, Outgoing
}
public class CodecCallDirection
{
/// <summary>
/// Takes the Cisco call type and converts to the matching enum
/// </summary>
/// <param name="s"></param>
/// <returns></returns>
public static eCodecCallDirection ConvertToDirectionEnum(string s)
{
switch (s.ToLower())
{
case "incoming":
{
return eCodecCallDirection.Incoming;
}
case "outgoing":
{
return eCodecCallDirection.Outgoing;
}
default:
return eCodecCallDirection.Unknown;
}
}
}
}

View File

@@ -462,6 +462,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
tempActiveCall.Name = call.DisplayName.Value;
changeDetected = true;
}
if (call.Direction != null)
{
if (!string.IsNullOrEmpty(call.Direction.Value))
{
tempActiveCall.Direction = CodecCallDirection.ConvertToDirectionEnum(call.Direction.Value);
changeDetected = true;
}
}
if (changeDetected)
{
@@ -477,7 +485,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
Status = CodecCallStatus.ConvertToStatusEnum(call.Status.Value),
Name = call.DisplayName.Value,
Number = call.RemoteNumber.Value,
Type = CodecCallType.ConvertToTypeEnum(call.CallType.Value)
Type = CodecCallType.ConvertToTypeEnum(call.CallType.Value),
Direction = CodecCallDirection.ConvertToDirectionEnum(call.Direction.Value)
};
// Add it to the ActiveCalls List