Installation problems on Ubuntu 24.04, Java 17, WCS 5.2.1930

marcw

Member
Hello!

Nearly since a week I try to install the WCS 5.2.1930 onto my new server. I mean I have installed it but the error messages meanwhile drive me crazy and I give it up. I politely ask you to have a look into my server to find that nerve killer.
Finally my end boss is " class com.flashphoner.server.client.MainWCSClient cannot be cast to class com.flashphoner.server.client.MediaWCSClient".


Code:
--------------------> REGISTER sip:78.46.74.84;lr SIP/2.0
from:   /78.46.74.84:30001
to:     /78.46.74.84:5060
time:   1753228555755
timeStamp:
isSender:       true
transactionId:  z9hg4bkbb3855a8bd02c2efbcb5ad2169d0fc90
callId: a31e05be73e2acf3257006e32aa06e45@78.46.74.84

REGISTER sip:78.46.74.84;lr SIP/2.0
Call-ID: a31e05be73e2acf3257006e32aa06e45@78.46.74.84
CSeq: 1 REGISTER
From: <sip:mpapp2@78.46.74.84>;tag=98eb1faf
To: <sip:mpapp2@78.46.74.84>
Via: SIP/2.0/UDP 78.46.74.84:30001;branch=z9hG4bKbb3855a8bd02c2efbcb5ad2169d0fc90
Max-Forwards: 70
User-Agent: WebCallServer
Allow: MESSAGE,REFER,NOTIFY,CANCEL,ACK,UPDATE,INVITE,OPTIONS,INFO,BYE
Contact: <sip:mpapp2-941603642@78.46.74.84:30001>;expires=3600
Expires: 3600
Content-Length: 0


01:55:55,756 INFO           WCS4Handler - API-ASYNC-pool-13-thread-18 RestClientConfig for client /78.94.168.105:62240/78.46.74.84:8443-e4a106d8-4e45-4ee0-8978-47d3ae37322b:
{
  "call" : {
    "restExclude" : "",
    "clientExclude" : "",
    "restOverwrite" : "",
    "restOnError" : "FAIL",
    "restPolicy" : "NOTIFY"
  }
}
01:55:55,756 INFO            RestClient - API-ASYNC-pool-13-thread-18 SEND REST OBJECT ==>
URL:https://www.marcophonoai.de/rest-hooks/ConnectionStatusEvent
OBJECT:
{
  "nodeId" : "kGTMJE0P5Q5aRI1ecoBfZ0dQiwH9lncX@78.46.74.84",
  "appKey" : "defaultApp",
  "sessionId" : "/78.94.168.105:62240/78.46.74.84:8443-e4a106d8-4e45-4ee0-8978-47d3ae37322b",
  "sipLogin" : "mpapp2",
  "sipAuthenticationName" : "mpapp2",
  "sipPassword" : "xxx",
  "sipDomain" : "78.46.74.84",
  "sipOutboundProxy" : "78.46.74.84",
  "sipPort" : 5060,
  "useWsTunnel" : false,
  "useWsTunnelPacketization2" : false,
  "msePacketizationVersion" : 2,
  "useBase64BinaryEncoding" : false,
  "mediaProviders" : [ "WebRTC", "MSE" ],
  "authToken" : "fa754ed0-3a43-418b-bf08-40e35d8eea2e",
  "status" : "ESTABLISHED",
  "clientVersion" : "2.0",
  "clientOSVersion" : "5.0 (Windows)",
  "clientBrowserVersion" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:140.0) Gecko/20100101 Firefox/140.0",
  "keepAlive" : false,
  "origin" : "https://marcophonoai.de:8888"
}
01:55:55,759 INFO           WCS4Handler - API-ASYNC-pool-13-thread-18 Connected client: ClientConfig{rtspMedia=false, rtmpAgent=false, wsTunnel=false, login='mpapp2', authenticationName='mpapp2', password='mpapp2981', domain='78.46.74.84', outboundProxy='78.46.74.84', port=5060, visibleName='mpapp2', regRequired=true, applicationName='null', swfUrl='null', qValue='null', pAssociatedUri='null', contactParams='null', authDate=Wed Jul 23 01:55:55 CEST 2025, authToken='fa754ed0-3a43-418b-bf08-40e35d8eea2e', logsFolderName='null', clientVersion='2.0', clientOSVersion='5.0 (Windows)', clientBrowserVersion='Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:140.0) Gecko/20100101 Firefox/140.0', wsTunnelPacketization2='false', custom='{origin=https://marcophonoai.de:8888}'}
01:55:55,800 ERROR      WSServerHandler - WSS-pool-29-thread-5 class com.flashphoner.server.client.MainWCSClient cannot be cast to class com.flashphoner.server.client.MediaWCSClient (com.flashphoner.server.client.MainWCSClient and com.flashphoner.server.client.MediaWCSClient are in unnamed module of loader 'app')
java.lang.ClassCastException: class com.flashphoner.server.client.MainWCSClient cannot be cast to class com.flashphoner.server.client.MediaWCSClient (com.flashphoner.server.client.MainWCSClient and com.flashphoner.server.client.MediaWCSClient are in unnamed module of loader 'app')
        at com.flashphoner.server.client.handler.HandlerUtils.getStream(Unknown Source)
        at com.flashphoner.server.client.handler.HandlerUtils.setStreamParameters(Unknown Source)
        at com.flashphoner.server.client.handler.HandlerUtils.processRequest(Unknown Source)
        at com.flashphoner.server.ws.B.A(Unknown Source)
        at com.flashphoner.server.ws.B.C(Unknown Source)
        at com.flashphoner.server.ws.B.A(Unknown Source)
        at com.flashphoner.server.ws.B.messageReceived(Unknown Source)
        at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:76)
        at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:563)
        at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
        at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)
        at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:423)
        at org.jboss.netty.handler.codec.replay.ReplayingDecoder.callDecode(ReplayingDecoder.java:546)
        at org.jboss.netty.handler.codec.replay.ReplayingDecoder.messageReceived(ReplayingDecoder.java:445)
        at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:76)
        at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:563)
        at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
        at org.jboss.netty.handler.timeout.ReadTimeoutHandler.messageReceived(ReadTimeoutHandler.java:184)
        at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:76)
        at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:563)
        at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
        at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)
        at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:423)
        at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:404)
        at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:276)
        at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:76)
        at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:563)
        at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:558)
        at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
        at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
        at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:91)
        at org.jboss.netty.channel.socket.nio.AbstractNioWorker.processSelectedKeys(AbstractNioWorker.java:373)
        at org.jboss.netty.channel.socket.nio.DeadlockAwareNioWorker.run(Unknown Source)
        at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:102)
        at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:833)
