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

Add get API for SIP Dispatch Rules. #913

Merged
merged 1 commit into from
Dec 9, 2024
Merged

Add get API for SIP Dispatch Rules. #913

merged 1 commit into from
Dec 9, 2024

Conversation

dennwc
Copy link
Contributor

@dennwc dennwc commented Dec 5, 2024

No description provided.

@dennwc dennwc requested a review from a team December 5, 2024 15:28
@dennwc dennwc self-assigned this Dec 5, 2024
Copy link

changeset-bot bot commented Dec 5, 2024

🦋 Changeset detected

Latest commit: 846407f

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

💥 An error occurred when fetching the changed packages and changesets in this PR
Some errors occurred when validating the changesets config:
The package or glob expression "github.com/livekit/protocol" specified in the `fixed` option does not match any package in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.

@@ -63,6 +63,7 @@ service SIP {
rpc DeleteSIPTrunk(DeleteSIPTrunkRequest) returns (SIPTrunkInfo);

rpc CreateSIPDispatchRule(CreateSIPDispatchRuleRequest) returns (SIPDispatchRuleInfo);
rpc GetSIPDispatchRule(GetSIPDispatchRuleRequest) returns (GetSIPDispatchRuleResponse);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that for other services, we've overloaded the List API and added an optional "stuff_to_list_id" parameter to that request.

Copy link
Member

Choose a reason for hiding this comment

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

no preference here from me.. I think over time the list/get APIs might diverge (with pagination/etc)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In general I prefer to have a separate get API, because it allows the service to send "not found" error directly, instead of requiring client checking the list and throwing that error.

But I see the point here. Reusing list API also allows seamless batching support, which is nice. Definitely worth it.

I rewrote the PR to add a few filters to list requests. The storage implementation won't need to support them all, because it will apply Filter after getting an initial list. Same for CLI / Go SDK - it will filter results after receiving them, so as soon as we update protocol in the client, it will immediately use new filter logic, even if the server doesn't support it yet.

Copy link
Contributor

@biglittlebigben biglittlebigben left a comment

Choose a reason for hiding this comment

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

LGTM except for the need to add some documentation for the fields.

protobufs/livekit_sip.proto Show resolved Hide resolved
@dennwc dennwc merged commit f6b5078 into main Dec 9, 2024
3 checks passed
@dennwc dennwc deleted the sip-get branch December 9, 2024 18:37
@github-actions github-actions bot mentioned this pull request Dec 9, 2024
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