Active Calls Page Empty

Tuly

Member
Sep 6, 2017
45
1
8
40
Hi

I recently installed a brand new FusionPBX system and migrated my existing setup by importing the database from my old FusionPBX installation. The system is running well overall — the web interface is fully functional, FreeSWITCH is working, Calls are processing correctly

However the Active Calls page is completely empty — no calls are displayed at all.

To clarify:

Calls are being processed successfully by FreeSWITCH.

The show channels command from fs_cli returns active calls as expected.

Any idea what it could be?
 
This is what I get in inspect elements on the active calls page



websocket_client.js?…4e9800998ecf8427e:3 WebSocket connection to 'wss://xxx.xx.x.xx/websockets/' failed:
ws_client @ websocket_client.js?…4e9800998ecf8427e:3
connectWebsocket @ active_calls.php:1220
(anonymous) @ active_calls.php:1833

active_calls.php:1249 Websocket Disconnected
(anonymous) @ active_calls.php:1249
 
I also have this issue with a fresh install, been looking through various guides, 1 article mentioned something about the wss.pem and agent,pem, but i havent been able to resolve yet either. Once i do i will post the steps required to resolve

I assumed I could just use the tls.pem i generated for the phones by copying it over wss.pem but this didnt seem to work
 
Does the new install have SSL/TLS working properly? I'd start looking there, and also check if the WSS port (7443 by default) is open. Personally I don't like exposing this and my active calls page works fine.

Failing that maybe do a proper "Backup" / "Restore" of the old system to new just as a sanity check as I too have had things break due to customizations when migrating only the database and not the PHP/Freeswitch files which are moved over with a "Backup/Restore". If the Backup/Restore works then look at the diff.
 
Last edited:
i did not configure anything with the SSL,
it has nothing to do with my backup, i just did a new install, and i have the same issue
 
My issue was permissions on the /var/run/fusionpbx folder. stopping the websocket router service running

and the tls file does replace agent.pem,tls.pem,wss.pem and dtls-srtp.pem
 
Thanks for chipping in greycom, Tuly sounds pretty confident a restore which would restore permissions and certificates has nothing to do with it though. Tuly, your vibe is wasted as a tech practitioner, perhaps you should consider politics or management.
 
Recently switched from 5.3 to master and active calls widget stops every day. I have to run
chown -R www-data:www-data /var/run/fusionpbx
and it works. I now include that in a cron task every morning
 
Thanks whut, greycom, and RTL. The permissions on /var/run/fusionpbx sound like a recurring theme in 5.4 (I have yet to upgrade) has this been reported to the maintainers via a bug ticket at fusionpbx.com?
 
I havent reported anything as i wasnt sure if I had caused the permissions change on the folder due to me using a paid for SSL (i havent done an upgrade in a few years) and the method i used to get it installed.

Also Ive checked the /etc/systemd/system/websockets.service script and its recreating the /var/run/fusionpbx folder at startup and using chown to set permissions to www-data:www-data so i am unsure what process is changing the permissions back to root or if the script is failing to set permissions at runtime
 
