diff --git a/Essentials Devices Common/Essentials Devices Common/Codec/eCodecCallDirection.cs b/Essentials Devices Common/Essentials Devices Common/Codec/eCodecCallDirection.cs index 41d68eeb..e397ae09 100644 --- a/Essentials Devices Common/Essentials Devices Common/Codec/eCodecCallDirection.cs +++ b/Essentials Devices Common/Essentials Devices Common/Codec/eCodecCallDirection.cs @@ -11,4 +11,31 @@ namespace PepperDash.Essentials.Devices.Common.Codec { Unknown = 0, Incoming, Outgoing } + + public class CodecCallDirection + { + /// + /// Takes the Cisco call type and converts to the matching enum + /// + /// + /// + public static eCodecCallDirection ConvertToDirectionEnum(string s) + { + switch (s.ToLower()) + { + case "incoming": + { + return eCodecCallDirection.Incoming; + } + case "outgoing": + { + return eCodecCallDirection.Outgoing; + } + default: + return eCodecCallDirection.Unknown; + } + + } + + } } \ No newline at end of file diff --git a/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoCodec.cs b/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoCodec.cs index 2f14ab2f..e8faa1de 100644 --- a/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoCodec.cs +++ b/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoCodec.cs @@ -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