Repository navigation
Correct SWML connect, goto, enter_queue and pay facts (#958, #922, #956) - #967
Open
Devon-White wants to merge 1 commit into
Open
Devon-White wants to merge 1 commit into
Devon-White wants to merge 1 commit into
Conversation
- 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.
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
connectvariables (Fixesconnectdocs: inlineconfirmdoes not start with empty vars, andreturn_valueis never set #958). The shared "Variables belong to one leg" note now separates the twoconfirmforms. A URLconfirmis fetched and run on the dialed leg with an emptyvarsand that leg's owncall. An inlineconfirmhas its variable expressions filled in on the leg that issuedconnectfirst, so%{vars.x}and%{call.from}carry that leg's values, and a variable it hasn't set becomes an empty string. The note appears on theconnectreference and on Call legs.connectsets noreturn_value(Fixesconnectdocs: inlineconfirmdoes not start with empty vars, andreturn_valueis never set #958). Removed thereturn_valueline from theconnectVariables list. No other method page carries it.connect.resultwording. The four tabs saidresultpicksswitchorconddepending onreturn_value. It depends on the shape ofresultitself: an object runs as aswitchmatched againstconnect_result(connectedorfailed), and an array runs ascond.X-Target-Type(part of SWML reference:join_conferencecap,gotoper-call budget,connectschema and reserved headers,wait_timemaximum #922). The platform accepts this header name onconnectbut never sends it. Added to the header-name description in all seven tabs and in the SWML schema.connect.toschema (part of SWML reference:join_conferencecap,gotoper-call budget,connectschema and reserved headers,wait_timemaximum #922). Added a pattern totoin the SWML schema so a phone number without the leading+fails validation, as it does on the platform. The prose already said so.gotojump budget (part of SWML reference:join_conferencecap,gotoper-call budget,connectschema and reserved headers,wait_timemaximum #922). Thegoto.maxdescription now covers the per-call budget that everygotoandtransferdraws on: 32 jumps in total, and 8 in a row with no caller interaction between them. Going past either limit hangs up the call withrelay_script_too_many_transfers; it doesn't fall through. A jump skipped because ofmaxdoesn't count. The errors page entry now names both limits and says the call is hung up.enter_queue.wait_timemaximum (part of SWML reference:join_conferencecap,gotoper-call budget,connectschema and reserved headers,wait_timemaximum #922). Documented the 1 to 65535 range and addedmaxValue(65535)to the schema. Larger values aren't honored.payexample (Fixes Content redaction guide: pay example runs set before pay and uses boolean security_code / postal_code #956). The SWML action now runspaybeforeset.setexpands${pay_result}when it runs, so running it first handed the agent an empty result.security_codeandpostal_codeare now the strings"true", which thepaymethod requires. The Python tab already emitspaybeforesetand converts the booleans, so it's unchanged. The hunk is limited to the JSON block, so it shouldn't conflict with Add Take payments on a call guide #867.Part of #922: the
join_conferencemax_participantspoint 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_codeandpostal_code. In SWML, a boolean actually fails validation, which matches thepayreference ("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.topattern accepts. It mirrors the platform's check and is never stricter. It allows:+number of 4 to 18 digitssip:orsips:in any case/)queue:,call:, orstream:wss://(the scheme in any case)911,933,988, and+988, which the platform dials as written${...}or%{...}expression, since the platform skips the check for thoseI checked it with ajv against the generated schema across single,
serial,parallel, andserial_parallel: 20 valid values and 12 invalid ones, each giving the expected result. Doc examples that use placeholder destinations such as<YOUR_DESTINATION>or+1XXXXXXXXXXnow 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/988to thetoprose. Documenting emergency dialing fromconnectseemed like a call for whoever owns E911 docs.The Relay spec has the same header gap. The Relay
SipHeaderdescription lists the same rejected names and also omitsX-Target-Type. Relaydialandconnectdrop it too. I left the Relay spec out of this SWML PR.connect_failed_reasonon success. The platform sets it toconnectedwhen a call connects, and the Variables list describes it only as "Detailed reason for failure". I didn't change it here.The
transferreference doesn't mention the budget. It's covered on thegotoand errors pages.Verification
yarn build:specssucceeds. The regenerated output covers only these changes: the SWML JSON schema,signalwire-rest/openapi.yamlandrelay-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.topattern,wait_timebounds (1, 65535, 65536, 0, a variable) and the reorderedpaydocument were checked with ajv.#variablesonconnect,#propertiesonswitchandcond. Each matches the target page's heading.Preview