cfg_save_session
Persist OpenSIPS configuration sessions by writing main and local M4 files to a specified directory, with the option to preprocess and generate the final cfg file. Ensures safe output by rejecting system directories.
Instructions
Persist the m4 pair to disk, optionally also writing the preprocessed cfg.
Writes {out_dir}/opensips.cfg.m4 and {out_dir}/local.cfg.m4. When
write_preprocessed is True, also runs m4 and writes
{out_dir}/opensips.cfg.
The output directory is validated — writes to system directories such as
/, /etc, /usr, /bin are rejected.
Parameters
out_dir:
Directory that will receive the files. Created if missing.
main_m4:
Contents for opensips.cfg.m4.
local_m4:
Contents for local.cfg.m4.
write_preprocessed:
If True, also run m4 and write opensips.cfg.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| out_dir | Yes | ||
| main_m4 | Yes | ||
| local_m4 | Yes | ||
| write_preprocessed | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||