mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-12 03:57:27 +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:
parent
7a2e99f145
commit
bfdc882eb6
2 changed files with 13 additions and 1 deletions
|
|
@ -1182,6 +1182,16 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -257,10 +257,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||
/// </summary>
|
||||
public virtual void ListCalls()
|
||||
{
|
||||
Debug.Console(1, this, "Active Calls:");
|
||||
|
||||
var sb = new StringBuilder();
|
||||
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());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue