No chance to resolve the permissions issue

marcw

Member
Hello!

Today I tried to install FlashphonerWebCallServer-5.2.1921 to replace FlashphonerWebCallServer-5.2.1054.
Unfortunatelly I am not able to solve the problem with permissions:

[root@www bin]# ./startup.sh
FlashphonerWebCallServer-5.2.1921: starting
ERROR: FlashphonerWebCallServer cannot be started from user flashphoner, please fix the permissions to the folders or run 'webcallserver set-permissions'!

Of course I tried webcallserver set-permissions, also I tried
sudo chmod -R 775 /usr/local/FlashphonerWebCallServer/lib
and
sudo chown -R flashphoner:flashphoner /usr/local/FlashphonerWebCallServer/lib

everything without success. Also a couple of uninstall and install didn't help. My product server is without fuctionality in the moment. Can you help me?



[root@www bin]# sudo ./webcallserver set-permissions
Permissions are set, please restart WCS
[root@www bin]# sudo ./webcallserver start
FlashphonerWebCallServer-5.2.1921: starting
ERROR: FlashphonerWebCallServer cannot be started from user flashphoner, please fix the permissions to the folders or run 'webcallserver set-permissions'!
[root@www bin]# journalctl -xe [FAILED]
Apr 11 04:23:53 www.marcophono.com sudo[24911]: pam_unix(sudo:session): session opened for user flashphoner by root(uid=0)
Apr 11 04:23:53 www.marcophono.com sudo[24911]: pam_unix(sudo:session): session closed for user flashphoner
Apr 11 04:23:53 www.marcophono.com sudo[24920]: root : TTY=pts/0 ; PWD=/usr/local/FlashphonerWebCallServer-5.2.1921/bin ; USER=flashphoner ; COM
Apr 11 04:23:53 www.marcophono.com sudo[24920]: pam_unix(sudo:session): session opened for user flashphoner by root(uid=0)
Apr 11 04:23:53 www.marcophono.com sudo[24920]: pam_unix(sudo:session): session closed for user flashphoner
Apr 11 04:23:53 www.marcophono.com sudo[24930]: root : TTY=pts/0 ; PWD=/usr/local/FlashphonerWebCallServer-5.2.1921/bin ; USER=flashphoner ; COM
Apr 11 04:23:53 www.marcophono.com sudo[24930]: pam_unix(sudo:session): session opened for user flashphoner by root(uid=0)
Apr 11 04:23:53 www.marcophono.com sudo[24930]: pam_unix(sudo:session): session closed for user flashphoner
Apr 11 04:23:53 www.marcophono.com sudo[24939]: root : TTY=pts/0 ; PWD=/usr/local/FlashphonerWebCallServer-5.2.1921/bin ; USER=flashphoner ; COM
Apr 11 04:23:53 www.marcophono.com sudo[24939]: pam_unix(sudo:session): session opened for user flashphoner by root(uid=0)
Apr 11 04:23:53 www.marcophono.com sudo[24939]: pam_unix(sudo:session): session closed for user flashphoner
Apr 11 04:23:53 www.marcophono.com sudo[24948]: root : TTY=pts/0 ; PWD=/usr/local/FlashphonerWebCallServer-5.2.1921/bin ; USER=flashphoner ; COM
Apr 11 04:23:53 www.marcophono.com sudo[24948]: pam_unix(sudo:session): session opened for user flashphoner by root(uid=0)
Apr 11 04:23:53 www.marcophono.com sudo[24948]: pam_unix(sudo:session): session closed for user flashphoner
Apr 11 04:23:53 www.marcophono.com sudo[24957]: root : TTY=pts/0 ; PWD=/usr/local/FlashphonerWebCallServer-5.2.1921/bin ; USER=flashphoner ; COM
Apr 11 04:23:53 www.marcophono.com sudo[24957]: pam_unix(sudo:session): session opened for user flashphoner by root(uid=0)
Apr 11 04:23:53 www.marcophono.com sudo[24957]: pam_unix(sudo:session): session closed for user flashphoner
Apr 11 04:23:53 www.marcophono.com sudo[24966]: root : TTY=pts/0 ; PWD=/usr/local/FlashphonerWebCallServer-5.2.1921/bin ; USER=flashphoner ; COM
Apr 11 04:23:53 www.marcophono.com sudo[24966]: pam_unix(sudo:session): session opened for user flashphoner by root(uid=0)
Apr 11 04:23:53 www.marcophono.com sudo[24966]: pam_unix(sudo:session): session closed for user flashphoner
Apr 11 04:23:53 www.marcophono.com sudo[24976]: root : TTY=pts/0 ; PWD=/usr/local/FlashphonerWebCallServer-5.2.1921/bin ; USER=flashphoner ; COM
Apr 11 04:23:53 www.marcophono.com sudo[24976]: pam_unix(sudo:session): session opened for user flashphoner by root(uid=0)
Apr 11 04:23:53 www.marcophono.com sudo[24976]: pam_unix(sudo:session): session closed for user flashphoner
Apr 11 04:23:53 www.marcophono.com sudo[24990]: root : TTY=pts/0 ; PWD=/usr/local/FlashphonerWebCallServer-5.2.1921/bin ; USER=flashphoner ; COM
Apr 11 04:23:53 www.marcophono.com sudo[24990]: pam_unix(sudo:session): session opened for user flashphoner by root(uid=0)
Apr 11 04:23:53 www.marcophono.com sudo[24990]: pam_unix(sudo:session): session closed for user flashphoner
Apr 11 04:23:53 www.marcophono.com sudo[23251]: pam_unix(sudo:session): session closed for user root