Last edited:
I see there's some significant changes from 5.3 to 5.4, and like many others I'm facing issues with the websockets, though I've yet to open a ticket as I'm far from a vanila configuration.
The first issue I faced was repeated service restarts due to failed authentication handshakes:
Code:
while true; do sudo -u www-data /usr/bin/php /var/www/fusionpbx/core/websockets/resources/service/websockets.php --no-fork; done
Running in foreground[2025-07-26 13:14:15] [INFO] Service   : websocket_service
[2025-07-26 13:14:15] [INFO] Process ID: 2436484
[2025-07-26 13:14:15] [INFO] PID File  : /var/run/fusionpbx/websocket_service.pid
[2025-07-26 13:14:20] [DEBUG] Received message from e1981d94129c5b70d3489f718fbdf4b2
[2025-07-26 13:14:20] [INFO] Authenticating client: e1981d94129c5b70d3489f718fbdf4b2
[2025-07-26 13:14:20] [INFO] Client e1981d94129c5b70d3489f718fbdf4b2 authenticated
[2025-07-26 13:14:20] [DEBUG] Received message from e1981d94129c5b70d3489f718fbdf4b2
[2025-07-26 13:14:20] [DEBUG] Message is from subscriber
FATAL ERROR: 'Invalid WebSocket handshake' (ERROR CODE: 0) FROM /var/www/fusionpbx/core/websockets/resources/classes/websocket_service.php (Line: 759)
#0 /var/www/fusionpbx/core/websockets/resources/classes/websocket_service.php(533): websocket_service->handshake()
#1 /var/www/fusionpbx/core/websockets/resources/service/websockets.php(57): websocket_service->run()
#2 {main}
[2025-07-26 13:14:23] [INFO] Disconnecting subscriber: 'Resource id #21'
[2025-07-26 13:14:23] [DEBUG] Current Subscribers: e1981d94129c5b70d3489f718fbdf4b2
[2025-07-26 13:14:23] [NOTICE] Initiating Shutdown...
Running in foreground[2025-07-26 13:14:23] [INFO] Service   : websocket_service
[2025-07-26 13:14:23] [INFO] Process ID: 2436497
[2025-07-26 13:14:23] [INFO] PID File  : /var/run/fusionpbx/websocket_service.pid
FATAL ERROR: 'Invalid WebSocket handshake' (ERROR CODE: 0) FROM /var/www/fusionpbx/core/websockets/resources/classes/websocket_service.php (Line: 759)
#0 /var/www/fusionpbx/core/websockets/resources/classes/websocket_service.php(533): websocket_service->handshake()
#1 /var/www/fusionpbx/core/websockets/resources/service/websockets.php(57): websocket_service->run()
#2 {main}
[2025-07-26 13:14:38] [NOTICE] Initiating Shutdown...
Running in foreground[2025-07-26 13:14:38] [INFO] Service   : websocket_service
[2025-07-26 13:14:38] [INFO] Process ID: 2436519
[2025-07-26 13:14:38] [INFO] PID File  : /var/run/fusionpbx/websocket_service.pid
FATAL ERROR: 'Invalid WebSocket handshake' (ERROR CODE: 0) FROM /var/www/fusionpbx/core/websockets/resources/classes/websocket_service.php (Line: 759)
#0 /var/www/fusionpbx/core/websockets/resources/classes/websocket_service.php(533): websocket_service->handshake()
#1 /var/www/fusionpbx/core/websockets/resources/service/websockets.php(57): websocket_service->run()
#2 {main}
[2025-07-26 13:14:53] [NOTICE] Initiating Shutdown...
Running in foreground[2025-07-26 13:14:53] [INFO] Service   : websocket_service
[2025-07-26 13:14:53] [INFO] Process ID: 2436541
[2025-07-26 13:14:53] [INFO] PID File  : /var/run/fusionpbx/websocket_service.pid
FATAL ERROR: 'Invalid WebSocket handshake' (ERROR CODE: 0) FROM /var/www/fusionpbx/core/websockets/resources/classes/websocket_service.php (Line: 759)
#0 /var/www/fusionpbx/core/websockets/resources/classes/websocket_service.php(533): websocket_service->handshake()
#1 /var/www/fusionpbx/core/websockets/resources/service/websockets.php(57): websocket_service->run()
#2 {main}
[2025-07-26 13:15:08] [NOTICE] Initiating Shutdown...

That was entirely tech debt on my side, had previously exposed telemetry on port 8080 but forgot to cleanup the collector after removing it, stopping the scaping resolved the service shutdowns.

