Does WCS3 support latest chrome/firefox browser

Kamran

New Member
Hi All

We have an application built with Flashphoner WCS3(FlashphonerWebCallServer-3.0.1721) + Asterisk.. Call signalling work prefect but there is no audio after answer call.

I also test with WCS demo client(WCS-client-3.0.519) Phone.html, PhoneJS.html, and Click2callJS.html with latest Chrome(84)/Firefox(78) browser . here is result.

Phone.html which is flash based signalling and audio working fine.
PhoneJS.html signalling was fine but no audio
Click2callJS.html was fine but no audio..

Then i downgrade my chrome browser to version 53... All demo application and our application was working fine...
It seem WCS3 is not working fine with latest browser...

Any working patch or idea that WCS 3 audio start working with Latest browser.....
Waiting for kind response...

Regards
Kamran
WebcallGlobal
 

Max

Administrator
Staff member
Good day.
The problem is TLS 1.0 support is dropped in most of latest browser builds. WCS 3 supports only DTLS 1.0 for WebRTC connections, so it will not work with latest browser builds any more.
We recommend you to upgrade to WCS 5.2/ this is the only possible way to communicate perfectly with latest modern browsers.
 

Kamran

New Member
Thanks Max for your reply......

Is there any way for WCS3 to support DTLS......?
How we can upgrade from WCS3 to WCS5.?
Our application code is specific to WCS3.. do we also have to change our application code to support WCS 5.2?

Waiting for kind response
 

Max

Administrator
Staff member
Is there any way for WCS3 to support DTLS......?
No way, we do not support this version any more
How we can upgrade from WCS3 to WCS5.?
The best way is to download and install WCS5.2 from scratch, requesting a new trial license (which can be expanded to 180 days for development by request), then test it for your use case.
Our application code is specific to WCS3.. do we also have to change our application code to support WCS 5.2?
Yes, you have to rework your application code. The actual documentation links are collected on this page.
 

Kamran

New Member
So our existing WCS3 license useless now...can not we utilize this license....

To start porting application to wcs5 We did installation of WCS5.2 version FlashphonerWebCallServer-5.2.695...
and start testing with sip phone UI with our asterisk...
Call connection between browser WCS and asterisk was fine.. but there was no audio...

We test with https://demo.flashphoner.com:8444/admin/demo.html# with our asterisk by phone ui app.. both signalling and media was fine...

Attach log of flashphoner server log....

here is flashphoner.properties config
####################
client_mode=false
codecs=opus,alaw,ulaw,g729,speex16,g722,mpeg4-generic,telephone-event,h264,vp8,flv,mpv
codecs_exclude_sip=mpeg4-generic,flv,mpv
codecs_exclude_sip_rtmp=opus,g729,g722,mpeg4-generic,vp8,mpv
codecs_exclude_streaming=flv,telephone-event
ip=
ip_local=
media_port_from=31001
media_port_to=32000
rtc_ice_add_local_component=true
ws.port=8080
wss.port=8443
#################################
Please help to resolve this audio issue
 

Attachments

Max

Administrator
Staff member
So our existing WCS3 license useless now...can not we utilize this license....
Technical support and update perion is over for old version license. New monthly subscription or standalone licenses do not cover SIP funsctions by default, so we recommend to use trial license to test, then ask sales@flashphoner.com about production license.
To start porting application to wcs5 We did installation of WCS5.2 version FlashphonerWebCallServer-5.2.695...
and start testing with sip phone UI with our asterisk...
Call connection between browser WCS and asterisk was fine.. but there was no audio...
Please check the browser you use for test. For example, Firefox has a bug which affects audio only streams (and calls too), Mozilla claims the fix will be available in FF 80. So please use Chrome in tests.
If the problem persists, and cannot be reproduced with demo server, please provide us SSH access to the server and SIP account details using this link, we will check.
 

Kamran

New Member
I further attach sip call log of failed audio called...
After successful call there is no audio between both parties.. and after 15 seconds call disconnect with reason
"Reason: SIP;cause=200;text="Failed by ICE error"
Detailed Call log is attached
 