01:55:56,256 DEBUG          sipMessages - Flashphoner-SipStack-Timer
 

Max

Administrator
Staff member
Good day.
Please make sure you've done a clean WCS installation, not directly update from 5.0 or earlier versions.
Also please make sure you do not unpack an installation archive directly to /usr/local folder.
If this recommendations do not help, please provide SSH access to the server using this form.
 

Max

Administrator
Staff member
We checked the server. There are the following problems in configuration:
1. Non-critical: there are no such parameters anymore in flashphoner.properties like
Code:
sip_enabled=true
rtp_force_synchronization=true
Please remove them
2. Critical: seems like your SIP PBX does not respond to REGISTER query: WCS tries to send the query for 5 times then gives up with REGISTER timeout message. Please check the SIP PBX configuration
3. Show stopper: your REST hook handler script sends 200 OK with empty body in response to all the hooks except /connect:
1753260686895.png

Then, WCS fails to parse the empty response and throws ClassCastException
The PHP script should look like this ti fix the issue
Code:
<?php
$api_method = array_pop(explode("/", $_SERVER['REQUEST_URI']));
$incoming_data = json_decode(file_get_contents('php://input'), true);
$domain1 = ...;    
$domain2 = ...;
$domain3 = ...;
$domain4 = ...;

...
switch($api_method) {
    
    case "call":
    ...

    case "connect": 
         $origin = $incoming_data['origin'];
         $found1 = strpos($origin, $domain1);
         $found2 = strpos($origin, $domain2);
         $found3 = strpos($origin, $domain3);
         $found4 = strpos($origin, $domain4); 
 
    if ($found1 !== false || $found2 !== false || $found3 !== false || $found4 !== false){

       $rest_client_config = json_decode(file_get_contents('rest_client_config.json'), true); 
        $incoming_data['restClientConfig'] = $rest_client_config;
        $incoming_data['sipLogin'] = "...";
        $incoming_data['sipAuthenticationName'] = "...";
        $incoming_data['sipPassword'] = "...";
        $incoming_data['sipDomain'] = "...";
        $incoming_data['sipOutboundProxy'] = "...";
        $incoming_data['sipPort'] = "5060";

    } else {
        ubnormalResponse(403);
     }            

}
header('Content-Type: application/json');
echo json_encode($incoming_data);        

function ubnormalResponse($code) {
    if ($code == 403) {
        header('HTTP/1.1 403 Forbidden', true, $code);
    } else {
        header(':', true, $code);
    }
    die();
}

?>
 

marcw

Member
Thank you very much for the fast reply!! I will check this out later today. I am just wondering a bit why this is happening here because that are the same settings which work on my other server (aside from other ip address).
 

Max

Administrator
Staff member
Perhaps a newer WCS builds requires non-empty REST hook response, but older builds may be not so strict.
 
Top