FOP2 Separate Server

  1. 9 years ago

    Hi,

    I am trying to use FOP2 as a standalone server for multiple PIAF installations. However, I cannot even get it to work for one PIAF installation.

    This is the setup on my PIAF server:

    - I have exported the following directories via NFS share
    /var/spool/asterisk/voicemail
    /var/spool/asterisk/monitor
    /etc/asterisk
    /var/lib/asterisk
    /var/www/html/admin

    - All of the relevant ports have been opened up on the firewall/made sure selinux was disabled
    3306
    5038

    - Created the following manager in manager_custom.conf
    [fop2]
    secret = password
    deny = 0.0.0.0/0.0.0.0
    permit = 127.0.0.1/255.255.255.0
    permit = xxx.xxx.xxx.xxx/255.255.255.0
    read = all
    write = all
    writetimeout=1000
    eventfilter=!Event: RTCP*
    eventfilter=!Event: VarSet
    eventfilter=!Event: Cdr
    eventfilter=!Event: DTMF
    eventfilter=!Event: AGIExec
    eventfilter=!Event: ExtensionStatus
    eventfilter=!Event: ChannelUpdate
    eventfilter=!Event: ChallengeSent
    eventfilter=!Event: SuccessfulAuth

    - Created an fop2 mysql user with all privileges on all tables with a command similar to this one
    GRANT ALL PRIVILEGES ON *.* TO "fop2"@"xxx.xxx.xxx.xxx" IDENTIFIED BY "password" WITH GRANT OPTION;

    This is the setup on my FOP2 server (CentOS 6.4):

    - Installed LAMP
    Apache
    Mysql
    Php

    - Mounted the NFS shares
    Shares work perfectly

    - Installed FOP2 via Tarball
    Got error saying it couldn't ''chown asterisk:asterisk''
    Finished the install anyways

    - Added this to fop2.cfg
    [general]
    ; AMI definitions
    manager_host=xxx.xxx.xxx.xxx (address of server)
    manager_port=5038
    manager_user=fop2
    manager_secret=password

    - Added this to config.php
    $DBHOST="xxx.xxx.xxx.xxx";
    $DBUSER="fop2";
    $DBPASS="password";
    $DBNAME="asterisk";

    - /usr/local/fop2/fop2_server --test is positive with no errors

    - Registered Full White Label version

    This is what does not work:

    - The autoconfig scripts do not work
    I therefore cannot login to myaddress/fop2 because no users/no buttons exist

    - I get 4 Php errors when loging in through the manager Web UI in the ''Users'' and ''Buttons'' section
    mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given
    /var/www/html/fop2/admin/asmanager.php (line 102)fsockopen():unable to connect to localhost:5038 (Connectionrefused)
    /var/www/html/fop2/admin/asmanager.php (line 257) date(): It is not safe to rely on the system's timezone settings.
    /var/www/html/fop2/admin/functions-custom.php (line 164) Undefined variable: astman

    I am sure we can get this to work, but I lack the necessary experience in regards to Php scripts so I am having a hard time trying to figure the, out on my own. Any help would be greatly appreciated.

    Thank you very much for your time.

    Kevin Farrell-Pelletier

  2. admin

    4 Sep 2015 Administrator

    For the FOP2 manager you need to also edit /var/www/html/fop2/admin/config.php and set the mysql credentials there.

    However, if your plan is to monitor multiple servers, that is not the way to do it as the manager is single server. In the case of multiple server you will need to install the manager in each asterisk box, and then modify the autoconfig scripts on the fop2/central server to run via passwordless ssh the autoconfig scripts on each Asterisk PBX. You will also need to modify the auto configs in each asterisk pbx so it also returns the server=x.x.x.x directive and possibly add a group=server directive also.

    If it is only for ONE server, then specifying the remote mysql on /var/www/html/fop2/admin/config.php should work. You can try that out, after that, login into the manager will retrieve config from the remote asterisk mysql database and populate the local tables. Also, the auto config scripts will read the settings for mysql on /var/www/html/fop2/admin/config.php and retrieve conf from there.

    Notice that the mysql user must have permissions to create tables, otherwise it will fail.

    The astman errors you see are not a problem, they won't prevent all of the above from happening.. the manager connection is used in order to get the park config only. In the current version the server/host is hardcoded, but in the next release it won't be.. You can look at the code and fix that part, or leave it as is and turn off debug as it is not a critical issue.

    Best regards,

or Sign Up to reply!