diff --git a/Vonage.Test/Data/Webhooks/ShouldDeserializedAnswered_GivenStartTimeIsNull.json b/Vonage.Test/Data/Webhooks/ShouldDeserializedAnswered_GivenStartTimeIsNull.json
new file mode 100644
index 000000000..23e4af22d
--- /dev/null
+++ b/Vonage.Test/Data/Webhooks/ShouldDeserializedAnswered_GivenStartTimeIsNull.json
@@ -0,0 +1,15 @@
+{
+ "start_time": null,
+ "headers": {
+ "[redacted]": "[redacted]"
+ },
+ "rate": null,
+ "from": "[redacted]",
+ "to": "[redacted]",
+ "uuid": "c8061992c89a65e3790bfa0aaca6f069",
+ "conversation_uuid": "CON-5a0cdebb-0f35-45a4-9b38-a99f9d12d6d7",
+ "status": "answered",
+ "direction": "inbound",
+ "network": null,
+ "timestamp": "2024-01-25T12:16:32.319Z"
+}
\ No newline at end of file
diff --git a/Vonage.Test/Vonage.Test.csproj b/Vonage.Test/Vonage.Test.csproj
index 05bedaf11..1fceb3394 100644
--- a/Vonage.Test/Vonage.Test.csproj
+++ b/Vonage.Test/Vonage.Test.csproj
@@ -1104,6 +1104,9 @@
PreserveNewest
+
+ PreserveNewest
+
diff --git a/Vonage.Test/WebhookStructsTest.cs b/Vonage.Test/WebhookStructsTest.cs
index 03c779874..1f1184033 100644
--- a/Vonage.Test/WebhookStructsTest.cs
+++ b/Vonage.Test/WebhookStructsTest.cs
@@ -1,5 +1,7 @@
using System;
using System.Globalization;
+using System.IO;
+using FluentAssertions;
using Newtonsoft.Json;
using Vonage.Voice.AnswerWebhooks;
using Vonage.Voice.EventWebhooks;
@@ -384,6 +386,15 @@ public void TestTransfer()
Assert.Equal("aaaaaaaa-bbbb-cccc-dddd-0123456789ab", transferWebhook.Uuid);
}
+ [Fact]
+ public void ShouldDeserializedAnswered_GivenStartTimeIsNull()
+ {
+ var deserializedEvent =
+ (Answered) EventBase.ParseEvent(
+ File.ReadAllText("Data/Webhooks/ShouldDeserializedAnswered_GivenStartTimeIsNull.json"));
+ deserializedEvent.StartTime.Should().BeNull();
+ }
+
public class Foo
{
public string bar { get; set; }
diff --git a/Vonage/Voice/EventWebhooks/Answered.cs b/Vonage/Voice/EventWebhooks/Answered.cs
index c9c9ff7c7..6e515c8cb 100644
--- a/Vonage/Voice/EventWebhooks/Answered.cs
+++ b/Vonage/Voice/EventWebhooks/Answered.cs
@@ -1,5 +1,5 @@
-using Newtonsoft.Json;
-using System;
+using System;
+using Newtonsoft.Json;
namespace Vonage.Voice.EventWebhooks;
@@ -9,14 +9,14 @@ public class Answered : CallStatusEvent
/// call start time
///
[JsonProperty("start_time")]
- public DateTime StartTime { get; set; }
+ public DateTime? StartTime { get; set; }
///
/// cost rate for the call
///
[JsonProperty("rate")]
public string Rate { get; set; }
-
+
///
/// Network the call came from
///