cfg_generate
Generate an OpenSIPS configuration from a predefined scenario template, with automatic validation and linting to ensure correctness.
Instructions
Generate an OpenSIPS configuration from a predefined scenario template.
Renders the scenario template, then — by default — runs opensips -C -f
when the binary is on PATH and runs the static linter unconditionally.
The Summit deck claim "Every output runs through opensips -C -f" lives
here: this is the headline tool, and it owns the validate-on-render
contract. If the binary is unavailable, the result includes
validation: {"skipped": true, "reason": "opensips binary not found"}
so the caller can decide whether to proceed.
Parameters
scenario:
Name of the scenario (e.g. load_balancer, class4_sbc,
registrar_class5, webrtc_gateway, residential_pbx,
call_center, b2bua, sbc_with_rtpengine).
params:
Template parameters such as db_url, listen_ip, domain, etc.
validate:
When True (default), run opensips -C -f against the rendered
cfg. Skipped (with a reason) if the binary is not on PATH.
lint:
When True (default), run cfg_lint against the rendered cfg
and surface findings + suggestions. Pure Python, always available.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scenario | Yes | ||
| params | No | ||
| validate | No | ||
| lint | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||