-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(example): add handling of incoming call event #56
Conversation
examples/WebApi/Controllers/HandleIncomingIceEventController.cs
Outdated
Show resolved
Hide resolved
Added refactor for events to have generic interface which can be used for pattern matching |
[Route("event")] | ||
public IActionResult HandleEvent([FromBody] IVoiceEvent incomingEvent) | ||
{ | ||
switch (incomingEvent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally Voice should provide a ValidateAuthenticationHeader
function (like Conversation domains: https://github.com/sinch/sinch-sdk-dotnet/blob/main/src/Sinch/Conversation/Webhooks/Webhooks.cs#L72)
Calling ValidateAuthenticationHeader
here and because this sample is a tutorial, it will help to highlight endpoint is having to be "protected" against unsolicited requests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, blocked by #62
} | ||
} | ||
}; | ||
return Ok(response); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Side note: like the OK/BadRequest; need to think about having same "helper" for Java SDK to hide/help the response serialization requirements
@@ -64,5 +63,7 @@ public class AnsweredCallEvent | |||
/// </summary> | |||
[JsonPropertyName("amd")] | |||
public Amd? Amd { get; set; } | |||
|
|||
public EventType? EventType { get; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems this field is not present from specs. Could be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤯 I was sure I fixed that, I'll open PR with a fix soon
No description provided.