Now that the service is runnning without shutdown/restarts the troubleshooting continues. The Active Calls page is able to connect to the websocket for 1 minute before loosing its connection, though it doesn't display any call activity during this minute:
Code:
while true; do sudo -u www-data /usr/bin/php /var/www/fusionpbx/core/websockets/resources/service/websockets.php --no-fork; done
Running in foreground[2025-07-26 13:48:36] [INFO] Service   : websocket_service
[2025-07-26 13:48:36] [INFO] Process ID: 2439838
[2025-07-26 13:48:36] [INFO] PID File  : /var/run/fusionpbx/websocket_service.pid
[2025-07-26 13:48:44] [DEBUG] Received message from d58d17e9eb22399d83f238d7276e6b47
[2025-07-26 13:48:44] [INFO] Authenticating client: d58d17e9eb22399d83f238d7276e6b47
[2025-07-26 13:48:44] [INFO] Client d58d17e9eb22399d83f238d7276e6b47 authenticated
[2025-07-26 13:48:44] [DEBUG] Received message from d58d17e9eb22399d83f238d7276e6b47
[2025-07-26 13:48:44] [DEBUG] Message is from subscriber
[2025-07-26 13:49:44] [WARNING] Header is empty!
[2025-07-26 13:49:44] [INFO] Disconnecting subscriber: 'Resource id #22'
[2025-07-26 13:49:44] [INFO] Disconnected subscriber: 'd58d17e9eb22399d83f238d7276e6b47'
[2025-07-26 13:49:44] [DEBUG] Current Subscribers: 
[2025-07-26 13:49:44] [ERROR] Cannot send: invalid resource
[2025-07-26 13:49:44] [DEBUG] Empty message
[2025-07-26 13:49:57] [DEBUG] Received message from d58d17e9eb22399d83f238d7276e6b47
[2025-07-26 13:49:57] [INFO] Authenticating client: d58d17e9eb22399d83f238d7276e6b47
[2025-07-26 13:49:57] [INFO] Client d58d17e9eb22399d83f238d7276e6b47 authenticated
[2025-07-26 13:49:57] [DEBUG] Received message from d58d17e9eb22399d83f238d7276e6b47
[2025-07-26 13:49:57] [DEBUG] Message is from subscriber
[2025-07-26 13:50:57] [WARNING] Header is empty!
[2025-07-26 13:50:57] [INFO] Disconnecting subscriber: 'Resource id #27'
[2025-07-26 13:50:57] [INFO] Disconnected subscriber: 'd58d17e9eb22399d83f238d7276e6b47'
[2025-07-26 13:50:57] [DEBUG] Current Subscribers: 
[2025-07-26 13:50:57] [ERROR] Cannot send: invalid resource
[2025-07-26 13:50:57] [DEBUG] Empty message

Exploring off the beaten path is fun until its not. One of the new features in 5.4 is OIDC authentication so maybe I can finally rip out my authentication proxy and be more aligned with FusionPBX out of the box... the weekend is yet young...
 
Edit /etc/systemd/system/websockets.service and add PermissionsStartOnly=true so it looks like below and either reboot or
systemctl daemon-reload <enter>
systemctl start websockets.service <enter>


#
# Install with:
#
# cp debian-websockets.service /etc/systemd/system/websockets.service
# systemctl daemon-reload
# systemctl enable --now websockets.service
#
[Unit]
Description=Websocket Router Service

[Service]
PermissionsStartOnly=true
ExecStartPre=mkdir -p /var/run/fusionpbx
ExecStartPre=/usr/bin/chown www-data:www-data /var/run/fusionpbx
ExecStart=/usr/bin/php /var/www/fusionpbx/core/websockets/resources/service/websockets.php --no-fork
User=www-data
Group=www-data
Restart=always
RestartSec=5
StartLimitInterval=0

[Install]
WantedBy=multi-user.target
 
Thanks, I still need to work around or remove my authentication proxy likely stipping headers and/or rewriting requests, but I can confirm that after a reboot my permissions to /var/run/fusionpbx had reverted to root:root. Made the change you suggested but haven't rebooted yet.