Flashphoner.createSession auto login username and password

cheinan

Member
Hello
I am testing the trail Flashphoner media server and i can use it only when i am logged to the dashboard:
https://serverhost:8888/dashboard.xhtml
How can i configure the Flashphoner to be able to createSession with auto login,
without need to be logged to the dashboard?
Is it by: sipOptions or mediaOptions?
 

Max

Administrator
Staff member
Hello
You can see our default sample:
https://wcs5-eu.flashphoner.com/demo2/phone
As you can see, all authentication details are passed in connect method:
https://github.com/flashphoner/flas..._api-2.0/examples/demo/sip/phone/phone.js#L75
Code:
 Flashphoner.createSession(connectionOptions).on(SESSION_STATUS.ESTABLISHED, function(session){
        setStatus("#regStatus", SESSION_STATUS.ESTABLISHED);
        onConnected(session);
        if (!registerRequired) {
            disableOutgoing(false);
        }
    });
See connectionOptions parameter. It contains all authentication details.
 

cheinan

Member
i am using this code:
var sipOptions = {
login: theUserName,
authenticationName: theUserName,
password: thePassword,
registerRequired: false
};
var connectionOptions = {
urlServer: "wss://62.90.177.150:8443",
sipOptions: sipOptions
};
Flashphoner.createSession(connectionOptions).on(SESSION_STATUS.ESTABLISHED, function (session) {...

And still i can use it only when i am logged to the dashboard:
https://serverhost:8888/dashboard.xhtml
I am not able to createSession with auto login.
What do i miss?
Except what i am using, In your demo phone example you are using:
domain, outboundProxy and port witch i do not use.
do i have to use them? and if so what is the values i need to use for each?

Thanks
Cheinan
 

Max

Administrator
Staff member
Do you have a SIP account?

You need SIP details from third party provider or from a third party PBX server.
Generally SIP account includes:
- login
- authentication name
- password
- domain
- outbound proxy
- port (5060 by default)

Do you have such details?
If not, you need to get the details before testing.

Another question. Are you testing SIP calls or simple streaming?
Because if you test streaming, you don't need SIP details.

Please tell us more about your project.
 

Max

Administrator
Staff member
This is example of SIP details.
We have OpenSIPs server configured. And pool of SIP accounts: 10000, 10001, etc.
You should have your own SIP account.

example-of-sip-account.jpg
 

cheinan

Member
I am testing only simple streaming.
The flashphoner javascript files:
flashphoner.js, utils.js, and so on...
Is located in my web server. Not in my linux server where flashphoner is insulted
My be that whats make the problem?
 

Max

Administrator
Staff member
There are several steps:
1. Test default streaming example:
https://serverip:8888/demo2/two-way-streaming
Make sure it works for you.
2. Copy folder /usr/local/FlashphonerWebCallServer/client2 to your web hosting.
And test
https://your-web-hosting/client2/examples/demo/streaming/two_way_streaming/two_way_streaming.html
3. Create a custom web page based on two_way_streaming.html and two_way_streaming.js
And test your custom web page.

Eventually if you have a custom page, you can minimize code of this page and test again.
If you have any issues with code, you can share it with us. We will check.

Please ignore messages about SIP.
You don't need any SIP server if your project is streaming only.
 

cheinan

Member
I did all of that steps... its all working fine
I built a custom web page based on two_way_streaming.html and two_way_streaming.js:
https://www.cyber-net.co.il/testTwoWayMy.html
And a custom web page witch is only player:
https://www.cyber-net.co.il/testTwoWayMyIn.html
Both are working fine.
The problem is: from any computer or device i am trying to test those pages:
I can use it only when i am logged to the dashboard:
https://62.90.177.150:8888/login.xhtml
from that computer or device i am testing with.
I am not able to createSession with auto login.

Again:
The flashphoner javascript files:
flashphoner.js, utils.js, and so on...
Is located in my Windows web server. Witch is Not my linux server where flashphoner is insulted
My be that whats make the problem?

Thanks
Cheinan
 

Max

Administrator
Staff member
Please test this in Chrome browser.
Then share Developer Tools - Console output.
It seems you don't have SSL certificate on WCS server.
Your wss address should be:
Code:
wss://yourdomain.com:8443
And you have to import valid (green) SSL certificate using Dashboard / Security / Certificates
Once your import is complete, you will be able to open dashboard by https://yourdomain.com:8888 and test from any destination.
You can use free certificates from Let's encrypt.
Similar threads:
https://forum.flashphoner.com/threads/installation-ssl-certificate-on-flashphoner.11022/#post-13390
 

cheinan

Member
I do not have SSL certificate on my WCS server
I will try Let's encrypt with my domain from my linux WCS server
Thanks
 
Top