Picture of Sascha
Registered 5 years 338 days
Sascha Thursday, 1 July 2021, 01:46 PM
Agenda SDK Dialog: How to add new favorites group and rename them
Hello everyone,

I think I found a little error in the documentation.

1) The documentation is not correct on this part.
It is shown that we should send this json to the pbx

{
"api": "PbxApi",
"mt": "AddProfileContact",
"id": unsigned,
"name": string,
"contact": {
"dn": string,
"sip": string,
"num": string
}
}

But this is wrong there is the profile part missing. It should look like this:

{
"api": "PbxApi",
"mt": "AddProfileContact",
"profile": {
"id": unsigned,
"name": string,
"contact": {
"dn": string,
"sip": string,
"num": string
}
}
}

2) The documentation also states this:

"Adds a new favourite to the given profile. If the profile does not exist, it is created."

When I have tried this it won't work. I will also not get an reply from the pbx after I send this event.

How do I have to use the AddProfileContact so that it will generate a new profile?

Also is there a way to edit the names of profiles?
Andreas Fink
Moderator Registered 13 years 109 days
Andreas Fink (innovaphone) Friday, 2 July 2021, 08:01 AM
Re: Agenda SDK Dialog: How to add new favorites group and rename them
Hello Sascha,

assuming you use the API from an App Service on a WebSocket connection from an App Object, you have to use Impersonation API.

This way you can decide in which context the PbxApi should be used (since it is a user centric API for myApps client usage).

Here is an example:

send {"api":"PbxImpersonation","src":"impersonateafink","mt":"CreateApi","sip":"afink","target":"PbxApi"}

recive {"mt":"CreateApiResult","src":"impersonateafink","api":"PbxImpersonation","target":"PbxApi.5"}

send {"api":"PbxApi.5","mt":"AddProfileContact","id":1,"name":"myProfile","contact":{"dn":"Sebastian","sip":"sebastian"},"src":"impersonateafink"}

No AddProfileContactResult message should be expected.

A profile "myProfile" at the PBX user "afink" with contact "Sebastian" is created after this sequence.

Best Regads
Andreas Fink
2013
Moderator Registered 16 years 72 days
Guntram Diehl (innovaphone) Friday, 2 July 2021, 08:59 AM in response to Sascha
Re: Agenda SDK Dialog: How to add new favorites group and rename them
I looked it up in the source and found that you are right. We do look for the object "profile" and inside this for the other properties
Picture of Sascha
Registered 5 years 338 days
Sascha Friday, 2 July 2021, 10:33 AM in response to Sascha
Re: Agenda SDK Dialog: How to add new favorites group and rename them
Here is the request flow which I use for my app.

This is the example what happens when you add an contact to an existing profile.

The login I use here is an AppLogin without the app parameter so that I'am logged in as a user.
add_contact_to_existing_profile.png

Picture of Sascha
Registered 5 years 338 days
Sascha Friday, 2 July 2021, 10:42 AM
Re: Agenda SDK Dialog: How to add new favorites group and rename them
And here are the messages for the messages when I try to add a new porfile.

As you can see I get no response and even the ipva does not update anything for the user I'am using here
add_contact_to_new_profile.png

Picture of Sascha
Registered 5 years 338 days
Sascha Friday, 2 July 2021, 10:46 AM in response to Sascha
Re: Agenda SDK Dialog: How to add new favorites group and rename them
And here a screenshot from the ipva frontend. I have also checked the profile is not added to an other object.

It is an external app which is not in the myapps environment and it uses it's own websocket logik.
ipva_view_after_add.png

Andreas Fink
Moderator Registered 13 years 109 days
Andreas Fink (innovaphone) Friday, 2 July 2021, 12:51 PM
Re: Agenda SDK Dialog: How to add new favorites group and rename them
It looks like a new profile will be created only, if no profiles at all are existing at the user object.

The reason is, we do not yet make full use of profiles in our applications. Therefore, on WebSocket API we have also no implementation for complete profile management.

Is this a show stopper for your project at the moment?
Picture of Sascha
Registered 5 years 338 days
Sascha Friday, 2 July 2021, 01:12 PM
Re: Agenda SDK Dialog: How to add new favorites group and rename them
No this is not a show stopper. But it would be still nice to be able to add a new profile even if there are already some in existence.

We keep it for the moment with the creation of the profiles over the soap api and the users won't be allowed to rename the profiles for the moment.
Picture of Thomas Ackermann (innovaphone)
Moderator Registered 12 years 188 days
Thomas Ackermann (innovaphone) Friday, 9 July 2021, 11:00 AM in response to Sascha
Re: Agenda SDK Dialog: How to add new favorites group and rename them
Hi Sascha,
we added support for "AddProfile" and "DelProfile" and "UpdateProfile" for 13r2 SR1.
Dokumentation is also updated, but not on the web yet.
I guess it will be updated when SR1 is going to be released.
This is how to works:

sdk-profile-management

/Thomas
Picture of Sascha
Registered 5 years 338 days
Sascha Friday, 9 July 2021, 12:40 PM
Re: Agenda SDK Dialog: How to add new favorites group and rename them
Thank you for these informations. Will these events also send back a result event?
Picture of Thomas Ackermann (innovaphone)
Moderator Registered 12 years 188 days
Thomas Ackermann (innovaphone) Friday, 9 July 2021, 12:55 PM
Re: Agenda SDK Dialog: How to add new favorites group and rename them
There are no Result-events in return for these events.
Picture of Sascha
Registered 5 years 338 days
Sascha Friday, 9 July 2021, 03:01 PM
Re: Agenda SDK Dialog: How to add new favorites group and rename them
And what will happen if an error would occur?
← You can define your color theme preference here