Fixed issue with corporate phonebook contact entries missing some properties

This commit is contained in:
Neil Dorin
2017-09-28 16:14:24 -06:00
parent bde56a22d1
commit 3e6f345b8b

View File

@@ -213,12 +213,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
{
contact.Name = c.Name.Value;
contact.ContactId = c.ContactId.Value;
if(c.Title != null)
contact.Title = c.Title.Value;
if (Debug.Level > 0)
Debug.Console(1, "{0}\nContact Methods:", contact.Name);
foreach (ContactMethod m in c.ContactMethod)
{
var tempContactMethod = new PepperDash.Essentials.Devices.Common.Codec.ContactMethod();
if (m.CallType != null)
{
eContactMethodCallType callType = eContactMethodCallType.Unknown;
if (m.CallType != null)
@@ -227,8 +234,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
callType = eContactMethodCallType.Audio;
else if (m.CallType.Value.ToLower() == "video")
callType = eContactMethodCallType.Video;
tempContactMethod.CallType = callType;
}
}
if (m.Device != null)
{
eContactMethodDevice device = eContactMethodDevice.Unknown;
if (m.Device.Value.ToLower() == "mobile")
@@ -240,16 +252,16 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
else if (m.Device.Value.ToLower() == "other")
device = eContactMethodDevice.Other;
if (Debug.Level > 0)
Debug.Console(1, "Number: {0} CallType: {1} Device: {2}", m.Number.Value, callType, device);
tempContactMethod.Device = device;
}
contact.ContactMethods.Add(new PepperDash.Essentials.Devices.Common.Codec.ContactMethod()
{
Number = m.Number.Value,
ContactMethodId = m.ContactMethodId.Value,
CallType = callType,
Device = device
});
if (Debug.Level > 0)
Debug.Console(1, "Number: {0}", m.Number.Value);
tempContactMethod.Number = m.Number.Value;
tempContactMethod.ContactMethodId = m.ContactMethodId.Value;
contact.ContactMethods.Add(tempContactMethod);
}
rootContacts.Add(contact);
}
@@ -269,8 +281,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
/// <returns></returns>
public static CodecDirectory ConvertCiscoPhonebookToGeneric(PhonebookSearchResult result)
{
#warning Modify this to return a flat list of mixed folders/contacts
var directory = new Codec.CodecDirectory();
var folders = new List<Codec.DirectoryItem>();