Picture of Silvio 2739
Registered 9 years 84 days
Silvio 2739 Wednesday, 1 July 2020, 01:25 PM
Replicator tutorial outdated?
Hello,

please review the Replicator tutorial so that it becomes comprehensible and reproducible. It starts that the Conventions section mentions NewApp1 but in the code it is SDKSample. The "innovaphone App" template also includes code for the counter that could/should be removed. Other things I found while trying to understand it:

Task 1: The "common/interface/replication.h" needs to be added to the NewApp1-main.cpp too.

The last code sample seems to extend the class definition in the NewApp1.h but the other two lines have to go somewhere else, where the variables msg and base exist. Where is the exact place to insert these lines?

In Task 2 is missing that all methods need to be added to the .h file. Also code for TaskDeleteUser doesn't exist.

Task 3: The code for the .h file for AppTaskDatabaseInit is missing.
The template already contains both DatabaseInit and TaskDbInit. Is it maybe better to use these classed instead?
There is no body for DatabaseInitFailed.

Task 4: What do "helloworld" and "pbx" do? Do they have to be adjusted?

Section "Other considerations": What does "when your database changes" mean? In which situations does my database change?

Picture of Carmen Álvarez Méndez (innovaphone)
Moderator Registered 7 years 142 days
Carmen Álvarez Méndez (innovaphone) Monday, 27 July 2020, 02:52 PM
Re: Replicator tutorial outdated?
Hi,

I have updated the tutorial. I hope that it is more clear now.

Greetings,
Carmen
Picture of Daniel 450
Registered 14 years 231 days
Daniel 450 Wednesday, 19 August 2020, 09:07 PM
Re: Replicator tutorial outdated?
Ich schließe mich dem Beitrags Ersteller an und bitte auch, trotz Update, um ein per copy & paste reproduzierbares Tutorial. Sollte für euch doch nicht so schwer sein. Und hilft uns schneller ans Ziel zu kommen. Denn unserer Meinung nach sind weiterhin Fehler in der Beschreibung wo was hin kopiert werden soll. Und alle "..." sollten ausgemerzt werden.
Picture of Carmen Álvarez Méndez (innovaphone)
Moderator Registered 7 years 142 days
Carmen Álvarez Méndez (innovaphone) Thursday, 20 August 2020, 09:09 AM
Re: Replicator tutorial outdated?
Ich habe das Tutorial aktualisiert. Unter "Code Example" wird ein ZIP herunterladen mit eine Replikator-App.
Picture of Daniel 450
Registered 14 years 231 days
Daniel 450 Wednesday, 30 December 2020, 05:01 PM
Re: Replicator tutorial outdated?
Thank you for your update, we checked it several weeks ago, but i am sorry. we couldn´t get it worked. We did a lot, but one thing we didn´t know to solve. We think that you have done it with an older version of the sdk. So if we are right, it would be great if you could update your solution so that we could open it in visual studio and send it direct to your developer App Plattform. I hope we understand then what is our problem.
Picture of Carmen Álvarez Méndez (innovaphone)
Moderator Registered 7 years 142 days
Carmen Álvarez Méndez (innovaphone) Monday, 11 January 2021, 09:46 AM
Re: Replicator tutorial outdated?
Hi,
could you explain what the problem is or what errors are displayed?
Picture of mitop
Registered 3 years 348 days
mitop Thursday, 24 June 2021, 12:41 PM
Re: Replicator tutorial outdated?
Hi Carmen,

sorry for our late reply. We gave ourselfs one more try to get the replicator running, unfortunately without success. Next i try to explain what we want to achive and what problems/erros we are faced to.

Our long term goal is to become part of the Innovaphone App-Development and to deploy apps through your plattform. At the moment we are faced with the decision whether to invest our time here. However, what we need for our test app (hopefully our first deployed app) is the same functionality as your "Users" App. We want to display a list of all available users and allow a selection. For this, we need the replicator (right?) to copy the pbx users data to a local database so that we can display it to our user. We are using version 13.1.

We open a new Project in Visual Studio 2019 with Innovaphone r13.1 app development.
- Our problems with the Replicator start at the very first lines of the tutorial:
-- When we include the "tasks_postgresql.h" in our NewApp1.h we get a redefenition error
-- When adding "replication.h" to NewApp1-main.cpp it does not build at all
(-- All ".h" files generated by the SDK have no ".h" files included)

I fixed these "errors" by myself and after a couple of time i had a running program, local databases were added, but without replication from the pbx (local database is empty). In the next step i took the replication.zip file and copied the logic to my solution. Same problem here, a running program but without replication. The main problem now is that the "ReplicatorStart" function is never called, the breakpoint set never reached, we have no idea why. This is the output that we get from Visual Studio:
- "06-24 10:14:52.499 AppService::AppService 13A352
06-24 10:14:52.499 AppService::AppStart repli@example.com
NOTICE: relation "users" already exists, skipping
NOTICE: relation "replicator_full" already exists, skipping"
- "Breakpoint 1, main (argc=1, argv=0x7ffdb4604128) at repli-main.cpp:39" - but there is no breakpoint set (line 39 is: "class IIoMux * iomux = IIoMux::Create();")
Inside your replication.zip file the replicator.mak file that is next to the ...-main.cpp contains these two includes:
- # include sdk/web0/lib/lib.mak
- # include sdk/web0/styles/styles.mak
Unfortunately there is no folder sdk/web0 only sdk/web1 in our SDK. On github we found the SDK 13.1 as download, same here, no web0 folder. Is this maybe the problem?

