Picture of iqbal
Registered 5 years 279 days
iqbal Wednesday, 20 May 2020, 12:43 PM
insert PBX Password into "Users Admin" App programmatically
hi everyone
can somebody tell me how can i insert PBX Password into "Users Admin" App programmatically with websocket using php.
because it is mandatory for "User Admin" App to work.
regards
iqbal

UsersAdmin.png

Picture of Carmen Álvarez Méndez (innovaphone)
Moderator Registered 7 years 143 days
Carmen Álvarez Méndez (innovaphone) Wednesday, 20 May 2020, 03:03 PM
1 of 1 users consider this post helpful
Re: insert PBX Password into "Users Admin" App programmatically
First you need to open an AppWebsocket connection to the app:
https://sdk.innovaphone.com/web1/appwebsocket/appwebsocket.htm

Then you can send a JSON message to the app to write the configuration like this one:
src.send({ mt: "CheckPassword", pbxPassword: encryptedPBXPassword, smtpPassword: encryptedSMTPPassword })

And to calculate the encryption of the passwords you can use this function:
src.encrypt(yourSeed, plainPassword)

P.S.: As seed you may need to use "innovaphone".
Picture of iqbal
Registered 5 years 279 days
iqbal Tuesday, 26 May 2020, 10:16 AM
Re: insert PBX Password into "Users Admin" App programmatically
Hi
i followed your instructions, but still getting error. can you help me to figure it out. here some php code:
$res = $this->sendMessage(new AppPlatform\Message("AppChallenge","app","users-admin"));
--> wenn i change "AppChallenge" to "Challenge" as in your documentation, i get requesttimeout.
if(property_exists($res,'challenge'))
{
$this->setSessionKey(hash('sha256', "users-admin:DemoUser:{$res->challenge}:DemoPassword"));
$this->setLoginMessage(new AppPlatform\Message("AppLogin", "app", "users-admin", "user", "DemoUser", "key", $this->getSessionKey()));
--> same wenn i change "AppLogin" to "Login" as in your documentation, i get requesttimeout.
$loginMsg = $this->sendMessage($this->getLoginMessage());
var_dump($loginMsg);
$response = clone $this->getLoginMessage();
var_dump($response);

Answer that i get is as followed, see txt File:
result.txt
Picture of Matthias Schertler (innovaphone)
Moderator Registered 12 years 193 days
Matthias Schertler (innovaphone) Thursday, 28 May 2020, 09:41 AM
Re: insert PBX Password into "Users Admin" App programmatically
Sorry, the documentation page we posted is outdated, that's why the messages don't work - we will fix that. Please find the correct documentation here:

https://sdk.innovaphone.com/doc/appwebsocket/AppWebsocket.htm

← You can define your color theme preference here