SWMLService is a lightweight HTTP service for serving non-AI SWML documents.
Unlike AgentBase (which always produces an AI block), SWMLService
generates pure SWML call-flow documents: IVR menus, voicemail, call recording, etc.
It uses a SwmlBuilder internally for verb construction and
Hono for HTTP serving.
SWMLService generates and serves SWML documents over HTTP. See the SWML reference for the full document specification.
Configuration object.
Service display name used in logging and startup messages. Required to
match the Python SDK, where name is a positional required parameter.
HTTP route path where the service is accessible.
Host the HTTP server binds to.
Port the HTTP server binds to. Defaults to the PORT environment variable,
falling back to 3000.
Basic auth credentials as [username, password]. Unlike AgentBase,
SWMLService does not fall back to environment variables — credentials
must be provided explicitly.
Path to a JSON Schema file for verb validation.
Path to a security configuration file for SSL, CORS, and host allowlist settings.
Enable schema validation. Can also be disabled via the
SWML_SKIP_SCHEMA_VALIDATION=true environment variable.
Service display name.
HTTP route path where this service is accessible.
Host address the HTTP server binds to.
Port the HTTP server binds to.
Structured logger bound to this service name. Exposed for subclass access.
Unified security configuration loaded from environment variables and optional config file. Controls SSL, CORS, and host allowlist settings.
Whether SSL/HTTPS is enabled. Mirrors security.sslEnabled.
Path to the SSL certificate file.
Path to the SSL private key file.
Domain name for SSL certificates.
Schema validation utilities for SWML documents.
Registry of custom verb handlers for specialized SWML verb processing.
Add a SWML verb to the document.
Add a new named section to the document.
Add a verb to a specific named section.
Reset the document to an empty state.
Render the SWML document as an object.
Get the SWML document as an object (Python-compat alias).
Render the SWML document as a JSON string.
Set a per-request callback for dynamic SWML generation.
Subclass override hook for per-request SWML.
Register a custom verb handler.
Register a routing callback at a given path.
Extract the username from a SIP URI (static).
Retrieve HTTP Basic Auth credentials.
Manually set the proxy URL for webhook generation.
Get the Hono app for mounting or testing.
Get the Hono app (Python-compat alias for getApp).
Get the underlying SwmlBuilder instance.
Start the HTTP server.
Start the HTTP server (Python-compat alias for run).
Stop the HTTP server.