Picture of Rico 1837
Registered 10 years 245 days
Rico 1837 Thursday, 1 July 2021, 09:31 AM
Agenda SDK Dialog: How can a JS SDK app integrate with the phone app
How can a JS SDK app integrate with the phone app to show a widget below/next to the call panel for calls. (yellow area) Untitled.png

Picture of Thomas Ackermann (innovaphone)
Moderator Registered 12 years 131 days
Thomas Ackermann (innovaphone) Thursday, 1 July 2021, 01:19 PM
1 of 1 users consider this post helpful
Re: Agenda SDK Dialog: How can a JS SDK app integrate with the phone app
Hi Rico,
the recommended way for such an integration is the "Phone-API" (com.innovaphone.phone).
You find complete documentatin here.
Your app will be the consumer of Phone-API.
Your app will be notified about any call activity.
Your app can use the "CallInfo" message to place additional information into the Phone-App (or Softphone-App) UI.
As you can see in the documentation, you can choose between simple piece of HTML code or an URL (will loaded into iframe).

Best regards
Thomas
Picture of Thomas Ackermann (innovaphone)
Moderator Registered 12 years 131 days
Thomas Ackermann (innovaphone) Friday, 2 July 2021, 12:21 PM in response to Rico 1837
Re: Agenda SDK Dialog: How can a JS SDK app integrate with the phone app
Here is a small example how to use the phone-API:
function onPhoneApiUpdate (arg0) {
const provider = arg0.providers[0]
const calls = arg0.model[provider].model.calls;
calls.forEach(function(call) {
console.log("DEBUG " + JSON.stringify(call));
});
}

phoneApi = start.consumeApi("com.innovaphone.phone");
if (phoneApi) {
phoneApi.onupdate.attach(onPhoneApiUpdate);
}
You attach a callback function to the onupdate event of the phone-API.
Your callback function "onPhoneApiUpdate" gets called every time a new call comes or goes and everytime the call state changes.
All the call's details like call-state or remote party information you find in the argument of "onPhoneApiUpdate".
Here is an example of an incoming call:
DEBUG {"id":-1,"guid":"90b2234ae7de600174b90090333e234b","dir":"i","num":"202","sip":"atlantis","dn":"Atlantis","state":"Alerting"}
DEBUG {"id":-1,"guid":"90b2234ae7de600174b90090333e234b","dir":"i","num":"202","sip":"atlantis","dn":"Atlantis","state":"Connected"}
DEBUG {"id":-1,"guid":"90b2234ae7de600174b90090333e234b","dir":"i","num":"202","sip":"atlantis","dn":"Atlantis","state":"Holding"}
DEBUG {"id":-1,"guid":"90b2234ae7de600174b90090333e234b","dir":"i","num":"202","sip":"atlantis","dn":"Atlantis","state":"Connected"}
DEBUG {"id":-1,"guid":"90b2234ae7de600174b90090333e234b","dir":"i","num":"202","sip":"atlantis","dn":"Atlantis","state":"Released"}
If the call is release by remote party, Softphone-App will hold the call 2 more seconds and plays a disconnect tone. After these 2 seconds the Softphone-App goes automatically onhoonk and the call is deleted from UI.

/Thomas
Picture of Thomas Ackermann (innovaphone)
Moderator Registered 12 years 131 days
Thomas Ackermann (innovaphone) Friday, 2 July 2021, 12:30 PM in response to Rico 1837
1 of 1 users consider this post helpful
Re: Agenda SDK Dialog: How can a JS SDK app integrate with the phone app
And this is how you place your call-related information into the UI of the Phone-App (or Softphone-App):
function onPhoneApiUpdate (arg0) {
const provider = arg0.providers[0]
const calls = arg0.model[provider].model.calls;
calls.forEach(function(call) {
if (call.state == "Alerting" || call.state == "Ringback" || call.state == "Connected") {
phoneApi.send({mt: "CallInfo", id: call.id, html: "<div>This is my call info</div>"});
}
});
}

Picture of Rico 1837
Registered 10 years 245 days
Rico 1837 Wednesday, 9 February 2022, 10:47 AM in response to Rico 1837
Re: Agenda SDK Dialog: How can a JS SDK app integrate with the phone app
Lars: Johannes: "Plugin System to integrate custom elements into the phoneapp will not be possible"
Picture of Thomas Ackermann (innovaphone)
Moderator Registered 12 years 131 days
Thomas Ackermann (innovaphone) Wednesday, 9 February 2022, 11:20 AM
Re: Agenda SDK Dialog: How can a JS SDK app integrate with the phone app
Does it not work or is it still unclear how to implement?
I just tested the Phone-API and found it working.
My test-code:
// test-code
function onPhoneApiUpdate (arg0) {
const provider = arg0.providers[0]
const calls = arg0.model[provider].model.calls;
if (calls) calls.forEach(function(call) {
if (call.state == "Alerting" || call.state == "Ringback" || call.state == "Connected") {
phoneApi.send({mt: "CallInfo", id: call.id, html: "<div style='background:yellow;color:blue;font-size:20px'>This is my big yellow call info</div>"});
}
});
}
const phoneApi = start.consumeApi("com.innovaphone.phone");
if (phoneApi) {
phoneApi.onupdate.attach(onPhoneApiUpdate);
}
And the result:
Bildschirmfoto_am_2022-02-09_um_11.15.56.png

