Questions about astpp 6

in version 6 after restarting the server, it seems that the freeswitch does not go up, you need to do a fw reload for the sip devices to re-register. my question is: what does this reset procedure do within ASTPP
would it be the monitor?
and in this case we have to create a rule in crontab?

Hello @maxxsolutions ,
Please check your monit servic, is it working?
Thanks.

yes, monit and freeswitch services are started

Hello @maxxsolutions ,
Please check if in monitrc conf file the freeswitch path is correct as monit service is helping the services to restart itself.
Thanks.

I did the following
I disabled the freeswitch service at system startup
what happens is the following, the monit ignores the commands
check process freeswitch with pidfile /var/run/freeswitch/freeswitch.pid
start program=“/bin/systemctl start freeswitch”
stop program=“/bin/systemctl stop freeswitch”
because the pid is already running
the problem is? why the freeswitch does not start correctly with the system?
however as mentioned above
on restart, the monit will see that the service is not active and starts correctly, thus registering the sip devices, without needing a restart via the command line or via the web interface

Hello @maxxsolutions ,
Please add this line
/usr/share/freeswitch/run/freeswitch.pid , below file if not added already.

vim /etc/monit/monitrc
Thanks.

Hi,
just add extra line
/usr/share/freeswitch/run/freeswitch.pid

on /etc/monit/monitrc? Or change it for
check process freeswitch with pidfile /var/run/freeswitch/freeswitch.pid?

I still haven’t been able to solve this problem,
because what does not start is mod_sofia,
it only goes up after a restart on the freeswitch

I have the same problem here. Freeswitch somehow hang/killed, Monitr did start the freeswitch services, but when check sofia status, mod_sofia is not load. Have to run freeswitch restart manually to make it work. Any fix for this?

I have seen this also upon boot/reboot mod_sofia not running, and you have to manually restart FreeSwitch.

With reboot, possibility of freeswitch having higher priority with boot order then mysql and that is the reason when FS started DB is still starting and modules of FS responsible to fetch data from DB did try unsuccessfully.

Simply add cron @reboot sleep 20 && and fs_cli -x ‘reload mod_sofia’

1 Like

I will test this and give you feedback.

I added cron @reboot sleep 30 && sudo systemctl restart freeswitch
Freeswitch is working after reboot.

1 Like

Sounds to me like a systemd problem. What database server are you running? MySQL or MariaDB. Freeswitch needs to start after the database and the way to do that is with the systemd unit file.

Add this systemd file to /etc/systemd/system and modify the first part if using mariadb instead of MySQL so it waits until the database has started.

[Unit]
Description=freeswitch
After=syslog.target network.target local-fs.target mysql.service

[Service]
Type=forking
RuntimeDirectory=freeswitch
PIDFile=/run/freeswitch/freeswitch.pid
Environment="DAEMON_OPTS=-ncwait -nonat"
EnvironmentFile=-/etc/default/freeswitch
ExecStart=/usr/bin/freeswitch $DAEMON_OPTS
TimeoutSec=45s
Restart=always

User=www-data
Group=www-data
LimitCORE=infinity
LimitNOFILE=100000
LimitNPROC=60000
LimitSTACK=250000
LimitRTPRIO=infinity
LimitRTTIME=infinity
IOSchedulingClass=realtime
IOSchedulingPriority=2
CPUSchedulingPriority=89
UMask=0007

; Comment this out if using OpenVZ
CPUSchedulingPolicy=rr

[Install]
WantedBy=multi-user.target

It’s for sure a FreeSwitch issue as @devangn mentioned.