Picture of s.taras
Registered 5 years 82 days
s.taras Wednesday, 15 April 2020, 05:05 PM
How to use PbxAdminApi PbxTableUsers on service (C++) side
Hello,

Can someone help me with using PbxAdminApi PbxTableUsers on service (C++) side. I'm not succeed in this. I try to open WebSocket for API calls, but got "Close" callback at once. But it works on JS side.

Thank you
Picture of Carmen Álvarez Méndez (innovaphone)
Moderator Registered 7 years 143 days
Carmen Álvarez Méndez (innovaphone) Monday, 27 April 2020, 09:22 AM
Re: How to use PbxAdminApi PbxTableUsers on service (C++) side
Hello,
We have created a new tutorial about how to use the replicator, which is what uses PbxTableUsers. It will be available with the next service release.
Picture of Carmen Álvarez Méndez (innovaphone)
Moderator Registered 7 years 143 days
Carmen Álvarez Méndez (innovaphone) Monday, 27 April 2020, 09:51 AM in response to s.taras
1 of 1 users consider this post helpful
Re: How to use PbxAdminApi PbxTableUsers on service (C++) side
Hello,

We have already updated the SDK online documentation, so you can access it here: http://sdk.innovaphone.com/doc/tutorials/Replicator.htm
Picture of s.taras
Registered 5 years 82 days
s.taras Wednesday, 29 April 2020, 06:32 PM
Re: How to use PbxAdminApi PbxTableUsers on service (C++) side
Hi Carmen.

Thank you for your response.
I have go throw this tutorial, but didn't get data in replication table.

Unfortunately I even do not see that replication is start.
Is this possible to get sample app with the working code?

Thank you, Taras
Picture of Carmen Álvarez Méndez (innovaphone)
Moderator Registered 7 years 143 days
Carmen Álvarez Méndez (innovaphone) Thursday, 30 April 2020, 10:48 AM
Re: How to use PbxAdminApi PbxTableUsers on service (C++) side
Hi Taras,

The tutorial only included the code side and no the App Object configuration on the PBX. Probably the TableUsers and Websocket checkmarks are missing. I have added this and updated the tutorial.

Please try again and if you still have problems I can still send you the project, but I think that it will be usefull if we could add any missing point to the tutorial and check if it can be easily followed.

Greetings,
Carmen
Picture of s.taras
Registered 5 years 82 days
s.taras Thursday, 30 April 2020, 03:11 PM
Re: How to use PbxAdminApi PbxTableUsers on service (C++) side
Hi Carmen.

I do not have ReplicatorStart call. Nothing happens after Application session is initialized and replicator->Update(args.appDomain, pbxName);

My application can get users list form PBX on JS side by innovaphone.appwebsocket.Connection to "wss://<address>/PBX0/APPS/websocket".

So I think I miss something on C++ part.

Share sample with me, please. I'll compare and let you know what was the reason.

Thank you,
Taras
Picture of Carmen Álvarez Méndez (innovaphone)
Moderator Registered 7 years 143 days
Carmen Álvarez Méndez (innovaphone) Thursday, 30 April 2020, 03:27 PM
1 of 1 users consider this post helpful
Re: How to use PbxAdminApi PbxTableUsers on service (C++) side
Hi Taras,

Have you replaced the pbxName by the name of your PBX? I get an error when attaching the files, I will keep trying to upload it.

Greetings,
Carmen
Picture of s.taras
Registered 5 years 82 days
s.taras Thursday, 30 April 2020, 03:54 PM
Re: How to use PbxAdminApi PbxTableUsers on service (C++) side
Carmen, Thank you for fast answer.

Have you replaced the pbxName by the name of your PBX? - Yes, I did.
Thank you for sample. Will review what is wrong in my code

Taras
Picture of Carmen Álvarez Méndez (innovaphone)
Moderator Registered 7 years 143 days
Carmen Álvarez Méndez (innovaphone) Thursday, 30 April 2020, 03:48 PM in response to s.taras
0 of 1 users consider this post helpful
Re: How to use PbxAdminApi PbxTableUsers on service (C++) side
Project:
https://cloud1.innovaphone.com/index.php/s/5QlQTfZ6uAdlVsc
Picture of s.taras
Registered 5 years 82 days
s.taras Thursday, 7 May 2020, 11:33 AM
Re: How to use PbxAdminApi PbxTableUsers on service (C++) side
HI. It works, thank you.

webserverPlugin->HttpListen(nullptr, nullptr, nullptr, nullptr, _BUILD_STRING_);
webserverPlugin->WebsocketListen();
webserverPlugin->WebsocketListen("<myApp Name>"); // This line was critical
Picture of Carmen Álvarez Méndez (innovaphone)
Moderator Registered 7 years 143 days
Carmen Álvarez Méndez (innovaphone) Thursday, 7 May 2020, 11:43 AM
Re: How to use PbxAdminApi PbxTableUsers on service (C++) side
Hi Taras,

Great! It makes sense that it will not work without this, because then this is never called and the replicator is not started:
class JsonApi * jsonApi = appInstance->CreateJsonApi("PbxTableUsers", this, msg, base);
← You can define your color theme preference here