To summarize (r13.1):
- We need the "users" app funtionality (maybe your original code will help us)
- Header file includes (what is the right way? In my solution i can only include the "replication.h" file in my replicator.h file, other solutions will result in redefenition errors)
- The "ReplicatorStart" function is never called (do we miss to give our app any right? Task 5 from the replicator tutorial for example seems to be out of date because the config is set automatically from our opinion)
- Does the replicator need the "sdk/web0 folder that is no longer part of the SDK/Framework?

We hope that this here can help you, to help us to get the replicator running and to become part of the Innovaphone App-Development Community. I promise to answer promptly if there are any questions.


With best regards

Mladen Topic



2013
Moderator Registered 16 years 72 days
Guntram Diehl (innovaphone) Friday, 25 June 2021, 09:50 AM
Re: Replicator tutorial outdated?
I looked into the users App, what has to be done for the replicator:

At initialization, instance construktor
================================

replicator = IReplicator::createReplicator(this, "PbxTableUsers", 0, 0, "domain", "pbx", database, "users", true, true);
RegisterJsonApi(replicator);
replicator->AddColumn("guid", "guid", ReplicationString, false);
replicator->AddColumn("h323", "username", ReplicationString, true);
...
add all the colums you need

after database initialized
======================

replicator->Initialize("BIGINT REFERENCES users(id) ON DELETE CASCADE NOT NULL");

When receiving PbxInfo from PBX Websocket
======================================

else if (!strcmp(mt, "PbxInfo")) {
 if (!strcmp(app, "innovaphone-profile")) {
 class JsonApi* jsonApi = usersInstance->CreateJsonApi("PbxTableUsers", this, msg, base);
 if (jsonApi) jsonApi->JsonApiStart();


I hope this helps. If you have still problems, we can check if we can generate a complete working sample
Picture of Thomas Ehrhardt (innovaphone)
Moderator Registered 15 years 111 days
Thomas Ehrhardt (innovaphone) Friday, 25 June 2021, 11:11 AM in response to mitop
Re: Replicator tutorial outdated?
Hi Mladen,

additional, the replicator has following requirements:
  • An active PBX connection, and the app access to the PBX API "TableUsers"
  • The replicator must know the domain and the PBX name
Configure the domain and the PBX name of the connected PBX with createReplicator or with the Update(..) function. You can get the PBX name from the PbxInfo with the PBX connection, or from a configuration option of your app.

Best regards

Thomas
Picture of mitop
Registered 3 years 348 days
mitop Friday, 25 June 2021, 03:38 PM in response to mitop
Re: Replicator tutorial outdated?
Hi Guntram, Hi Thomas,

thank you for your reply. (One question: Is german fine for you?)

I will check my code util next week, maybe the pbx name is wrong. We had one session where we tried to connect via different pbxNames, i will try to explain our pbx/appplattform setup too, the routing may be a problem.

All function calls that you two mentioned were called for sure. I am wondering why we never get the a "ReplicationStart" callback, is this function called after establishing a connection to the pbx?
Does the replicator need the "sdk/web0 folder that is no longer part of the SDK/Framework?

Talk to you next week, have a nice weekend.


Best regards

Mladen
Picture of mitop
Registered 3 years 348 days
mitop Friday, 25 June 2021, 04:50 PM
Re: Replicator tutorial outdated?
Hi,

when i talk about the "sdk/web0" folder, i have your replication.zip file in mind (https://sdk.innovaphone.com/13r1/doc/tutorials/replication.zip) . In the replication.mak file next to replication-main.cpp, you are using this "sdk/web0" folder. But there is no such folder in a fresh installed sdk environment sad

Do we need it?

Best regards

Mladen
2013
Moderator Registered 16 years 72 days
Guntram Diehl (innovaphone) Friday, 25 June 2021, 05:09 PM
Re: Replicator tutorial outdated?
The sdk/web0 folder is not needed for the replicator
Picture of mitop
Registered 3 years 348 days
mitop Monday, 26 July 2021, 12:42 PM in response to mitop
Re: Replicator tutorial outdated?
Hello all,

unfortunately it's been a while again, but we put some time into the replicator again and included a zip file this time. It contains our code, some screenshots of the configuration, the created log file from the app platform and the core dump. We are sending this to you in the hope that you will find some time to tell us what we are doing wrong, why our replicator just won't fetch the values from the pbx.

I spent this morning comparing my code with the code from your zip file (https://sdk.innovaphone.com/13r1/doc/tutorials/replication.zip), I didn't notice any inconsistencies. But maybe I'm already blind and don't see my mistake.

If you are able to look into the code and give us feedback, we would be very grateful.
mr_replicator.7z
Picture of Daniel Deterding (innovaphone)
Moderator Registered 15 years 178 days
Daniel Deterding (innovaphone) Thursday, 5 August 2021, 12:13 PM
1 of 1 users consider this post helpful
Re: Replicator tutorial outdated?
Hi Mladen,

I took a look at your issue and there are two things:
  1. usage of createReplicator is wrong. You must use const "domain" and "pbx": myrepli = IReplicator::createReplicator(this, "PbxTableUsers", 0, 0, "domain", "pbx", database, "users", true, true);
  2. usage of myrepli->Update in line 379 is wrong. Here you must hand the PBX Name of the PBX which you are using for testing (the name which you find under PBX -> Config -> General on your gateway/IPVA). As many installations use several PBXes (master/slaves), this PBX name must be configurable inside your App, e.g. by a PBX Manager Plugin.
I clarified the usage of these two functions in the documentation and the tutorial itself.

After I changed these two things, replication worked for me.

Greetings,
Daniel
Picture of mitop
Registered 3 years 348 days
mitop Tuesday, 10 August 2021, 10:56 AM
Re: Replicator tutorial outdated?
Hi Daniel,

Heureplica smile it works! The next step is making the PBXes name configurable

Thank you very much!
← You can define your color theme preference here