Attachments

Max

Administrator
Staff member
We checked your server.
The instance seems to be in Google Cloud, but the standard GCP metadata endpoint http://metadata.google.internal does not work properly, so WCS cannot detect IP address.
So you should do the following:
1. Manually set ip and ip_local parameters in flashphoner.properties file to server IP address (we hide your real IP address here)
Code:
ip=**.***.***.** 
ip_local=**.***.***.**
2. Add the following special parameter to flashphoner.properties file
Code:
hold_ip_settings=true
Then, restart WCS
In this case, SIP calls (and WebRTC publishing/playback too) will work, we tested it.
 

Kamran

New Member
Thanks for your help and its work....

Now we need to port our existing WCS3 application to WCS5 application.. Currently we are using clicktocall application of WCS3....
Can we use WCS3 click to call Client application with WCS5 server...?.

In our existing application we are getting account and callee detail dynamically from auto_login_url and get_callee_url e.g
auto_login_url = https://X.X.X.X/account.php
get_callee_url = https://X.X.X.X/callee.php

But In WCS5 we have to store account information in apps/click-to-call/accounts.xml... after addition of every account we need to restart webcallserver..

Is there any possibility we use WCS3 client application with WCS5 server... or how we can use same WCS3 click to call client setting using auto_login and get_calle_url in WCS5...

Wating for kind response..
Thank you
 

Max

Administrator
Staff member
In WCS5 auto_login_url and get_callee_url are replaced by REST Hooks
Please check REST Hooks docs

To implement auto_login_url you have to configure hook /connect
You have to reply 200 OK with valid SIP credentials upon this hook

To implement get_callee_url you have to configure hook /call
You have to reply 200 OK with valid callee parameter upon this hook

Here you can find example how REST Hooks can be used for domain based authentication
 

Kamran

New Member
Thanks for reply

Actually our application is based on WCS-client-3.0.519 and demo Click2callJS.html..
We want to avoid extra development with new api development and want to use our old code
With WCS3 Server demo Click2callJS.html work fine but have audio problem....
With WCS5 Server demo Click2callJS.html got following error...
1598366946033.png


Is there any work around either we make functional this demo either WCS3 or WCS5 server....We have both server installed but above demo not work in both server...
Please help to make this demo working...

Thanks
 

Max

Administrator
Staff member
As we mentioned above, WCS3 supports only DTLS 1.0, which is not supported anymore in modern browsers.
Therefore, WebRTC traffic is not transmitted between the browser and the WCS server, and there is no sound in SIP calls using WCS3 API.
WCS5 supports DTLS 1.2, but API is significally changed. So, you cannot do without correcting your code.

All confidential information (data for connecting to the SIP server and the number for the call) was hidden in REST-hooks.

Step-by-step manual how to implement it:
Step1. Install and configure Nginx and PHP.
Then, in the nginx.conf file in the "server" section, add the following lines
Code:
location / {
    try_files $uri $uri/ /index.php?$request_uri;
    }
1598546752758.png

Step 2
. In the directory for the site (I have /var/www) create a file "index.php", in this file place the following code
Code:
<?php

$api_method = array_pop(explode("/", $_SERVER['REQUEST_URI']));
$incoming_data = json_decode(file_get_contents('php://input'), true);
switch($api_method) {
    case"connect":
    $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'] = "####";
    break;
    case "call":
    // Callee Number
    $incoming_data['callee'] = "########";
    break;
}
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();
}
?>
1598546781890.png


Step 3
. In the same directory /var/www create a file "rest_client_config.json". The source code can be found at the end of this page https://docs.flashphoner.com/display/WCS52EN/Using+REST+hook+to+authorize+user+by+domain.
In the "rest_client_config.json" file, edit the "call" section like this:
Code:
"call" : {
    "clientExclude" : "",
    "restExclude" : "",
    "restOnError" : "LOG",
    "restPolicy" : "OVERWRITE",
    "restOverwrite" : "callee"
  },
