Picture of Niko 1071
Registered 11 years 359 days
Niko 1071 Friday, 26 March 2021, 02:30 PM
AddProfileContact
Hello,

we have a self-developed app which also has favorites. Unfortunately the favorites are all stored in the PBX under the profile of the app object and not the single user.


Example:

{"api":"PbxApi","mt":"AddProfileContact","profile":{"id":1,"contact":{"dn":null,"num":"06925899988","sip":null}}}

{"api":"PbxApi","mt":"ProfileContactAdded","profile":{"id":1,"contact":{"id":3,"num":"06925899988","presence":false,"dialog":false}}}


What else can and must we pass so that the favorites are stored and read by the user who uses the app ? The code for the read/write favorites is from the original innovaphone softphone app.

Thanks in advance for the support

Best Regards
Niko







Picture of Niko 1071
Registered 11 years 359 days
Niko 1071 Monday, 12 April 2021, 03:29 PM
Re: AddProfileContact
Hi,

any ideas or tips ?

Best Regards
Niko

Picture of Thomas Ackermann (innovaphone)
Moderator Registered 12 years 131 days
Thomas Ackermann (innovaphone) Monday, 12 April 2021, 03:58 PM
Re: AddProfileContact
This should be all. No more parameters required.
Only profile-id (which set of favorites) and the attributes of the new favorite (num, sip, dn).
Does it not work?
The user needs the config option "Store Phone Config".
See object configuration at PBX.

Best regards
Thomas
Picture of Niko 1071
Registered 11 years 359 days
Niko 1071 Monday, 12 April 2021, 04:16 PM
Re: AddProfileContact
Hi Thomas,

thx for answering

>>Does it not work?

no it doesn't, as allready written favorites are stored under App Object

>>The user needs the config option "Store Phone Config".

this option is set

How does the AddProfileContact function knows/decides under which object the favorits should be stored ?

BR
Niko
Picture of Thomas Ackermann (innovaphone)
Moderator Registered 12 years 131 days
Thomas Ackermann (innovaphone) Monday, 12 April 2021, 06:43 PM
Re: AddProfileContact
Our Softphone-App does this:
  1. opens a Websocket connection to PBX
  2. performs a login as a specific user
  3. performs a registration as voip endpoint.
This tells the PBX which "user identity" is working.
Favorites are saved on that user object.

You probably don't need to do a voip registration in order to read or add favs, but login as a user is required. This user-login defines which fav-config is addressed.

/Thomas
Picture of Niko 1071
Registered 11 years 359 days
Niko 1071 Monday, 17 May 2021, 05:09 PM
Re: AddProfileContact
Hi Thomas,

we are still failing with this task.

>> performs a login as a specific user

this should be done in this way :

"mt":"AppLogin","app":"myapp","domain":"my-pbx-domain","sip":"User Object","guid":"User Object guid"

right ?

after this we received an mt "AppLoginResult", "ok":true

that is the way we do it, but action like SubscribeProfile or AddProfileContact only do all actions for/on app Object "myapp"

do not know what to do sad
this Thread: How to login the right way to use SubscribeProfile deals with the same topic

Need support pls.

thx
Niko






Picture of Daniel Deterding (innovaphone)
Moderator Registered 15 years 121 days
Daniel Deterding (innovaphone) Thursday, 20 May 2021, 09:29 AM
Re: AddProfileContact
Hi Niko,

we're currently discussing your issue and need further information:

What is your usecase to use PbxApi together with SubscribeProfile?
Is your App started within the myApps client by PBX users or is your application not running within the myApps client context?

Greetings,
Daniel


Picture of Niko 1071
Registered 11 years 359 days
Niko 1071 Thursday, 20 May 2021, 11:12 AM
Re: AddProfileContact
Hi Daniel,

Thanks for your answer.

We have a myApps app which each extension of the PBX should use. In the app, each user should be able to see, delete, change, create their own favorites.

