Picture of Daniel 450
Registered 14 years 34 days
Daniel 450 Tuesday, 14 February 2023, 12:48 PM
PbxAdminApi App Licensing Sync Problem
Hello,

in the PBX there are under the pbx object licensing tab 3 apps listed:
- App(chat)
- App(innovaphone-switchboard)
- App(innovaphone-pbx-conferencing)

One user has all the three app checkboxes checked.
The chat and conferencing app are checked through the config template "config user" and the switchboard app is direct checked in the user object.

If we then do an "GetObject" the JSON of the "GetObjectResult" shows
"app-lics": "+innovaphone-switchboard"
If we then do an "UpdateObject" with the pbxAdminApi the user lost the chat and conferencing app. And a look at the pbx object licensing tab of that user shows that the checkboxes of the chat and conferencing apps are not checked anymore, but the switchboard is currently checked.

I guess that the sending of "app-lics": "+innovaphone-switchboard" back with the "UpdateObject" command will do that. But we thought if we got the whole JSON and send the whole JSON back (only changed something in grp) that there should nothing be changed in the licensing. Or understand or do we something wrong?

We did it with JS Service.
Picture of Daniel 450
Registered 14 years 34 days
Daniel 450 Friday, 24 February 2023, 07:31 PM
Re: PbxAdminApi App Licensing Sync Problem
Hello,

in addition to my first post.

we send
{
api: "PbxAdminApi",
mt: "GetObject",
src: "x",
guid: conn.guid
}

and get
{
"api": "PbxAdminApi",
"src": "x",
"mt": "GetObjectResult",
...
"app-lics": "+innovaphone-switchboard",
...
}

then we send back
{
"api": "PbxAdminApi",
"src": "",
"mt": "UpdateObject",
...
"app-lics": "+innovaphone-switchboard",
...
}

But that deletes/ uncheck all the App() lics in the pbx user object which are inherited from the user template and only the App() entry "App(innovaphone-switchboard)" which is checked direct in the user object is checked after the operation.
So it looks to me that the user lost all his App() lics which he get from the template with an UpdateObject command.
If we do the same with users that have only template lics and no direct lics checked in the App() lic entrys, then they didn´t lose their lics.

Here is the shortend code what we do with the GetObjectResult:
if(obj.mt == "GetObjectResult") {
...
obj.mt = "UpdateObject";
obj.src = "";
conn.send(JSON.stringify(obj));
}

Thats the actual situation.
It would be great if we must not send everything back to the pbxAdminApi, so that we could only send a changed group back and then we have no trouble with lics, because lics will not touched with the update.
But generelly sending only the relevant things back it would not solve the problem. Because if someone want to update explicit the App() lics then this one has the same problem we have now.
Picture of Daniel 450
Registered 14 years 34 days
Daniel 450 Tuesday, 14 March 2023, 08:16 PM
Re: PbxAdminApi App Licensing Sync Problem
Hello i read in the sdk, that there is an option "template" maybe thats the solution. But i hasn´t test it yet. If someone know thats not the solution i am happy to read it, to save my time.
Andreas Fink
Moderator Registered 12 years 277 days
Andreas Fink (innovaphone) Saturday, 18 March 2023, 11:48 AM
Re: PbxAdminApi App Licensing Sync Problem
Hello Daniel,

this is correct, the property "template" should be set to "without" in the "UpdateObject" message, to not affect template settings.

We will consider to make "template": "without" as default value, to prevent such cases.

Best Regards
Andreas Fink
← You can define your color theme preference here