-
Notifications
You must be signed in to change notification settings - Fork 130
Support new SIP Trunk API. Move to subcommands. #340
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
Conversation
|
This should wait for prod deployment. It hides old CLI commands, while new ones won't work without updated server. |
|
@rektdeckard what do you think about the subcommand organization? this is something we'd also want to make consistent across the board. |
|
Regarding sub-commands, it would be also nice to move shared options like URL/key/secret to the root command: livekit-cli --api-key <key> --api-secret <secret> some sub commandinstead of livekit-cli some sub command --api-key <key> --api-secret <secret> |
|
@davidzhao @dennwc looks like what what we had in mind, and consistent with prior art in the livekit-cli room join "my-first-room"instead of livekit-cli join-room --room "my-first-room"Since the room is the main and only logical receiver of the command. I don't know if the |
|
Good idea! Will make main arg positional then for new SIP commands 👍 Regarding flags, that should probably be in a separate PR, because existing commands will need to be updated too. |
|
@rektdeckard Updated new SIP commands to accept main args ( Moving flags to the top will require an update to |
|
Nice! Agree, separate PR for that. |
| return createAndPrintLegacy(c, func(ctx context.Context, req *livekit.CreateSIPParticipantRequest) (*livekit.SIPParticipantInfo, error) { | ||
| // CreateSIPParticipant will wait for LiveKit Participant to be created and that can take some time. | ||
| // Default deadline is too short, thus, we must set a higher deadline for it. | ||
| ctx, cancel := context.WithTimeout(ctx, 30*time.Second) |
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.
Probably outside my wheelhouse, but when docs are updated it may be good to include constants like this if it is invariant, or expose it as a parameter if not.
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.
You are right. I can actually bake it into the SDK, so not configuration will be needed.
Support new SIP Inbound/Outbound Trunk API and move all SIP commands into a separate cli tree:
list-sip-trunk->sip trunk listlist-sip-dispatch-rule->sip dispatch listcreate-sip-participant->sip participant createOld commands continue to work, they are only hidden from the CLI help.
I also renamed the columns for legacy trunks list command. Now they match names in new API (
OutboundNumber->Number,InboundNumbers->AllowedNumbers).Requires livekit/protocol#738