Merge pull request #278 from PepperDash/feature/Update-CiscoSpark-ce9.13

Update CiscoSpark to work with ce9.13
This commit is contained in:
Andrew Welker 2020-06-24 10:03:05 -06:00 committed by GitHub
commit e8a8d481aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -601,9 +601,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
//JsonSerializerSettings settings = new JsonSerializerSettings(); //JsonSerializerSettings settings = new JsonSerializerSettings();
//settings.NullValueHandling = NullValueHandling.Ignore; //settings.NullValueHandling = NullValueHandling.Ignore;
//settings.MissingMemberHandling = MissingMemberHandling.Ignore; //settings.MissingMemberHandling = MissingMemberHandling.Ignore;
//settings.ObjectCreationHandling = ObjectCreationHandling.Auto; //settings.ObjectCreationHandling = ObjectCreationHandling.Auto;
if (response.IndexOf("\"Status\":{") > -1) if (response.IndexOf("\"Status\":{") > -1 || response.IndexOf("\"Status\": {") > -1)
{ {
// Status Message // Status Message
@ -775,8 +775,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
if (!SyncState.InitialConfigurationMessageWasReceived) if (!SyncState.InitialConfigurationMessageWasReceived)
SendText("xConfiguration"); SendText("xConfiguration");
} }
} }
else if (response.IndexOf("\"Configuration\":{") > -1) else if (response.IndexOf("\"Configuration\":{") > -1 || response.IndexOf("\"Configuration\": {") > -1)
{ {
// Configuration Message // Configuration Message
@ -791,39 +791,39 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
} }
} }
} }
else if (response.IndexOf("\"Event\":{") > -1) else if (response.IndexOf("\"Event\":{") > -1 || response.IndexOf("\"Event\": {") > -1)
{ {
if (response.IndexOf("\"CallDisconnect\":{") > -1) if (response.IndexOf("\"CallDisconnect\":{") > -1 || response.IndexOf("\"CallDisconnect\": {") > -1)
{ {
CiscoCodecEvents.RootObject eventReceived = new CiscoCodecEvents.RootObject(); CiscoCodecEvents.RootObject eventReceived = new CiscoCodecEvents.RootObject();
JsonConvert.PopulateObject(response, eventReceived); JsonConvert.PopulateObject(response, eventReceived);
EvalutateDisconnectEvent(eventReceived); EvalutateDisconnectEvent(eventReceived);
} }
else if (response.IndexOf("\"Bookings\":{") > -1) // The list has changed, reload it else if (response.IndexOf("\"Bookings\":{") > -1 || response.IndexOf("\"Bookings\": {") > -1) // The list has changed, reload it
{ {
GetBookings(null); GetBookings(null);
} }
} }
else if (response.IndexOf("\"CommandResponse\":{") > -1) else if (response.IndexOf("\"CommandResponse\":{") > -1 || response.IndexOf("\"CommandResponse\": {") > -1)
{ {
// CommandResponse Message // CommandResponse Message
if (response.IndexOf("\"CallHistoryRecentsResult\":{") > -1) if (response.IndexOf("\"CallHistoryRecentsResult\":{") > -1 || response.IndexOf("\"CallHistoryRecentsResult\": {") > -1)
{ {
var codecCallHistory = new CiscoCallHistory.RootObject(); var codecCallHistory = new CiscoCallHistory.RootObject();
JsonConvert.PopulateObject(response, codecCallHistory); JsonConvert.PopulateObject(response, codecCallHistory);
CallHistory.ConvertCiscoCallHistoryToGeneric(codecCallHistory.CommandResponse.CallHistoryRecentsResult.Entry); CallHistory.ConvertCiscoCallHistoryToGeneric(codecCallHistory.CommandResponse.CallHistoryRecentsResult.Entry);
} }
else if (response.IndexOf("\"CallHistoryDeleteEntryResult\":{") > -1) else if (response.IndexOf("\"CallHistoryDeleteEntryResult\":{") > -1 || response.IndexOf("\"CallHistoryDeleteEntryResult\": {") > -1)
{ {
GetCallHistory(); GetCallHistory();
} }
else if (response.IndexOf("\"PhonebookSearchResult\":{") > -1) else if (response.IndexOf("\"PhonebookSearchResult\":{") > -1 || response.IndexOf("\"PhonebookSearchResult\": {") > -1)
{ {
var codecPhonebookResponse = new CiscoCodecPhonebook.RootObject(); var codecPhonebookResponse = new CiscoCodecPhonebook.RootObject();