/Thomas
Picture of Rico 1837
Registered 10 years 245 days
Rico 1837 Wednesday, 9 February 2022, 01:14 PM
Re: Agenda SDK Dialog: How can a JS SDK app integrate with the phone app
can you upload your demo app instead of a snipped?
Andreas Fink
Moderator Registered 13 years 52 days
Andreas Fink (innovaphone) Wednesday, 9 February 2022, 02:16 PM
1 of 1 users consider this post helpful
Re: Agenda SDK Dialog: How can a JS SDK app integrate with the phone app
Hello Rico,

I have created a new innovaphone JS App project in Visual Studio and added code snippets to the attached innovaphone-phoneapiaxample.js file.

The app must be started in the myApps client at the moment, when phone app starts a call.

Best Regards
Andreas Fink

innovaphone-phoneapiexample.js
Picture of Rico 1837
Registered 10 years 245 days
Rico 1837 Wednesday, 9 February 2022, 03:10 PM
Re: Agenda SDK Dialog: How can a JS SDK app integrate with the phone app
please have a look at the comments in the file

(can upload a js file directly)
innovaphone-phoneapiexample-v2.js.txt.tar.gz
Picture of Daniel 450
Registered 14 years 174 days
Daniel 450 Wednesday, 4 May 2022, 07:21 PM in response to Thomas Ackermann (innovaphone)
Re: Agenda SDK Dialog: How can a JS SDK app integrate with the phone app
Hello Thomas,

i see the contacts app icon on the left side of our screenshot. So i think your screenshot is made with V13r3 or above, because in V13r2 i didn´t know/see that icon.
I tryed the V13r3 alpha today and was scared. Because to see your screen, like in V13r2, i had to do some usability strange clicks to got that screen. Your showed and known screen from V13r2 is not shown by default in V13r3. But when i use the new second different "ausdock" button, then the known and showed Screen will be shown by default on each next call.
Two different "ausdock" buttons are in my opinion not very userfriendly in the usability.

Which default screen ui is planed for the softphone in final V13r3, that what we could try/see with the actual alpha version V13r3 or that what we see in your screenshot and know today from actual V13r2? I hope that one what the user knows from V13r2 today.

We plan to programm an app for which it and also for the user it will be very helpful if the future screen will be by default your shown one and the know one of v13r2. And the user has not first to do the strange click workaround what i had done. So i hope you can answer me wich default ui plan for V13r3 for the softphone.
Picture of Thomas Ackermann (innovaphone)
Moderator Registered 12 years 131 days
Thomas Ackermann (innovaphone) Thursday, 5 May 2022, 12:44 PM
Re: Agenda SDK Dialog: How can a JS SDK app integrate with the phone app
Hi Daniel,
we have that on our list for the 13r3 UI rework.
The call related information needs to be moved into the new "media-panel".
Does not make sense to keep it in the "call-panel" (where it is in 13r2).
Because the "call-panel" is out-of-sight in 13r3 as you discovered.

/Thomas
Picture of Daniel 450
Registered 14 years 174 days
Daniel 450 Friday, 6 May 2022, 04:39 PM
Re: Agenda SDK Dialog: How can a JS SDK app integrate with the phone app
Hello Thomas,

thank you for these informations. I hope it would be safe, that the functionality will not be dropped. It would be greate if you could inform us, when the new final UI could be checked with the alpha software.
Picture of Daniel 450
Registered 14 years 174 days
Daniel 450 Tuesday, 7 June 2022, 09:34 PM in response to Thomas Ackermann (innovaphone)
Re: Agenda SDK Dialog: How can a JS SDK app integrate with the phone app
Hello Thomas,

we tried this and it works fine. But today i thought what happens if a user has more then one phone app. For example a softphone and parallel a phone app for a hardphone. Then i could notice that only one app shows the information. The App which is the default phone app. That would be ok, but when i changed the default phone app in the client of the user, then both phone apps didn´t show any information. Also a restart of the myApps Windows Client and a deleting of its cach when myApps Client is closed doesn´t solve it.

So if i want to change the App i have to delete/deregister one of the phone apps and then the other phone app will work.

What do we wrong or could solve this problem?
Picture of Daniel 450
Registered 14 years 174 days
Daniel 450 Monday, 13 June 2022, 08:55 AM
1 of 1 users consider this post helpful
Re: Agenda SDK Dialog: How can a JS SDK app integrate with the phone app
Hello,

we realise what we have to do, so no answer is needed anymore.
Picture of Daniel 450
Registered 14 years 174 days
Daniel 450 Tuesday, 14 June 2022, 09:46 AM
Re: Agenda SDK Dialog: How can a JS SDK app integrate with the phone app
Hello,

we know what we have to do. But our tests show us, that if a user has more then one phone app, only the default app will show the infos. And if no default phone app is configured in the client, then the user get a list of the available phone apps and has to decide, before a call interaction is possible.

What can we do, that the user has not to decide with which phone app he/she/it want to see the infos. So that the user will see the infos in "all" phone apps, especially in the phone app which the user has then opened.
Picture of Thomas Ackermann (innovaphone)
Moderator Registered 12 years 131 days
Thomas Ackermann (innovaphone) Tuesday, 14 June 2022, 10:16 AM
Re: Agenda SDK Dialog: How can a JS SDK app integrate with the phone app
Do you monitor call activity?
And do you show information which is call-related?
In this case your information should be displayed on this specific phone app where you got the call-information from.

Example:
Phone-App-One tells you that there is a call with remote party "abc". You gather information about remote party "abc" and you want to display that information in Phone-App-One only, because there is the call.

When you send the "CallInfo" message DO NOT send it to "*".
Send it to that API provider where you got the call information from.

/Thomas
← You can define your color theme preference here