Picture of dirk39
Registered 5 years 223 days
dirk39 Monday, 28 October 2019, 03:54 PM
External application login
Hello,
we are creating a server side application in Javascript that have to connect with Innovaphone (v13) via WebSocket in order to intercept events from Innovaphone.

We are trying to get work the example reported here (http://sdk.innovaphone.com/doc/tutorials/RCCfromExternalWebPage.htm) but we are facing some issues.
We are receiving the AppChallenge token from WebService correctly but, watching the code we notice that it tries to communicate with `/login` endpoint without a host.
We think that is due to the code expects to be executed inside the App server instead of my local pc (we are just executing it from our browser). Could you tell us which is the path to login correctly?

Thanks

P.S. we are trying also to follow this documentation (http://wiki.innovaphone.com/index.php?title=Howto:Talking_to_the_v13_Application_Platform_using_PHP) but the sample code at the end of the page is not available. Could you tell us where can we download it?
Picture of Sebastian Hayer-Lutz (innovaphone)
Moderator Registered 7 years 165 days
Sebastian Hayer-Lutz (innovaphone) Monday, 28 October 2019, 04:15 PM
Re: External application login
Hi Andrea,

this error seems to be the same that we have already discussed in Ticket 262364.

If you read the text below the JS example (in the SDK Documentation) we use the JS function "logon" after a successful Websocket connect to get an AUTH-token from an external Webservice.
We only use this way because the shared secret (Password in the AP-Object inside the PBX) should never exist in the JS because it is plain text in the end-user-environment in the most of cases.

So we will send the AUTH challenge to a separate Webserver, that is knowing the secret and can caluclate the correct logon token and send us the token back. (So the secret is never shared with the client - thats the goal)

You can check it in "Implement GET handler" (There we use a C++ App in our AP-Platform)

Anyway - You can create your own GET Handler (in your favorite programming language) or dont use it.

If you make a machine-to-machine connection (like old server side SOAP applications) you can use both methods:
1) Get a preculculated logon hash from the above solution
2) Store the password in your configuration/code directly

For a direct logon if you execute the code on the serverside you can check Line 39 in our Websocket Class:
function (url, app, password, domain, fonconnected, fonmessage, fonerror, fonclosed, fgetlogin)

There you can enter the data directly.

After a successfull authorization you can make an UserInitialize to the needed User and use your needed commands via Websocket.

Hope this helps. Otherwise please let me know


To access the code samples you need a password, correct.
I have send you the access data in our existing ticket for this case.
Please check it.

Best regards Basti
← You can define your color theme preference here