1598546867628.png


Step 4
. Then, go to the WCS server.
Using the "curl" command, check the availability of the REST Hook script for the events /connect and /call
Code:
curl http://172.16.30.123/connect
curl http://172.16.30.123/call
replace "172.16.30.123" with the IP address or domain name of your backend webserver
Curl If the command output contains the necessary information are parameters for the SIP connection and the local phone number, so we set up properly REST Hook.
1598546961397.png


Step5. Go to CLI WCS server
Code:
ssh -p 2001 admin@localhost
default password: admin
and change the default Rest Hook handling application to our new script
Code:
update app -l http://172.16.30.123/ defaultApp
replace "172.16.30.123" with the IP address or domain name of your backend webserver
1598547021901.png


Step 6
. After all these settings, we create two empty files click-to-call-min.html and click-to-call-min.js on the front-end web server. These files will contain the minimum code to implement the "Click to call" button
HTML code:
Code:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <script type="text/javascript" src="../../../../flashphoner.js"></script>
     <script type="text/javascript" src="click-to-call-min.js"></script>

</head>
<body onload="init_page()">
    <input type="button" id="callBtn" type="button" Value="Call"/>
     <div id="remoteAudio"></div>
    <div id="localAudio"></div>
</body>
</html>
JS code:
Code:
var SESSION_STATUS = Flashphoner.constants.SESSION_STATUS;
var CALL_STATUS = Flashphoner.constants.CALL_STATUS;
var localAudio;
var remoteAudio;


function init_page(){
     Flashphoner.init({});
     localAudio = document.getElementById("localAudio");
    remoteAudio = document.getElementById("remoteAudio");
    connect();
}

function connect() {
     var url = "wss://172.16.30.124:8443"
    var registerRequired = true;
    var sipOptions = {
        registerRequired: registerRequired
    };
    var connectionOptions = {
        urlServer: url,
        sipOptions: sipOptions
    };
    console.log("Create new session with url " + url);
    Flashphoner.createSession(connectionOptions).on(SESSION_STATUS.ESTABLISHED, function (session) {
        console.log(SESSION_STATUS.ESTABLISHED);
    }).on(SESSION_STATUS.REGISTERED, function (session) {
        console.log(SESSION_STATUS.REGISTERED);
    });
     callBtn.onclick = call
}
   
   
function call(session) {
     var constraints = {
        audio: true,
        video: false
    };
     var session = Flashphoner.getSessions()[0];
    var outCall = session.createCall({
        remoteVideoDisplay: remoteAudio,
        localVideoDisplay: localAudio,
        constraints: constraints,
        stripCodecs: "SILK"
     });
    outCall.call();
     callBtn.value = "Hangup";
     callBtn.onclick = function () {
          callBtn.value = "Call";
          outCall.hangup();
     connect();
     }
}
Step 7. Open the created HTML page and check the work:
1598547487872.png


Examples of files in the attached archive.
 

Attachments

Kamran

New Member
Hi Thanks For you guidance..
We did same config as you describe...
Click 2 call working by getting account from index.php and callee set in index.php as intended..

Call goes to callee as define in index.php...

There is one other problem happen in /client2/examples/demo/sip/phone-ui/Phone.html and other app use defaultApp.

When we try to register a phone with number in phone with any number it always register with account define in index.php....
e..g account set in index.php is 1001

1599125241823.png


we try to register with phone with 1000 in Phone.html

1599125136921.png


but it login with 1001 what is set in index.php... it does for every number.
1599125159734.png



It may be because of this settings...
update app -l https://domain/ defaultApp..

Is there any way we avoid this use defaulApp in as already use. and use other app for our click to call...


Thanks
 

Kamran

New Member
Hi
I change this
update app -l https://domain/ clickToCallApp
in
ssh -p 2001 admin@localhost

and in click-to-call-min.js
var connectionOptions = {
urlServer: url,
appKey:'clickToCallApp',
sipOptions: sipOptions
};
fix the issue.
 
Top