Repository navigation
feat(sip-trunk): show the environment's SIP address - #20
Conversation
Add `sip-trunk endpoint`, which prints the SIP host, each transport with its port and SRTP requirement, the RTP UDP range and allow-list guidance, and reports sip_not_hosted without printing an address. `create` and `rotate-credentials` print the address after new inbound credentials in human output; a failed lookup never hides the password. The pinned SDK lacks sipTrunks.endpoint, so the command reads GET /platform/sip/endpoint through the SDK raw client and validates the response. Switch to the SDK method once it is released and pinned.
|
Warning Review limit reached
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 58 minutes. View limit detailsLimit details: You’ve used the included review currently available. Your 78 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. The included review limit has been reached and this organization has disabled usage-based review continuation. Wait for reviews to reset or ask a billing admin to change After included review limits. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (8)
Comment |
|
|
Monorepo contract PR: polymorfa/polymorfa#229. SDK: polymorfa/sdks#277. |
|
@coderabbitai review |
|
…tial address The API contract is now a discriminated union: a hosted address always has a host, at least one transport and an RTP range. The CLI type mirrors it and the decoder refuses a hosted response that lacks either.
|
Follow-up after review of polymorfa/polymorfa#229: the API response is now a discriminated union on |
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d2ea77f530
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const endpoint = | ||
| result.data.inboundCredentials !== undefined && | ||
| this.outputMode(flags) === 'human' | ||
| ? await trySipEndpoint(client) | ||
| : undefined |
There was a problem hiding this comment.
Print one-time credentials before the endpoint lookup
When trunk creation succeeds but the subsequent optional endpoint request hangs or the process is interrupted, the server-side mutation has already completed while writeValue has not run, so the only copy of the inbound password is lost; credential rotation has the same ordering problem and can additionally leave the PBX without its new password after the old one expires. Emit the one-time credentials before awaiting this auxiliary lookup, then append the endpoint information if it becomes available.
Useful? React with 👍 / 👎.
…address create and rotate-credentials awaited the optional address lookup before writing anything, so a hung lookup or an interrupt lost the only copy of the password. They now print the credentials first and append the address when the lookup returns. A child-process test holds the lookup open and checks the password is already on stdout.
|
Codex P1 ( New test: a child process runs each command against a server that answers the trunk request and never answers Checks: format, lint, typecheck, build, 493 tests, |
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…olymorfa/sdk 0.1.0-dev.20260922115749
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review Current head: e52545f. Optional SIP address lookup now stops after five seconds without retries. Both create and rotate print the one-time credential before that lookup; real HTTP child-process regressions prove they exit successfully when it hangs. Full local verify and production dependency audit passed. The exact SDK 0.1.0-dev.20260922115749 artifact is verified against SDK #277 and its successful publication run; dev is an ancestor. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e52545f8bd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| await getSipEndpoint(client, { | ||
| maxNetworkRetries: 0, | ||
| signal: AbortSignal.timeout(SIP_ENDPOINT_APPENDIX_TIMEOUT_MS), | ||
| timeoutMs: SIP_ENDPOINT_APPENDIX_TIMEOUT_MS, |
There was a problem hiding this comment.
Preserve shorter user-specified request timeouts
When create or rotate-credentials is invoked with --timeout below 5000 and the credential mutation completes but the endpoint lookup hangs, this per-request timeoutMs overrides the timeout configured on the client, so the command can wait the full five seconds despite the global flag promising to fail requests after the specified duration. Keep the client's existing timeout and use the abort signal only as a five-second upper bound, or pass the smaller of the configured timeout and this cap.
Useful? React with 👍 / 👎.
|
@codex review Current head: 649c039. The optional SIP address lookup now respects a shorter global |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Merge gate exception approved by the owner for this PR: merge with green current-head CI and clean current-head Codex review, recording that CodeRabbit did not complete because its included bot review is rate-limited and the CLI review connection fails. No credits or billing changes were used. Final head: 649c039; target dev is included; CI run 35731852870 passed and Codex reviewed this exact head with no findings. |
Summary
polymorfa sip-trunk endpoint, which readsGET /platform/sip/endpointand prints the SIP host, each transport with its port and whether SRTP is required, the RTP UDP port range, and one line of allow-list guidance. When the API returnsstatus: "sip_not_hosted", it printsThis environment has no SIP address.and exits 0 without printing an address.--jsonemits the standard{data, metadata}document, withdataset to the rawSipEndpointobject. API errors use the existing mapping (for example, 403 exits with code 3).sip-trunk create(when it returns inbound credentials) andsip-trunk rotate-credentialsprint aSIP addressblock after the one-time password in human output only. The optional lookup is a second request with a five-second upper bound, no retries, and any shorter global--timeoutpreserved. If it fails, the command keeps the password visible and exits 0. JSON and quiet modes make no extra request.sip_not_hostedresponse that carries a host, or ahostedresponse with no host or with invalid ports, fails asinvalid_response, so the CLI never prints an invented address.docs/command-research/calls.md. Theskills/docs do not mention sip-trunk commands.Example (hosted):
Example (
sip_not_hosted):Dependency on the SDK
The command calls
client.sipTrunks.endpoint()from@polymorfa/sdk0.1.0-dev.20260922115749(published from polymorfa/sdks#277's merge, 8bc00778b). The CLI still checks the response shape locally (getSipEndpointinsrc/services/sip-trunks.ts) so a malformed answer fails instead of printing a partial address. The API contract isgetSipEndpointon monorepodev(merge of polymorfa/polymorfa#229, cdc7ec09a), scopesessions:read.Verification
Current-head CI passes on
649c0392b091bf7e8448904c4770b1b6d5a10904, including the complete verification workflow. The 13 local SIP command tests include real child processes with an HTTP endpoint that never responds: credentials print first, the default appendix stops after five seconds, and a 500 ms global timeout is respected. The shorter-timeout regressions failed before the fix and pass after it.Typecheck, lint and formatting pass. The tests use a local HTTP server; no deployed API or real PBX call was exercised.
Six-part assessment
GET /platform/sip/endpoint,sessions:read).sipTrunks.endpoint(); this CLI pins@polymorfa/sdk@0.1.0-dev.20260922115749and uses it.sip_not_hosted.Need help on this PR? Tag
@codesmithwith what you need. Autofix is disabled.