1. systemctl enable freeswitch
2. 进入 /usr/lib/systemd/system/ 目录,编辑Freeswitch启动文件: freeswitch.service
设置使用root用户启动,设置启动参数:
[Unit] Description=FreeSWITCH After=syslog.target network.target After=mysqld.service httpd.service [Service] User=root EnvironmentFile=-/etc/sysconfig/freeswitch # RuntimeDirectory is not yet supported in CentOS 7. A workaround is to use /etc/tmpfiles.d/freeswitch.conf #RuntimeDirectory=/run/freeswitch #RuntimeDirectoryMode=0750 WorkingDirectory=/run/freeswitch ExecStart=/usr/bin/freeswitch -nc -nonat -nosql ExecReload=/usr/bin/kill -HUP $MAINPID [Install] WantedBy=multi-user.target
3. 编辑 freeswitch.service文件保存后 执行: systemctl daemon-reload
4. 服务启动: service freeswitch start
等待10秒后,进入控制台查看: fs_cli
5. 开机自启动设置: shutdown -r now
服务器重启之后,查看Freeswitch是否处于已启动的运行状态: ps aux|grep freeswitch