mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-13 03:35:00 +00:00
fix(essentials): Adds logic to recover from malformed json response on initial communication.
Adds better formatting for active calls list print to console
This commit is contained in:
@@ -1182,6 +1182,16 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
if (ex is Newtonsoft.Json.JsonReaderException)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Received malformed response from codec. Unable to serialize. Disconnecting and attmpting to recconnect");
|
||||||
|
|
||||||
|
Communication.Disconnect();
|
||||||
|
|
||||||
|
Initialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Debug.Console(1, this, "Error Deserializing feedback from codec: {0}", ex);
|
Debug.Console(1, this, "Error Deserializing feedback from codec: {0}", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -257,10 +257,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual void ListCalls()
|
public virtual void ListCalls()
|
||||||
{
|
{
|
||||||
|
Debug.Console(1, this, "Active Calls:");
|
||||||
|
|
||||||
var sb = new StringBuilder();
|
var sb = new StringBuilder();
|
||||||
foreach (var c in ActiveCalls)
|
foreach (var c in ActiveCalls)
|
||||||
{
|
{
|
||||||
sb.AppendFormat("{0} {1} -- {2} {3}\n", c.Id, c.Number, c.Name, c.Status);
|
sb.AppendFormat("id: {0} number: {1} -- name: {2} status: {3} onHold: {4}\r\n", c.Id, c.Number, c.Name, c.Status, c.IsOnHold);
|
||||||
}
|
}
|
||||||
Debug.Console(1, this, "\n{0}\n", sb.ToString());
|
Debug.Console(1, this, "\n{0}\n", sb.ToString());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user