cfg_generate_m4
Generate m4 configuration templates for OpenSIPS scenarios. Provides pair of main and local files preprocessed with m4, using scenario name, structural knobs, and site-specific m4 defines.
Instructions
Render the m4 template pair (main + local) for a scenario.
The returned strings are intended to be persisted to opensips.cfg.m4
and local.cfg.m4 respectively, then preprocessed with m4.
Parameters
scenario:
Scenario name (load_balancer, class4_sbc, registrar_class5,
webrtc_gateway, base).
template_params:
Structural/Jinja2 template knobs (e.g. include_usrloc for base).
site_params:
Dict of m4 defines that will appear in local.cfg.m4 (e.g.
{"LISTEN": "udp:10.0.0.5:5060", "DB_URL": "mysql://..."}).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scenario | Yes | ||
| template_params | No | ||
| site_params | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||