Generating Config Files
OpenSIPS provides ready-to-use GNU M4 configuration templates under
examples/templates/:
residential.m4trunking.m4loadbalancer.m4
They are installed as shared examples under
$PREFIX/share/opensips/examples/templates/. Distribution packages typically
use /usr/share/opensips/examples/templates/.
Each template starts with definitions for its listening interface, database
URL, optional endpoints, and feature switches. Edit these definitions before
using the template. Feature switches accept yes or no.
Run a template directly
Section titled “Run a template directly”Use -f to select the template and -p m4 to preprocess it before OpenSIPS
parses it:
opensips -C -f examples/templates/residential.m4 -p m4opensips -f examples/templates/residential.m4 -p m4The first command checks the generated configuration. The second starts
OpenSIPS. GNU M4 must be installed and available in PATH.
For an installed distribution package, use the template from the shared examples directory:
opensips -f /usr/share/opensips/examples/templates/residential.m4 -p m4Create a standalone configuration
Section titled “Create a standalone configuration”You can render a template into a regular configuration file:
m4 examples/templates/residential.m4 > opensips.cfgThe resulting file no longer requires preprocessing. Edit it as needed, then check or start it normally:
opensips -C -f opensips.cfgopensips -f opensips.cfgSee examples/templates/README.md for additional examples.