In fact Click-to-Call-min.js with changes described above is very similar to Phone-min.js that you can find in the same directory examples/min.
To secure SIP credentials you have to create REST application.
On server
ssh -p 2000 admin@localhost
>
password admin
>show apps
Code:
admin defaultApp defaultApp 1 http://localhost:9091/EchoApp
>add app click2call click2call
http://my-web-server/rest
Here
click2call - is appKey which should be used in
Code:
f.connect({urlServer: "ws://192.168.1.5:8080", appKey: "click2call"});
>add app-rest-methods -a click2call
This means your HTTP url returns correct JSON for all REST methods:
http://my-web-server/rest/connect,
http://my-web-server/rest/call, etc.
By default it can be 'echo' JSON returning the same data as received.
You can also add 'connect' method only:
>add app-rest-method connect click2call
When WCS receives connection with appKey "click2call" it will send REST/HTTP request to your web application:
http://my-web-server/rest/connect and your HTTP server should return 200 OK with response JSON body like this:
Code:
{
"sipRegisterRequired": true,
"sipLogin": "WCS1",
"sipAuthenticationName": "WCS1",
"sipDomain": "sip.org",
"sipOutboundProxy": "sip.org",
"sipPassword": "12345",
"sipPort": 5060
}
Thus these SIP credentials returned by server will be used for call.
Here you can find REST app example with PHP code:
http://flashphoner.com/downloads/REST_application_PHP_example.zip
You can customize it for testing.
Please read more documentation how to manage applications and REST methods.
http://flashphoner.com/docs/wcs4/wcs_docs/html/en/wcs-admin-guide/
Command Line Interface
and Call Flow
http://flashphoner.com/docs/wcs4/wcs_docs/html/en/wcs-call-flow/