[root@www bin]# sudo ./webcallserver start standalone
FlashphonerWebCallServer-5.2.1921: starting

######### Start standalone mode #########

ERROR: FlashphonerWebCallServer cannot be started from user flashphoner, please fix the permissions to the folders or run 'webcallserver set-permissions'!


[root@www bin]# systemctl status webcallserver -l
● webcallserver.service - Flashphoner WebCallServer
Loaded: loaded (/etc/systemd/system/webcallserver.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Fri 2025-04-11 04:17:38 CEST; 8min ago
Process: 15974 ExecStop=/bin/bash webcallserver stop (code=exited, status=0/SUCCESS)
Main PID: 1373 (code=exited, status=0/SUCCESS)

Apr 11 04:11:22 www.marcophono.com webcallserver[13511]: cat: /usr/local/FlashphonerWebCallServer/conf/flashphoner.properties: No such file or directory
Apr 11 04:11:23 www.marcophono.com webcallserver[13511]: FlashphonerWebCallServer: starting[FAILED]
Apr 11 04:11:23 www.marcophono.com systemd[1]: Started SYSV: WebCallServer Init Script.
Apr 11 04:15:04 www.marcophono.com systemd[1]: [/etc/systemd/system/webcallserver.service:5] Unknown lvalue 'StartLimitIntervalSec' in section 'Unit'
Apr 11 04:15:04 www.marcophono.com systemd[1]: [/etc/systemd/system/webcallserver.service:6] Unknown lvalue 'StartLimitBurst' in section 'Unit'
Apr 11 04:15:08 www.marcophono.com systemd[1]: [/etc/systemd/system/webcallserver.service:5] Unknown lvalue 'StartLimitIntervalSec' in section 'Unit'
Apr 11 04:15:08 www.marcophono.com systemd[1]: [/etc/systemd/system/webcallserver.service:6] Unknown lvalue 'StartLimitBurst' in section 'Unit'
Apr 11 04:17:38 www.marcophono.com systemd[1]: Stopping Flashphoner WebCallServer...
Apr 11 04:17:38 www.marcophono.com bash[15974]: FlashphonerWebCallServer: not running
Apr 11 04:17:38 www.marcophono.com systemd[1]: Stopped Flashphoner WebCallServer.

P.S.: I have send you my access data through your form
 

Max

Administrator
Staff member
Good day, Marc.
Seems you've unpacked FlashphonerWebCallServer-5.2.1921.tar.gz archive to /usr/local folder directly. You should not do it.
So you should do the following:
1. Backup the current installation
2. Uninstall WCS
Code:
/usr/local/FlashphonerWebCallServer/bin/uninstall.sh
3. Download and unpack FlashphonerWebCallServer-5.2.1921.tar.gz to home dir
Code:
cd ~
wget https://flashphoner.com/downloads/builds/WCS/5.2/FlashphonerWebCallServer-5.2.1921.tar.gz
tar -xzf FlashphonerWebCallServer-5.2.1921.tar.gz
4. Install WCS
Code:
cd ~/FlashphonerWebCallServer-5.2.1921
./install.sh
5. Copy the following files from previous installation backup
Code:
wss.jks
flashphoner.license
flashphoner.properties
wcs-core.properties
*.sdp
database.yml
Then WCS should start normally.
 

marcw

Member
Unfortunatelly another issue occured. The recording works one or two times and then something happens. Every call is instantly terminated. May be you can see something in the attached logs? When this phaenomen happens, onle the *-in.wav files are saved but they are very small of course.
Even if I remove

record=/usr/local/FlashphonerWebCallServer/records
preserve_non_mixed_recorded_files=true

from flashphoner.properties this issue occurs.
 

Attachments

marcw

Member
Yes, I returned to 5.2.1054 as also the latest WCS didn't work for me. The latest one didn't work for me at all. Even the very first call was terminated in the moment the call was initialized.
 

Max

Administrator
Staff member
We tested the build 5.2.1921 with your settings on our staging server. All the SIP calls are recodring successfully with the following settings
Code:
rtp_force_synchronization=true
rtp_activity_detecting=false,0
generate_av_for_ua=all
stun_freshness_timeout=1000000000
streaming_video_decoder_fast_start=false
add_register_auth_headers=false
mixer_video_enabled=false
rtp_receive_buffer_size=131072
rtp_send_buffer_size =131072
disable_manager_rmi=true
rest_max_connections=100

record=/usr/local/FlashphonerWebCallServer/records
preserve_non_mixed_recorded_files=true
We also excluded opus codec because our SIP PBX prefers it, but in your case PCMA (alaw) only is used.
So you can update to 5.2.1921 and test. If something goes wrong, please identify the call which is not recorded or fails for us to check the server logs.
 

marcw

Member
I installed now version 5.2.1930 as there was a fix declared what eventually could have been the fix for my problem but it wasn't. So it is as decribed: The first call works, all following calls are terminated in the moment of the handshake. The two test calls (the two very first calls in the logs) were going to 491777000001. Please feel free to log in , change, stop, restart the WCS. I have written onto my website that the service is currently unter maintaince.
 

Max

Administrator
Staff member
Seems like you've started two simultaneous SIP calls to the same callee namber in the same client session:
1744777564657.png

So PBX declines the first one
1744777726431.png

The client session was closed, and the second call was cancelled
1744777971167.png

It seems like either client (web page) code issue or REST hook issue. You should not start two simultaneous calls to the same number if SIP PBX rejects this.
 

marcw

Member
But I didn't change anything on the client side nor the REST hook. It was working since 10 years until I updated from 5.2.1054 to this newer version. What I could try is to find the version update between 5.2.1054 and 5.2.1921 where the issue is coming up. Would that help you to address the issue?
 

Max

Administrator
Staff member
When updating WCS from old version to a newer one, you should also care about WebSDK version update. For example, if you've updated WCS to 5.2.1921, you should also update WebSDK to 2.0.240, especially if you're still using 0.5.28.* builds.
Please try to make a test calls via Phone Min example https://wcs:8444/client2/examples/demo/sip/phone/phone.html.
 

Max

Administrator
Staff member
Hello. We believe that the first thing you should do is roll back — that is, downgrade to the version that was working for you. If version 5.2.1054 was working, then you should downgrade to that version.

If, for some reason, the downgrade doesn’t help, then you need to restore from a backup. The goal is to get the application running again on the previous version — to return to a working state, a stable point.

Once you've reverted to a stable state, you should set up an additional server and deploy WCS on it. Even if you deploy a trial version, that will be enough to test and ensure the system works.

Only after testing and confirming that the system works on the new version should you proceed with the upgrade. That’s how the update, testing, and migration process is designed to work.

Any other approach may lead to errors, failures, and the need to roll back.

The roadmap:

1. Do you have a backup?

2. If you don't have a backup you have to either move forward updating Web SDK as stated in previous reply.
Or move backward to 5.2.1054 where it worked for You last time.

3. Once you got a working version, you will be able to launch a new WCS server to test latest update.
 

marcw

Member
Hi Max!
Thank you for all your help!
And with a little help of ChatGPT (o3-mini-high) I was able to bring 5.2.1930 tu run! :) It seems that I had an error in my changed phone.js file. In version 5.1.1054 this didn't manifested as a noticable error but in the never version it does. It seems that the code initialized two connect commands (what you also mentioned) and the second one forced the WCS (or Asterisk?) to terminate the call. May be the new WCS is faster in processing or...whatever! But the recording does not work in the desired way. Only xxxxxx-in-wav files are saved containing the mixed tracks. In the server log it looks like this:
01:15:22,640 INFO RecordUtils - RTP-pool-32-thread-9 getRecordFileName template: null
01:15:22,640 INFO RecordUtils - RTP-pool-32-thread-9 6 params processed
01:15:22,640 INFO RecordUtils - RTP-pool-32-thread-9 result name: mpapp2-00491777000001-2025-04-18-01-15-22-d21a35d0-1be1-11f0-a410-e311f110875a-0-in
 

