Skip to content
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

Merged
merged 4 commits into from
Apr 24, 2024

Conversation

Dovchik
Copy link
Contributor

@Dovchik Dovchik commented Apr 22, 2024

No description provided.

@Dovchik
Copy link
Contributor Author

Dovchik commented Apr 23, 2024

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)

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

Copy link
Contributor Author

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);

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; }
Copy link

@JPPortier JPPortier Apr 24, 2024

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?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ This PR was merged, but this field is still defined

Copy link
Contributor Author

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

@Dovchik Dovchik merged commit 967523d into main Apr 24, 2024
3 checks passed
@Dovchik Dovchik deleted the chore/incoming-ice-event-handle-example branch April 24, 2024 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants