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