Skip to content

Correct SWML connect, goto, enter_queue and pay facts (#958, #922, #956) - #967

Open
Devon-White wants to merge 1 commit into
mainfrom
devon/swml-reference-fixes
Open

Devon-White wants to merge 1 commit into
mainfrom
devon/swml-reference-fixes

Conversation

@Devon-White

Copy link
Copy Markdown
Collaborator

Summary

Part of #922: the join_conference max_participants point stays open, since Product has decided on 250.

Notes for reviewers

  • The issue was wrong about booleans in Content redaction guide: pay example runs set before pay and uses boolean security_code / postal_code #956. It said the platform ignores a JSON boolean for security_code and postal_code. In SWML, a boolean actually fails validation, which matches the pay reference ("an unquoted YAML or JSON boolean is rejected"). The fix is the same either way.

  • The jump budget numbers are the platform defaults. The 32 and 8 limits are the engine's built-in values, and a deployment can override them. I documented the defaults, which match the 32 already on the errors page. Please confirm production doesn't override them.

  • What the connect.to pattern accepts. It mirrors the platform's check and is never stricter. It allows:

    • a + number of 4 to 18 digits
    • sip: or sips: in any case
    • a Resource Address (leading /)
    • queue:, call:, or stream:wss:// (the scheme in any case)
    • the short codes 911, 933, 988, and +988, which the platform dials as written
    • any value containing a ${...} or %{...} expression, since the platform skips the check for those

    I checked it with ajv against the generated schema across single, serial, parallel, and serial_parallel: 20 valid values and 12 invalid ones, each giving the expected result. Doc examples that use placeholder destinations such as <YOUR_DESTINATION> or +1XXXXXXXXXX now fail schema validation, as they would on the platform. No example with a real value fails.

  • Short codes aren't in the prose. I didn't add 911/933/988 to the to prose. Documenting emergency dialing from connect seemed like a call for whoever owns E911 docs.

  • The Relay spec has the same header gap. The Relay SipHeader description lists the same rejected names and also omits X-Target-Type. Relay dial and connect drop it too. I left the Relay spec out of this SWML PR.

  • connect_failed_reason on success. The platform sets it to connected when a call connects, and the Variables list describes it only as "Detailed reason for failure". I didn't change it here.

  • The transfer reference doesn't mention the budget. It's covered on the goto and errors pages.

Verification

  • yarn build:specs succeeds. The regenerated output covers only these changes: the SWML JSON schema, signalwire-rest/openapi.yaml and relay-server.yaml, which both import the SWML models.
  • yarn fern-md-check: all 2895 MDX files valid.
  • yarn fern-check: the only error is the missing-redirects check, which needs network access (FDR returned 403). No nav or redirect files changed.
  • Every JSON and YAML block on the changed pages parses, and all 47 SWML documents on the touched pages validate against the regenerated schema. That includes the fixed content-redaction action. The old boolean form fails, as expected.
  • The to pattern, wait_time bounds (1, 65535, 65536, 0, a variable) and the reordered pay document were checked with ajv.
  • Anchors touched: #variables on connect, #properties on switch and cond. Each matches the target page's heading.

Preview

  • /docs/swml/reference/calling/connect
  • /docs/swml/reference/calling/goto
  • /docs/swml/reference/calling/enter-queue
  • /docs/swml/reference/errors
  • /docs/platform/voice/call-legs
  • /docs/platform/ai/content-redaction

- connect: an inline confirm has its variables expanded on the issuing leg;
  a URL confirm runs with empty vars. connect sets no return_value, and an
  object result is a switch on connect_result. X-Target-Type is dropped.
- connect schema: to rejects a phone number without the leading +.
- goto and errors: document the per-call jump budget (32 total, 8 in a row).
- enter_queue: wait_time maximum is 65535.
- content redaction guide: run pay before set, and pass security_code and
  postal_code as strings.
@github-actions

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant