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 flag to make CreateSIPParticipant synchronous. #952

Merged
merged 1 commit into from
Jan 27, 2025
Merged

Conversation

dennwc
Copy link
Contributor

@dennwc dennwc commented Jan 24, 2025

No description provided.

@dennwc dennwc requested a review from a team January 24, 2025 15:06
@dennwc dennwc self-assigned this Jan 24, 2025
Copy link

changeset-bot bot commented Jan 24, 2025

🦋 Changeset detected

Latest commit: 46e971e

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.

}

message InternalCreateSIPParticipantResponse {
string participant_id = 1;
string participant_identity = 2;
string sip_call_id = 3;

uint32 sip_failure_code = 4;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that internal API will succeed even if the call fails and will return these codes explicitly. The client side will return RPC error instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

What is the context for that new convention?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's mostly to make SDKs work out of the box. Users would expect an errors in case the call fails, but for internal services we'd rather know that communication between services was successful, even though the call was not.

Copy link
Member

@davidzhao davidzhao left a comment

Choose a reason for hiding this comment

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

lgtm

@@ -101,13 +101,19 @@ message InternalCreateSIPParticipantRequest {

livekit.SIPMediaEncryption media_encryption = 28;

// NEXT ID: 29
// Wait for the call to dial before returning.
bool wait_until_dialed = 29;
Copy link
Member

Choose a reason for hiding this comment

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

on second thought. I think the name of this parameter could be confusing.. it reads as if the function will return as soon as we've dialed it..

I think the intention is to say, wait until the creation is complete? (i.e. either success or failure).. so should we call this wait_until_complete instead?

or block?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The current behavior is "wait until LK participant is created" and with the flag set it will be "wait until call is dialed".

So I was thinking that wait_until_dialed reflects it quite well, but could rename to wait_until_complete as well.

block on the other hand is misleading - we already blocks until participant is created. I think we need to specify exactly what is the event we'll wait for.

Would wait_until_call_pickup be better maybe?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to wait_until_answered

@dennwc dennwc merged commit e430b4b into main Jan 27, 2025
3 checks passed
@dennwc dennwc deleted the sip-out-sync branch January 27, 2025 22:40
@github-actions github-actions bot mentioned this pull request Jan 27, 2025
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