How to configure "SFU functions with Simulcast"

sangsoo

Member
Hello.
I am testing "SFU functions with Simulcast".

1. test server
-----Version info-----
wcs_version=5.2.1151-79115db19701704f18c4ea27e5a6a80d9561862e
wcs_client_version=2.0.216-05436f8d7f316c9c1e919afcd2a813f4b146ff53

2. demo page
https://%mywcs%:8444/client2/sfu/examples/client/main.html

3. server log
My wcs don't have appkey:sfuApp registered, so the demo page connect always fails.

11:32:40,167 INFO RestClient - API-ASYNC-pool-13-thread-3 Method connect not available for app sfuApp​
11:32:40,168 WARN ManagerApiConnection - API-ASYNC-pool-13-thread-3 Failed to get object from REST with exception:serverApp sfuApp not found!​
11:32:40,169 INFO RestClient - API-ASYNC-pool-13-thread-3 Method ConnectionStatusEvent not available for app sfuApp​

4. "Quick testing guide" works fine.

I want to use sfu functions in wcs I already have.
Please let me know which configuration needs to be added.
thank you.
 
Last edited:

Max

Administrator
Staff member
Good day.
You should add sfuApp application using CLI:
Code:
add app -m  com.flashphoner.sfu.handler.SFUHandler -c com.flashphoner.sfu.handler.SFUCallbackHandler sfuApp sfuApp "http://localhost:8081/apps/EchoApp"
or just adding application description to apps section of database.yml file
Code:
apps:
  ...
  sfuApp: {name: sfuApp, key: sfuApp, url: 'http://localhost:8081/apps/EchoApp', handler: com.flashphoner.sfu.handler.SFUHandler,
    callback: com.flashphoner.sfu.handler.SFUCallbackHandler}
restMethods:
  ...
This file is not changed automatically when updating WCS because it may contain some customization. So the new applications sholud be added manually. Then WCS should be restarted to apply changes.
 

khrabr

New Member
Good day.
You should add sfuApp application using CLI:
Code:
add app -m  com.flashphoner.sfu.handler.SFUHandler -c com.flashphoner.sfu.handler.SFUCallbackHandler sfuApp sfuApp "http://localhost:8081/apps/EchoApp"
or just adding application description to apps section of database.yml file
Code:
apps:
  ...
  sfuApp: {name: sfuApp, key: sfuApp, url: 'http://localhost:8081/apps/EchoApp', handler: com.flashphoner.sfu.handler.SFUHandler,
    callback: com.flashphoner.sfu.handler.SFUCallbackHandler}
restMethods:
  ...
This file is not changed automatically when updating WCS because it may contain some customization. So the new applications sholud be added manually. Then WCS should be restarted to apply changes.

Hello Max!
Could you please help me with the same problem.
I tried both methods, but the demo page doesn't open.
Should I also add something to the restMethods section?
Maybe I need to change the url in the sfuApp description?
 

khrabr

New Member
Yes it is.
Code:
% show apps
name              appKey            URL                                                                                                                                                                                                 
------------------------------------------------------------------------------                                                                                                                                                         
qaApp             qaApp             http://localhost:8081/apps/QAApp                                                                                                                                                                   
defaultApp        defaultApp        http://localhost:8081/apps/EchoApp                                                                                                                                                                 
wcs3App           wcs3App           http://localhost:8081/apps/EchoApp                                                                                                                                                                 
websocketChatApp  websocketChatApp  http://localhost:8081/apps/ChatApp                                                                                                                                                                 
flashStreamingApp flashStreamingApp http://localhost:8081/apps/EchoApp                                                                                                                                                                 
chatRoomApp       roomApp           http://localhost:8081/apps/RoomApp                                                                                                                                                                 
flashChatApp      flashChatApp      http://localhost:8081/apps/ChatApp                                                                                                                                                                 
chatRoomApp       chatRoomApp       http://localhost:8081/apps/ChatRoomApp                                                                                                                                                             
callApp           callApp           http://localhost:8081/apps/CallApp                                                                                                                                                                 
chatRoomApp       flashRoomApp      http://localhost:8081/apps/RoomApp                                                                                                                                                                 
clickToCallApp    clickToCallApp    http://localhost:8081/apps/ClickToCallApp                                                                                                                                                           
conferenceApp     conferenceApp     http://localhost:8081/apps/ConferenceApp                                                                                                                                                           
sfuApp            sfuApp            http://localhost:8081/apps/EchoApp                                                                                                                                                                 

% show app-rest-methods sfuApp
show app-rest-methods sfuApp: no methods available
Code:
  sfuApp: {name: sfuApp, key: sfuApp, url: 'http://localhost:8081/apps/EchoApp', handler: com.flashphoner.sfu.handler.SFUHandler,
    callback: com.flashphoner.sfu.handler.SFUCallbackHandler}
 

Max

Administrator
Staff member
Please check if you have installed the latest WCS build (5.2.1374 for now). If yes, and the page still is not avalable, seems you've deleted it eventually. In this case, you have to build the examples Building the examples and copy dist folder contents to /usr/local/FlashphonerWebCallServer/client2/sfu folder.
 

khrabr

New Member
I have a problem with npm install.
Seems that a artifactory.flashphoner.com is down.

Code:
npm ERR! network request to https://artifactory.flashphoner.com:4873/wrappy/-/wrappy-1.0.2.tgz failed, reason: getaddrinfo ENOTFOUND artifactory.flashphoner.com
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
 

Max

Administrator
Staff member
Please remove package-lock.json file before npm install. Another option is to use npm to get the examples as supposed in this doc NPM:
Code:
npm init
npm install @flashphoner/sfusdk-examples
cd node_modules/@flashphoner/sfusdk-examples
nvm use 16
npm install && npm run build
 

khrabr

New Member
Many thanks for the help!

SFU seems to work.

I had a problem after updating to 5.2.1374.
wss could not start on port 443.

Solution here:

Change
WCS_NON_ROOT=true
to
WCS_NON_ROOT=false

in /usr/local/FlashphonerWebCallServer/bin/setenv.sh
 
Top