Remote FOP2 Configuration via FreePBX

  1. 8 years ago

    My company uses FreePBX to configure FOP2 buttons. I would like to move the FOP2 instance to its own dedicated machine, I know this is possible, but would this mean they would have to configure FOP2 via its own admin panel, or could they still use FreePBX/FOP2 Modules?
    Regards,

  2. admin

    1 Jul 2016 Administrator

    You can configure the FOP2 Manager to access the remote FreePBX MySQL database, either by modifying credentials in /var/www/html/fop2/admin/config.php and setting also ENGINE to be "freepbx".

    Be advised that some features, like file based voicemail explorer, won't work if you install FOP2 on a separate machine (you can use odbc based voicemail for that, but FreePBX doe snot use it).

  3. I get that, and it sounds like your saying what I hope you are, that all the configurations are stored in MySQL DB. But I thought with FOP2 that when users were created and buttons etc etc that files were created on inside the /fop2/ directory. Therefor would FreePBX be able to tell FOP2 to create a user by editing the MySQL db which FOP2 would then read and populate the necessary files in its own webroot? [OR is FOP2 webroot static and only the MySQL DB changes?]

    This would help me understand moving my FOP2 as well, because currently I installed FOP2 on the new system, then moved over the webroot + /usr/local/fop2. But I had glitches and I would rather just install fresh + activate new license and import DB/Connect to Remote DB.

    When I say glitchy, this is the resulting problem @ the moment. [url=http://forum.fop2.com/4256-can-t-revoke-fop2-license] [Can't Revoke License in FOP2] . I think this is because I activated over-top of an already existing but not working fop2.lic. I figured it would just over-write it, and it did, but I need to start fresh and I can't revoke the license. (Sorry to go off topic, but this topic will help me avoid the other again)

  4. admin

    2 Jul 2016 Administrator

    License issues are not related at all with a multi server installation. You are right in thinking that revocation is not possible as your license is now invalid. You cannot revoke an invalid license. You can only revoke a valid one, and the moment you moved a license file into another server you invalidated it. So, you must run /usr/local/fop2/fop2_server --revoke on the original server the license was issues... and you should check that the license is in fact correct with /usr/local/fop2/fop2_server --test. Only if the test is successful then the --revoke will work. Now, once revoked, you will be able to run /usr/local/fop2/fop2_server --register on the new server directly, and it will retrieve a new license file directly.

    As for configurations. I do not know what you did in your current setup/configuration, so I cannot answer properly.

    FOP2 configuration can be static text files, or you can run a script that outputs valid configuration data and use that as config. The newer FOP2 version includes a FOP2 Manager that will store every configuration in MySQL, and then it will use a script to retrieve that and generate valid fop2 user and buttons data. So, the fop2.cfg file has only this: #exec autoconfig-users.sh . That script will read MySQL fop2 tables to generate user,groups and plugins data. Then it will load the autobuttons.cfg file that will in its place execute the script autoconfig-buttons.sh, that will produce the buttons configuration data (also by querying mysql).

    The FOP2 Manager detects your backend and will query that backend via available means to populate fop2 tables with data. In FreePBX it queries some tables to get configuration. In some other backends it reads some static files, in other it could be mixed between db and static files.

    You can very well remove that #exec line and write static user=xxxx lines, or write your own scripts, or whatever. FOP2 and the FOP2 Manger won't create FOP2 users automatically if you add an extension in FreePBX, that is a design choice. You can manipulate fop2 tables by other means if you want, but it is not really recommended (unless you want to auto create users). But be advised that user tables are several and they are interrelated. Look at the mysql query in autoconfig-users.sh to have an idea on how things are done sql wise.

    Best regards,

  5. I am also currently trying to a get standalone install of FOP2 running with a remote FreePBX system and having problems. The AMI user and MySQL connect fine but no users or buttons will populate. Originally I had followed the guide here: http://support.asternic.biz/?/selfhelp/view-article/installing-fop2-on-a-separate-server/8 with not luck.

    I tried changing the ENGINE value to freepbx as mentioned above and that did not help.

    Just to note, I have been using FOP2 installed locally on a FreePBX install for multiple years so I am fairly familiar with it.

  6. admin

    5 Jul 2016 Administrator

    Not only you have to modify the engine, but also set mysql credentials to connect to the remote server. Also, on the FreePBX server you must grant permissions to connect from remote. That is the key and most important factor. FOP2 Manager needs to access the remote MySQL server and read the 'asterisk' database that FreePBX uses, with enough privileges to also create its own needed tables.

    Without that, it won't work. Your problem is most probably mysql permissions, and you just need to set correct credentials in /var/www/html/fop2/admin/config.php *and* grant permissions to a user in MySQL, check and recheck that you have created a valid mysql user and that you can connect to mysql from the FOP2 server using the mysql command line client:

    mysql -u USERYOUCREATED -p -h IP.OF.ASTERISK

    And enter the password you created/granted permissions to. Once you get that working, then replicate that user/pass/ip on the config.php file.

  7. Thanks for quick response.

    I've now tested and double checked the mysql credentials which do successfully connect. Does USE_FREEPBX_AUTH in config.php need to be set to true or false?

    Either way I get errors about creating the various fop2 tables which I would think is the local DB, no?

  8. admin

    29 Jul 2016 Administrator

    As system is decoupled from FreePBX, you should not be using USE_FREEPBX_AUTH for consistent behaviour. It is better to set it as falase and configure a fop2 manager user and secret in config.php.

    As for the error creating tables, means your mysql user does not have enough privileges for creating its tables. you should review permission for that user and allow/add the create permission (not only select,insert,update,delete).

    Best regards,

or Sign Up to reply!