Usage guide
After SEMS executable binary is ready to use (either compiled from sources or installed via packaging — see according guidelines), it’s time to prepare it for a run with specific parameters suiting concrete setup.
Some tips and tricks:
It is highly recommended to not run SEMS under the root user, as you open up a hole for resources consumption and it’s just a good manner to always run any daemon under dedicated user/group.
Manage SEMS via systemd. Systemd gives a versatile approach of managing daemons, which does things (mostly) automatically and eliminates human mistakes, if the systemd unit file was previously properly configured. See according chapter of this guide with a systemd unit file example.
Do not run SEMS constantly in the debug log level mode, because this will overflow your log file and use a lot of disk space. SEMS is producing enough log amounts in the debug mode, hence it’s recommended to use it carefully.
To be able to adopt SEMS for your needs and make it a bit more efficient during its run, see according tuning guide.
Start options
A list of start options available for SEMS binary:
-f- Set configuration file.-x- Set path for plug-ins.-d- Set network device (or IP address) for media advertising.-E- Enable debug mode (do not daemonize, log to stderr).-P- Set PID file.-u- Set user ID.-g- Set group ID.
-D- Set log level (0=error, 1=warning, 2=info, 3=debug; default=2).-v- Print version.-h- Print this help.
sems.conf
Can either be provided by any of the following ways:
packaging, see the packaging guide
installed using
make install, if SEMS is compiled from sources (make sure to have enough permissions on your file system)or a simplest way — copy-paste a sample config from the
core/etc/sems.conf.sampleof the cloned repository
To start SEMS with a prepared config:
/usr/local/sbin/sems -f <path-to-config>/sems.conf
General sems.conf parameters
Specify whether sems should run in daemon mode (background).
fork={yes|no}
fork=no is the same as -E
Debug mode: do not fork and log to stderr.
stderr={yes|no}
stderr=yes is the same as -E
Sets log level (error=0, warning=1, info=2, debug=3).
loglevel={0|1|2|3}
same as -D
Systemd unit-file example
This is a working example can be used for managing SEMS via systemd:
[Unit]
Description=SEMS B2B
After=mariadb.service
After=network-online.target
Requires=network-online.target
Wants=mariadb.service
[Service]
Type=notify
User=<your-user-here>
Group=<your-group-here>
Environment=LD_LIBRARY_PATH=/usr/local/lib/sems
Environment='CFGFILE=/usr/local/etc/sems/sems.conf'
PassEnvironment=LD_LIBRARY_PATH
PIDFile=/run/sems/sems.pid
Restart=always
ExecStart=/usr/local/sbin/sems -u <your-user-here> -g <your-group-here> -P /run/sems/sems.pid -f $CFGFILE
KillSignal=SIGKILL
SuccessExitStatus=SIGKILL
TimeoutStopSec=10
LimitNOFILE=100000
[Install]
WantedBy=multi-user.target
Alias=sems-b2b.service
It’s a serving example! We as an open-source project do not guarantee this will suit your VoIP environment. Make sure to adopt it for your own needs!