Picture of Nedret
Registered 5 years 68 days
Nedret Wednesday, 1 April 2020, 12:45 PM
Integration innovaphone into a webapp
How can we integrate innovaphone into our webapp without calling a native app? Is there a javascript / SDK / and sample code for this?
We would like to use phone and video calls.

Many thanks in advance!

Nedret Akcaoglu (BEWATEC)
Picture of Matthias Schertler (innovaphone)
Moderator Registered 12 years 193 days
Matthias Schertler (innovaphone) Wednesday, 1 April 2020, 07:40 PM
Re: Integration innovaphone into a webapp
Hi,

for doing WebRTC phone calls from a web application using the PBX I would recommend to use the following APIs:
  • innovaphone PbxSignal API for establishing a registration on the PBX
    • http://sdk.innovaphone.com/doc/appwebsocket/PbxSignal.htm
  • Call signaling using JSON messages on the established registration
    • http://sdk.innovaphone.com/doc/appwebsocket/Signal.htm
  • Accessing the microphone and webcam from the browser
    • https://www.w3.org/TR/mediacapture-streams/
  • Audio/Video streams using WebRTC
    • https://www.w3.org/TR/webrtc/
Sorry, we don't have example code for that flow in our SDK documentation yet. But as a starting point I attached some example how to use PBX Signal API to do the registration and the code of our softphone app (no secret, as everyone can see it in the browser console anyway).

pbxsignal-test.zip
  • Preparations on the PBX
    • Create an app object called "testapp" with password "pwd" and check "PbxSignal" to give permission for that API.
    • Create a user object "testuser" with a device "testuser" with licenses "Phone" and "Softphone" or enable test mode on the PBX.
  • The test.html connects to the app object using websocket and creates a registration for the testuser. Message flow:
    • {"api":"PbxSignal","mt":"Register","hw":"testuser"}
    • {"mt":"RegisterResult","api":"PbxSignal","addr":"192.168.0.125"}
  • After that calls can be made on the registration, which I didn't show in the example.

phoneapps.zip
  • For using WebRTC together with our APIs you need to convert between SDP from WebRTC and our channels structure. The softphone code contains functions to do that in phone_sdp.js.

Hoping this is helpful for starting.

BR
Matthias

phoneapp.zip
Picture of Matthias Schertler (innovaphone)
Moderator Registered 12 years 193 days
Matthias Schertler (innovaphone) Wednesday, 1 April 2020, 07:40 PM
Re: Integration innovaphone into a webapp
Here is the other ZIP. pbxsignal-test.zip
← You can define your color theme preference here