Skip to content

Commit

Permalink
Fixed a bug with message failure reporting in the Messaging API that …
Browse files Browse the repository at this point in the history
…prevented the recording of To and From values.
  • Loading branch information
uncheckederror committed Aug 19, 2023
1 parent b1ac0fe commit 90fde15
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Messaging/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1230,6 +1230,8 @@
if (client is not null && client.AsDialed == toRegisteredNumber.DialedNumber)
{
toForward.ClientSecret = client.ClientSecret;
messageRecord.To = toForward.To;
messageRecord.From = toForward.From;
messageRecord.ToForward = System.Text.Json.JsonSerializer.Serialize(toForward);
try
Expand Down Expand Up @@ -1426,7 +1428,8 @@
if (client is not null && client.AsDialed == toRegisteredNumber.DialedNumber)
{
toForward.ClientSecret = client.ClientSecret;
messageRecord.Content = toForward.Content;
messageRecord.To = toForward.To;
messageRecord.From = toForward.From;
messageRecord.ToForward = System.Text.Json.JsonSerializer.Serialize(toForward);
try
Expand All @@ -1445,7 +1448,7 @@
Log.Error(System.Text.Json.JsonSerializer.Serialize(client));
Log.Error(System.Text.Json.JsonSerializer.Serialize(toForward));
Log.Error($"Failed to forward message to {toForward.To}");
messageRecord.RawResponse = $"Failed to forward message to {toForward.To} at {client.CallbackUrl} {error}";
messageRecord.RawResponse = $"Failed to forward message to {toForward.To} at {client.CallbackUrl} {ex.StatusCode} {error}";
}
try
Expand Down

0 comments on commit 90fde15

Please sign in to comment.