Picture of MarioG
Registered 5 years 129 days
MarioG Friday, 19 March 2021, 03:09 PM
Custom softphone - how to start
Hello,

we have some requirements from a customer, which would probably need a customized Softphone App.
On the SDK page I couldn't easily see, which APIs are required for that task.

Is the default Softphone app based on a C++ part in the background or does it just require the JS part, which I could use eventually as a start base?

Regards
Mario
Picture of Daniel Deterding (innovaphone)
Moderator Registered 15 years 121 days
Daniel Deterding (innovaphone) Monday, 22 March 2021, 06:29 AM
Re: Custom softphone - how to start
Hi Mario,

the default softphone app is a pure javascript client app which just uses APIs on the javascript side which can be used by any app.

There a tutorial which touches these APIs:
http://sdk.innovaphone.com/doc/tutorials/ClientAPIs.htm

Greetings,
Daniel
Picture of MarioG
Registered 5 years 129 days
MarioG Monday, 22 March 2021, 08:11 AM
Re: Custom softphone - how to start
Hi Daniel,

thank you. That will probably easen that task for improving the soft phone.
May be a good start for further developements... wink

Greetings,
Mario
Picture of MarioG
Registered 5 years 129 days
MarioG Sunday, 9 May 2021, 03:13 PM in response to Daniel Deterding (innovaphone)
Re: Custom softphone - how to start
So, I got a lot of progress, but now I'm stuck with registering my app.
If I compare the registration to the original softphone app, the PBX provides me the HW ID for the softphone of the user.
I don't get any, because I don't have any device registered for my app.

I also can not register a softphone with my app.
It seems like, there is something missing in the PBX and/or in the underlying C++ code.
I just don't see it.

Can someone give me a hint? wink

Regards Mario
Picture of Daniel Deterding (innovaphone)
Moderator Registered 15 years 121 days
Daniel Deterding (innovaphone) Wednesday, 12 May 2021, 08:16 AM
1 of 1 users consider this post helpful
Re: Custom softphone - how to start
Hi Mario,

I'm not an expert here, but you must provide the com.innovaphone.phone API yourself in your App on the C++ side and every user must add a softphone inside the profile app.

This API is described here:
http://sdk.innovaphone.com/web1/com.innovaphone.phone/com.innovaphone.phone.htm

Therefor you must modify your AppInfoResult message which you send inside your C++ code and therefore must implement the function AppWebsocketAppInfo, see:
http://sdk.innovaphone.com/common/lib/appwebsocket.htm#ExampleAppInfo

It may look like this afterwards, although you must modify the class name and app name of course:

void PhoneAppSession::AppWebsocketAppInfo(const char * app, class json_io & msg, word base)
{
 if (strcmp(app, "manufacturer-phone") == 0) {
  word apis = msg.add_object(base, "apis");
 word phone = msg.add_object(apis, "com.innovaphone.phone");
   word info = msg.add_object(phone, "info");
   msg.add_string(info, "type", "softphone");
   word wake = msg.add_array(base, "wake");
   msg.add_string(wake, nullptr, "softphone");
  }
}

The resulting answer then looks like this:
{
  "mt": "AppInfoResult",
 "info": {
   "apis": {
    "com.innovaphone.phone": {
     "info": {
      "type": "softphone"
     }
    }
   },
   "wake": ["softphone"]
  }
}

Greetings,
Daniel
Picture of MarioG
Registered 5 years 129 days
MarioG Wednesday, 12 May 2021, 08:45 AM
Re: Custom softphone - how to start
Ah super!
smile
Thank you. I'll check that.

Regards Mario
Picture of iqbal
Registered 5 years 221 days
iqbal Thursday, 17 June 2021, 04:14 PM in response to MarioG
Re: Custom softphone - how to start
Hi that solution worked for me.

void SoftPhoneSession::AppWebsocketAppInfo(const char * app, class json_io & msg, word base)
{
if (!strcmp(app, "custom-softphone"))
{
word apis = msg.add_object(base, "apis");
word phone = msg.add_object(apis, "com.innovaphone.phone");
word info = msg.add_object(phone, "info");
msg.add_string(info, "type", "softphone");
msg.add_object(apis, "com.innovaphone.notificationhandler");
msg.add_object(apis, "com.innovaphone.callkit");
word wake = msg.add_array(base, "wake");
msg.add_string(wake, nullptr, "phone");
msg.add_string(wake, nullptr, "softphone");
}
}

BR
Iqbal
Picture of MarioG
Registered 5 years 129 days
MarioG Thursday, 17 June 2021, 05:13 PM
Re: Custom softphone - how to start
Hi Iqbal,

thank you. I somehow got stuck there. Due to lack of time and lack of pressure from the customer evil, I pushed that back.

I'll try that ASAP.

Regards Mario
Picture of MarioG
Registered 5 years 129 days
MarioG Thursday, 17 June 2021, 07:36 PM
Re: Custom softphone - how to start
Hi,

I tried that. I think I have another problem there.
I don't get the softphone device assigned to my app. When I compare the opriginal Softphone and my (named it comsphone) the device will not be listed in the javascript output.
After startup of the app, when the js code starts registrering, I don't have the right device name in that process.

example:
open dev:SwPh_comtelo_60896147 url=...
vs
open comsphone url=...

What do I miss there?

Regards Mario
2013
Moderator Registered 16 years 15 days
Guntram Diehl (innovaphone) Friday, 18 June 2021, 01:59 PM
Re: Custom softphone - how to start
In the AppInfoResult message which is sent back from your App Service, there should be a deviceapp:"softphone" property.

See this thread. It is duscussing the same issue.
← You can define your color theme preference here