Viele Grüße
Niko
Picture of Niko 1071
Registered 11 years 359 days
Niko 1071 Friday, 4 June 2021, 08:23 AM
Re: AddProfileContact
Hi innovaphone,

we are still not getting on here and need support/a hint on what we are doing wrong.

Thx
BR
niko


Andreas Fink
Moderator Registered 13 years 52 days
Andreas Fink (innovaphone) Tuesday, 8 June 2021, 07:02 PM in response to Niko 1071
Re: AddProfileContact
Hello Nico,

it seems to have the same origin, as the following forum thread:

https://class.innovaphone.com/moodle2/mod/forum/discuss.php?d=26519

Correct me if I'm wrong, but your App is not running in a context of myApps client, as I can understand, because of the following statement:

>> performs a login as a specific user
>
> this should be done in this way :
>
> "mt":"AppLogin","app":"myapp","domain":"my-pbx-domain",
> "sip":"User Object","guid":"User Object guid"
>
> right ?
>
> after this we received an mt "AppLoginResult", "ok":true

Are there any Login/Authenticate messages prior using AppLogin? Could you post a complete communication between your App and PBX, and additionally between your App and App Service?

There is a big difference between Login and AppLogin:
  • The AppLogin method is a part of the AppWebsocket API https://sdk.innovaphone.com/13r1/doc/appwebsocket/AppWebsocket.htm
  • The Login method is a part of myApps protocol API https://sdk.innovaphone.com/13r1/doc/appwebsocket/myApps.htm
As I understand correctly from the first message in this thread, you open an AppWebsocket in context of an App Object and therefore store the Profile directly on this App Object, which is not intended behaviour for you.

Instead a Login as User should be performed first (happens automatically, if you run a myApps client). After user starts your App the myApps client performs an App Login towards your App Service. The App, in context of myApps (NOT the App Service!), sends AddProfileContact via the already existing connection to the PBX from the myApps client. The myApps client reaches all required information to the App with a start object. From the App you can just consume an API, in this case PbxApi, by using send() method:

https://sdk.innovaphone.com/13r1/web1/lib1/lib1.htm#start


Best Regards
Andreas Fink
Picture of iqbal
Registered 5 years 221 days
iqbal Thursday, 10 June 2021, 09:59 AM
Re: AddProfileContact
Hi Andreas
App described in thread: https://class.innovaphone.com/moodle2/mod/forum/discuss.php?d=26519
is a different product which operates outside myapps.

This application is running in myApps context and
we are performing Login as a specific user (see attached file). and the results are same. favorite contacts are saved on app object not on loggedin user object.

BR
Iqbal

pbx_login.png

Picture of iqbal
Registered 5 years 221 days
iqbal Monday, 14 June 2021, 12:32 PM in response to Andreas Fink (innovaphone)
Re: AddProfileContact
Hi Andreas
now i can connect to pbx as User but i am sending plain user Password to webservice on cpp side and generating Hash with it.
Question is how can i get Password of user in cpp code or is there other way for that?
BR
Iqbal
Picture of iqbal
Registered 5 years 221 days
iqbal Tuesday, 15 June 2021, 09:06 AM in response to Daniel Deterding (innovaphone)
Re: AddProfileContact
Hi
i need little help and waiting for your answer.
i can connect to pbx as User but i am sending plain user Password to webservice on cpp side and generating Hash with it.
Question is how can i get Password of user in cpp code or is there other way for that?
i also tried using replicated users table but password there are encrypted. if that is solution then how could i possibly decrypt user password and which encryption key are used
BR
Iqbal
2013
Moderator Registered 16 years 15 days
Guntram Diehl (innovaphone) Friday, 18 June 2021, 02:03 PM
Re: AddProfileContact
Please see this thread it discusses the same problem,
Picture of Sascha
Registered 5 years 281 days
Sascha Monday, 14 June 2021, 02:34 PM in response to Niko 1071
Re: AddProfileContact
I have also a few remarks / questions to the AddProfileContact event.

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?
← You can define your color theme preference here