marcw

Member
Sure, I did update to 5.2.1930 and have the problem here. (only the recording problem is left)
record=/usr/local/FlashphonerWebCallServer/records
preserve_non_mixed_recorded_files=true
is added. But I am afraid meanwhile this is not solvable on the WCS side. I think it has to do with the Asterisk implementation. There is a phone call initialized throught a web user. Then Asterisk mixes the incoming stream from the callee with sln audio files which are started by the web user. So the callee only hears the sln files while the web user receives a mixed stream from callee stream and sln clips.
This is the php code where the sln injection into the stream is initialized:

PHP:
$output = shell_exec('cat /var/lib/asterisk/conferences/'.$cid);
echo "<pre>$output</pre>";

exec('echo "Channel: Local/s@inject-sound" > /tempcids/'.$cidf);
exec('echo "Application: PlayBack" >> /tempcids/'.$cidf);
exec('echo "Data: /var/lib/asterisk/sounds/en/'.$ac.'" >> /tempcids/'.$cidf);
exec('echo "Archive: No" >> /tempcids/'.$cidf);
exec('echo "Set: CONF='.$cid.'" >> /tempcids/'.$cidf);
exec('mv /tempcids/'.$cidf.' /var/spool/asterisk/outgoing');
So I can easily grab only the outgoing audio but not the pure incoming audio before it is mixed together with the sln file. If someone would say "Hey, Marc, you are totally wrong!" I would be happy. ;)
 
Top