Fwconsole restart hangs because of call transfer script

We have a Freepbx 16 server that currently is having a problem with the E1 link. At least once a day we get a timeout error from the provider and for the moment the only way we can get service back is to do a “fwconsole restart” every time we detect the error. This worked fine for a couple weeks but now we notice that once in a while the fwconsole will hang while trying to stop the call transfer monitoring service (a php script used by freepbx and a recent addition). We have an automatic script that runs when we see the error in the log files:

chan_dahdi.c: Chan 10 - Protocol error. Reason = Seize Timeout

This executes “fwconsole restart” when it sees that message. Unfortunately now we need a way to know if the command is stuck or not. How would you recommend to check this from a bash script?

Which signalling protocol are you using?

I would enable pri debugging on the span to a file , a shell script much like

rasterisk -x 'pri set debug /var/log/asterisk/pri.log'
rasterisk -x 'pri set debug on span N'
tail -F /var/log/asterisk/pri.log |while read line ;do [[ $line =~ 'Seize Timeout' ]] && /usr/sbin/fwconsole restart;done

It’s been a while since I had a pri but back then you could set a log file destination, I can’t confirm it still works though. In that file maybe you can find a precursor that could be used better .

It is MFC/R2 CAS but that is a problem that need to be fixed by the phone company. We know our side is fine as this same server was working in another site before it was moved to this office. While we wait for the permanent fix we need to restart Asterisk and Wanrouter to recover.

Going through logs I found that the log file for the call transfer monitor was huge with this message repeating:

2022-05-17 06:13 -05:00: Call Trasnfer Event listener
2022-05-17 06:13 -05:00: Exception: Asterisk is not connected in file /var/www/html/admin/libraries/php-asmanager.php on line 248
2022-05-17 06:13 -05:00: Stack trace:
2022-05-17 06:13 -05:00: 1. Exception->() /var/www/html/admin/libraries/php-asmanager.php:248
2022-05-17 06:13 -05:00: 2. AGI_AsteriskManager->send_request() /var/www/html/admin/libraries/php-asmanager.php:873
2022-05-17 06:13 -05:00: 3. AGI_AsteriskManager->Events() /var/www/html/admin/modules/core/functions.inc/calltrasnfer-eventlistener.php:4
2022-05-17 06:13 -05:00: 4. include() /var/www/html/admin/modules/core/call-transfer-events.php:11

I rebooted the server yesterday and the messages stopped so I hope the problem has been resolved. I guess a simple “fwconsole stop” did not properly shutdown everything.

For Sangoma hardware it makes sense to watch at a level closer to the hardware using wanpipemon
perhaps you could ‘shock it back to life’ by looping the signal back briefly.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.