Skip to content

Document async SWML stream/stop_stream methods and the calling.call.stream webhook#361

Open
Devon-White wants to merge 2 commits into
mainfrom
Devon/swml-stream-methods
Open

Document async SWML stream/stop_stream methods and the calling.call.stream webhook#361
Devon-White wants to merge 2 commits into
mainfrom
Devon/swml-stream-methods

Conversation

@Devon-White
Copy link
Copy Markdown
Collaborator

Summary

Documents the new async stream / stop_stream SWML calling methods, which stream a call's audio to a WebSocket endpoint as a background operation (distinct from the bidirectional stream: device type in connect). Also formalizes the shared calling.call.stream status-callback as an OpenAPI webhook.

SWML

  • New stream and stop_stream methods — TypeSpec models (specs/swml/calling/Methods/{stream,stop_stream}) and customer-facing reference pages with parameters, variables, and YAML/JSON examples.
  • Registered both in the SWMLMethod union and the connect confirm allow-list (ValidConfirmMethods).
  • Overview cards added under Recording & taps.

Calling API / webhook

  • Modeled the calling.call.stream status callback as an OpenAPI webhook (StreamStatusCallbackPayload) on the Calls namespace, registered under Calling → Webhooks. The SWML page references it via <WebhookPayloadSnippet> so the payload lives in one place (mirrors the transcribe pattern).
  • The calling.stream / calling.stream.stop REST command request payloads already existed on main; no change needed there.

SDK

  • Documented the streaming state on the calling.call.stream event (Python + TypeScript) — previously only finished was listed.

Ground-truth validation

Method schemas and the event payload were validated against the FreeSWITCH mod_infrastructure C source, not just the spec summary:

  • stream's codec is freeform (no enum/default) — unlike tap's enum-constrained codec.
  • Webhook payload: event_channel (envelope) and params.segment_id are always present (segment_id is backfilled to the session UUID); url is required (a stream always has a destination); only name and tag are genuinely optional.

Verification

  • tsp compile (calling-api + swml/calling) clean; OpenAPI regenerated.
  • tsp format --check passes on new/edited specs.
  • fern docs md check → all MDX files valid.

…tream webhook

SWML:
- Add `stream` and `stop_stream` calling methods (TypeSpec models + reference
  pages with parameters, variables, and YAML/JSON examples)
- Register both in the SWMLMethod union and the connect confirm allow-list
- Add overview cards under Recording & taps

Calling API / webhook:
- Model the calling.call.stream status callback as an OpenAPI webhook
  (StreamStatusCallbackPayload) on the Calls namespace, registered under
  Calling > Webhooks; SWML page references it via WebhookPayloadSnippet
- Payload shape validated against the mod_infrastructure C source
  (event_channel + params.segment_id always present; url required; name/tag optional)

SDK:
- Document the `streaming` state on the calling.call.stream event (Python + TS)
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

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.

2 participants