Howto: Installation of Centos 7.x server with Asterisk 11 and FreePBX 12

From voipsupport
Revision as of 13:22, 13 June 2016 by John (talk | contribs)
Jump to navigation Jump to search

Centos Installation

1. First download the appropriate ISO image from centos mirrors http://isoredirect.centos.org/centos/7/isos/x86_64/ and install. Centos 7 only supports 64 bit processors. This howto uses the minimal install image: CentOS-7-x86_64-Minimal-1503-01.iso (or a later version).

2. Burn the images to a CD and boot from the CD

Screen1.png

3. Choose language

Screen2.png

4. Configure install options

Screen3.png

5. Configure time zone

Screen4.png

6. Configure networking. Change option to "On" and then click on Configure. Set the network to start automatically. You should also setup the ip address. After clicking on Done, click "Begin installation"

Screen5.png

7. Setup the root password by clicking on the menu item and setting the password.

Screen6.png

8. Once the installation is complete click on Reboot

Screen7.png

9. Boot the system in normal mode (first menu item in boot list)

Screen8.png

10. Login as root

Screen9.png

11. Update system

yum -y update

12. Disable selinux. [Warning: Selinux is a security feature and disabling is not really the right thing to do, though at the moment is seems to be the easiest way to get things working. The correct solution would be to leave Selinux enabled and then submit a Selinux configuration that does not block Asterisk/Freepbx from working. If anyone has time to do that they are more than welcome. In the meantime I assume we will disable it and accept the weakened security as a consequence.] Check the following file:

vi /etc/selinux/config

has this setting:

SELINUX=disabled

reboot (if above setting was changed):

reboot

13. Install additional packages

yum -y install net-tools wget

Mariadb

Centos 7 comes with Mariadb instead of Mysql.

  1. Install mariadb if not already present

%commandbox% [@yum install mariadb-server@]

  1. %item value=2% Setup mariadb to start on boot:

%commandbox% [@systemctl enable mariadb@]

  1. %item value=3% Start mariadb:

%commandbox% [@systemctl start mariadb@]

  1. %item value=4% Secure the installation by running following script and answering with defaults:

%commandbox% [@/usr/bin/mysql_secure_installation@] ->Output: %resultbox% [@/usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB

     SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and you haven't set the root password yet, the password will be blank, so you should just press enter here.

Enter current password for root (enter for none): OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB root user without the proper authorisation.

Set root password? [Y/n] Y New password: Re-enter new password: Password updated successfully! Reloading privilege tables..

... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment.

Remove anonymous users? [Y/n]

... Success!

Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n]

... Success!

By default, MariaDB comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment.

Remove test database and access to it? [Y/n]

- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!

Reloading the privilege tables will ensure that all changes made so far will take effect immediately.

Reload privilege tables now? [Y/n]

... Success!

Cleaning up...

All done! If you've completed all of the above steps, your MariaDB installation should now be secure.

Thanks for using MariaDB!@]

!!Apache

  1. Install apache and php if not already present

%commandbox% [@yum -y install httpd php php-pear php-mysql php-process php-mbstring@]

  1. %item value=2% Setup apache to start on boot

%commandbox% [@systemctl enable httpd@]

  1. %item value=3% Setup the user and group that will be used for asterisk install and configure apache to run with these:

%commandbox% [@useradd -c "Asterisk PBX" -d /var/lib/asterisk asterisk@]

  1. %item value=4% Change the apache configuration to use the user and group just defined:

%commandbox% [@vi /etc/httpd/conf/httpd.conf@] ->Change the following lines: %resultbox% [@User apache Group apache@] ->to: %resultbox% [@User asterisk Group asterisk@]

  1. %item value=5%Modify the same file (httpd.conf) to allow apache directives to be overriden in .htaccess files. The modification has to be done in the <Directory> directive of the default server. Be sure to modify the setting in the correct <Directory> directive. It should be something like <Directory "/var/www/html">

%resultbox% [@AllowOverride All@]

  1. %item value=6% This step should not be needed if installing from the default images since this setting should already be done, however check it to make sure. Modify the same file (httpd.conf) to allow apache to follow symbolic links. The modification has to be done in the <Directory> directive of the default server.

%resultbox% [@Options FollowSymLinks@]

  1. %item value=7% Setup a default time zone in php configuration file:

%commandbox% [@vi /etc/php.ini@]

%resultbox% [@date.timezone = "Europe/Amsterdam"@] ->See http://php.net/manual/en/timezones.php for full list of supported values.

  1. %item value=8% Change the permissions of the session.save_path (as defined in /etc/php.ini)

%commandbox% [@chgrp -R asterisk /var/lib/php/session/@] ->Note: after doing an update to php, it is necessary to check that the update has not reset the owner of the session.save_path to the default (apache) and if so re-execute the above command.

  1. %item value=8% Start the service

%commandbox% [@systemctl start httpd@]

For other apache configuration check the apache documentation. If the server will be accessible via the public internet, then an ssl certificate should be setup and apache configured for https access.

  1. %item value=9% You will need to open the firewall port for the web server. You may also need to open https if you use it. The line below with --permanent option adds the rule permanently but does not take effect unless the firewalld service is restarted, so the second line adds the rule dynamically

%commandbox% [@firewall-cmd --permanent --zone=public --add-service=http firewall-cmd --zone=public --add-service=http@]

!!Dahdi

Only required if using telephony hardware cards.

!!Asterisk

  1. Install asterisk prerequisites if not already present

%commandbox% [@yum install wget curl bison perl perl-CPAN openssl-devel kernel-devel audiofile-devel sox svn gcc-c++ make ncurses-devel libxml2-devel mysql-devel sqlite-devel libuuid-devel jansson-devel@]

-> If you will use odbc with asterisk you will also need

%commandbox% [@yum install unixODBC unixODBC-devel libtool-ltdl libtool-ltdl-devel@]

-> And the relevant connector for your database, for example mysql

%commandbox% [@yum install mysql-connector-odbc@]

  1. %item value=2% Change to a suitable location for storing the downloaded software, e.g.:

%commandbox% [@cd /usr/local/src/@]

  1. %item value=3% Download latest version of asterisk (at time of writing this was 10)

%commandbox% [@wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-12-current.tar.gz@]

  1. %item value=4% Extract the source directory

%commandbox% [@tar -xvzf asterisk-12-current.tar.gz@]

  1. %item value=5% Change into the source directory (customize the command to the version that was downloaded)

%commandbox% [@cd asterisk-12.8.2@]

  1. %item value=6% Get source for fomat_mp3 (not part of downloaded asterisk tar file)

%commandbox% [@contrib/scripts/get_mp3_source.sh@]

  1. %item value=7% Configure. Centos 7 uses a different libdir from the default one in asterisk configure script. If you don't specify this then you will have to link the lib64 library (ln -s /usr/lib/libasteriskssl.so.1 /usr/lib64/libasteriskssl.so.1) for asterisk to run.

%commandbox% [@./configure --libdir=/usr/lib64 @]

  1. %item value=8% Start compilation interactive menu

%commandbox% [@make menuselect@] ->Under Add-ons choose: %resultbox% [@format_mp3 app_mysql cdr_mysql@] ->Under Core Sound Packages and Extra Sound Packages choose any relevant packages. It is a good idea to install not just gsm but also other codecs, since it reduces cpu needs for transcoding and (depending on codec) can give better quality. ->When exiting menuselect, when prompted, press S to save changes.

  1. %item value=9% Compile and install asterisk

%commandbox% [@make make install@]

  1. %item value=10% Change directory owner and group

%commandbox% [@chown -R asterisk:asterisk /var/run/asterisk chown -R asterisk:asterisk /var/log/asterisk chown -R asterisk:asterisk /var/lib/asterisk chown -R asterisk:asterisk /var/spool/asterisk chown -R asterisk:asterisk /etc/asterisk@]

!!Freepbx

  1. Install prerequisites if not already present. The older version is required for Freepbx 12. Newer versions do not work.

%commandbox% [@pear install db-1.7.14 unzip@]

  1. %item value=2% Install lame

%commandbox% [@cd /usr/local/src wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz tar -xvzf lame-3.99.5.tar.gz cd lame-3.99.5 ./configure make make install@]

  1. %item value=3% Get and extract the Freepbx source code

%commandbox% [@cd /usr/local/src wget http://mirror.freepbx.org/modules/packages/freepbx/freepbx-12.0-latest.tgz tar -xvzf freepbx-12.0-latest.tgz cd freepbx@]

  1. %item value=4% Create and populate databases for configuration and cdrs

%commandbox% [@mysqladmin -u root -p create asteriskcdrdb mysql -u root -p asteriskcdrdb < SQL/cdr_mysql_table.sql mysqladmin -u root -p create asterisk mysql -u root -p asterisk < SQL/newinstall.sql@]

  1. %item value=5% Create database user to be used by freepbx to connect to database and give permisisons on databases

%commandbox% [@mysql -u root -p@]

->at the mysql prompt enter (substitute xxxxxxxx with chosen password): %commandbox% [@GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY 'xxxxxxxx'; GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost; flush privileges; quit@]

  1. %item value=6% Start asterisk

%commandbox% [@./start_asterisk start@]

  1. %item value=7% Correct the install script to avoid an error due to /var/www/html already existing

%commandbox% [@vi libfreepbx.install.php@]

-> on line 199 change %resultbox% [@

               $ret=mkdir($directory, $modenum, $recursive);

@] -> to %resultbox% [@

               if(!is_dir($directory)) 
                       $ret=mkdir($directory, $modenum, $recursive);
               else
                       $ret=true;

@]

  1. %item value=8% Run freepbx install script (using same credentials authorized to mysql). If the script fails, then it will be necessary to remove /etc/amportal.conf before rerunning it. NB the script will fail if you leave the default setting for path for webroot.

%commandbox% [@./install_amp@]

->Output %resultbox% [@ Checking for PEAR DB..OK Checking for PEAR Console::Getopt..OK Checking user..OK Checking if Asterisk is running..running with PID: 2570..OK Checking for /etc/amportal.conf../etc/amportal.conf does not exist, copying default Creating new /etc/amportal.conf Enter your USERNAME to connect to the 'asterisk' database:

[asteriskuser] 

Enter your PASSWORD to connect to the 'asterisk' database:

[amp109] abcd1234

Enter the hostname of the 'asterisk' database:

[localhost] 

Enter a USERNAME to connect to the Asterisk Manager interface:

[admin] 

Enter a PASSWORD to connect to the Asterisk Manager interface:

[amp111] 

Enter the path to use for your AMP web root:

[/var/www/html] 

Created /var/www/html Enter the IP ADDRESS or hostname used to access the AMP web-admin:

[192.168.1.1] 192.168.100.208

Use simple Extensions [extensions] admin or separate Devices and Users [deviceanduser]?

[extensions] 

Enter directory in which to store AMP executable scripts:

[/var/lib/asterisk/bin] 

Created /var/lib/asterisk/bin Enter directory in which to store super-user scripts:

[/usr/local/sbin] 

/etc/amportal.conf writtenAssuming new install, --install-moh added to command line OK Reading /etc/amportal.conf..parsed amp_conf variables from /etc/amportal.conf: amp_conf [AMPDBHOST] => [localhost] amp_conf [AMPDBENGINE] => [mysql] amp_conf [AMPENGINE] => [asterisk] amp_conf [AMPMGRUSER] => [admin] amp_conf [AMPMGRPASS] => [amp111] amp_conf [AMPBIN] => [/var/lib/asterisk/bin] amp_conf [AMPSBIN] => [/usr/local/sbin] amp_conf [AMPWEBROOT] => [/var/www/html] amp_conf [AMPCGIBIN] => [/var/www/cgi-bin ] amp_conf [FOPWEBROOT] => [/var/www/html/panel] amp_conf [FOPPASSWORD] => [passw0rd] amp_conf [AUTHTYPE] => [database] amp_conf [AMPEXTENSIONS] => [extensions] amp_conf [AMPDBUSER] => [asteriskuser] amp_conf [AMPDBPASS] => [abcd1234] amp_conf [AMPWEBADDRESS] => [192.168.100.208] amp_conf [AMPDBNAME] => [asterisk] OK Checking for /etc/asterisk/asterisk.conf../etc/asterisk/asterisk.conf does not exist, copying default OK Reading /etc/asterisk/asterisk.conf..OK Using asterisk as PBX Engine Checking for Asterisk version..12.8.2 Checking for selinux..OK Connecting to database..OK Checking current version of FreePBX..2.11.0rc1 Installing new FreePBX files..OK (2964 files copied, 0 skipped) amportal..no fpbx..freepbx_engine..freepbx_setting..gen_amp_conf.php..done apply username/password changes to conf files: running apply_conf.sh from /etc/amportal.conf Reading /etc/amportal.conf Updating configuration... /etc/asterisk/cdr_mysql.conf user: [asteriskuser] password: [abcd1234] hostname: [localhost] /etc/asterisk/manager.conf user: [admin] secret: [amp111] Adjusting File Permissions..


SETTING FILE PERMISSIONS..............Done Removing any dangling symlinks Dangling symlinks removed Done done with apply_conf.sh creating missing #include files..OK Module 'manager' reloaded successfully. Setting permissions on files..OK Loading Bootstrap..OK Checking for upgrades..8 found Upgrading to 2.11.0.. -> Running PHP script /usr/local/src/freepbx/upgrades/2.11.0/migration.php Upgrading to 2.11.0..OK Upgrading to 12.0.1alpha16.. -> Running PHP script /usr/local/src/freepbx/upgrades/12.0.1alpha16/upgrade.php Upgrading to 12.0.1alpha16..OK Upgrading to 12.0.1alpha31.. -> Running PHP script /usr/local/src/freepbx/upgrades/12.0.1alpha31/upgrade.php Upgrading to 12.0.1alpha31..OK Upgrading to 12.0.1alpha45.. -> Running PHP script /usr/local/src/freepbx/upgrades/12.0.1alpha45/upgrade.php Upgrading to 12.0.1alpha45..OK Upgrading to 12.0.1beta10.. -> Running PHP script /usr/local/src/freepbx/upgrades/12.0.1beta10/upgrade.php Upgrading to 12.0.1beta10..OK Upgrading to 12.0.1beta30.. -> Running PHP script /usr/local/src/freepbx/upgrades/12.0.1beta30/upgrade.php Upgrading to 12.0.1beta30..OK Upgrading to 12.0.32.. -> Running PHP script /usr/local/src/freepbx/upgrades/12.0.32/upgrade.php Upgrading to 12.0.32..OK Upgrading to 12.0.38.. -> Running PHP script /usr/local/src/freepbx/upgrades/12.0.38/upgrade.php Upgrading to 12.0.38..OK Checking core.. updated to 12.0.24 Checking logfiles.. updated to 12.0.6 Checking callrecording.. updated to 12.0.2.5 Checking ucp.. updated to 12.0.9 Checking customappsreg.. updated to 2.11.0.2 Checking featurecodeadmin.. updated to 12.0.1 Checking voicemail.. updated to 12.0.32 Checking cdr.. updated to 12.0.17 Checking infoservices.. updated to 12.0.1 Checking dashboard.. updated to 12.0.23 Checking music.. updated to 12.0.1 Checking sipsettings.. updated to 12.0.9 PHP Notice: Undefined variable: db in /var/www/html/admin/libraries/cronmanager.class.php on line 92 ..OK Generating AMP configs.. Generating Configurations.conf, (if Asterisk is not running, you will get an error) In case of error, start Asterisk and hit the red bar in the GUI to generate the Configurations.conf files Checking for PEAR Console::Getopt..OK PHP Warning: file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111 Running module install.php and install.sql scripts PHP Warning: file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111 Skipping extension and destination registry checks PHP Warning: file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111 PHP Warning: file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111 PHP Warning: file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111 PHP Warning: file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111 PHP Warning: file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111 PHP Warning: file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111 PHP Warning: file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111 PHP Warning: file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111 PHP Warning: file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111 PHP Warning: file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111 PHP Warning: file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111 PHP Warning: file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111 PHP Warning: file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111 PHP Warning: file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111 PHP Warning: file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111 PHP Warning: file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111 PHP Warning: file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111 PHP Warning: file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111 PHP Warning: file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111 PHP Warning: file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111 PHP Warning: file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111 PHP Warning: file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111 PHP Warning: file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111 PHP Warning: file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111 no crontab for asterisk no crontab for asterisk Please update your modules and reload Asterisk by browsing to your server. Generating AMP configs..OK Checking core.. Checking if directdids need migrating..already done updating zap callgroup, pickupgroup..not needed checking for delay_answer field ..already exists checking for reversal field ..added checking for pricid field ..already exists Checking if trunk table migration required..not needed Checking if privacy manager options exists..already exists Checking for noanswer_cid field..already exists Checking for busy_cid field..already exists Checking for chanunavail_cid field..already exists Checking for noanswer_dest field..already exists Checking for busy_dest field..already exists Checking for chanunavail_dest field..already exists Checking for General Setting migrations..not needed Deleting unused globals..done Converting IAX notransfer to transfer if needed..updated 0000 records deleting obsoleted record_in and record_out entries..ok checking for dest field in outbound_routes..already exists checking for continue field in trunks..already exists upgrading any zap trunks to dahdi if foundok Module core successfully installed

SETTING FILE PERMISSIONS..............Done Removing any dangling symlinks Dangling symlinks removed Module core successfully enabled installed Checking logfiles.. Module logfiles successfully installed

SETTING FILE PERMISSIONS..............Done Removing any dangling symlinks Dangling symlinks removed Module logfiles successfully enabled installed Checking callrecording.. Module callrecording successfully installed

SETTING FILE PERMISSIONS..............Done Removing any dangling symlinks Dangling symlinks removed Module callrecording successfully enabled installed Checking ucp.. dependencies pending Checking customappsreg.. Module customappsreg successfully installed

SETTING FILE PERMISSIONS..............Done Removing any dangling symlinks Dangling symlinks removed Module customappsreg successfully enabled installed Checking featurecodeadmin.. Module featurecodeadmin successfully installed

SETTING FILE PERMISSIONS..............Done Removing any dangling symlinks Dangling symlinks removed Module featurecodeadmin successfully enabled installed Checking voicemail.. Checking for General Setting migrations..not needed checking if Voicemail Admin (vmailadmin) is installed..not installed, ok Module voicemail successfully installed

SETTING FILE PERMISSIONS..............Done Removing any dangling symlinks Dangling symlinks removed Module voicemail successfully enabled installed Checking cdr.. Checking if field did is present in cdr table.. did field already present. Checking if field recordingfile is present in cdr table.. recordingfile field already present. Checking if field cnum is present in cdr table.. Adding cnum field to cdr Added field cnum to cdr Checking if field cnam is present in cdr table.. Adding cnam field to cdr Added field cnam to cdr Checking if field outbound_cnum is present in cdr table.. Adding outbound_cnum field to cdr Added field outbound_cnum to cdr Checking if field outbound_cnam is present in cdr table.. Adding outbound_cnam field to cdr Added field outbound_cnam to cdr Checking if field dst_cnam is present in cdr table.. Adding dst_cnam field to cdr Added field dst_cnam to cdr Creating cel if needed..OK Module cdr successfully installed

SETTING FILE PERMISSIONS..............Done Removing any dangling symlinks Dangling symlinks removed Module cdr successfully enabled installed Checking infoservices.. Module infoservices successfully installed

SETTING FILE PERMISSIONS..............Done Removing any dangling symlinks Dangling symlinks removed Module infoservices successfully enabled installed Checking dashboard.. Module dashboard successfully installed

SETTING FILE PERMISSIONS..............Done Removing any dangling symlinks Dangling symlinks removed Module dashboard successfully enabled installed Checking music.. Module music successfully installed

SETTING FILE PERMISSIONS..............Done Removing any dangling symlinks Dangling symlinks removed Module music successfully enabled installed Checking sipsettings.. checking for sipsettings table..none, creating table chan_pjsip support detected. Enabling. populating default codecs..ulaw, alaw, gsm, g726 added Migrate rtp.conf values if needed and initialize Migrating Audio Codecs Module sipsettings successfully installed

SETTING FILE PERMISSIONS..............Done Removing any dangling symlinks Dangling symlinks removed Module sipsettings successfully enabled installed Checking ucp.. dependencies pending Checking ucp.. Detected Missing Dependency of: userman 5.3.3 Downloading Missing Dependency of: userman 5.3.3 Downloading 36840 of 36840 (100%)

Untaring..Done Module userman successfully downloaded Installing Missing Dependency of: userman 5.3.3 Installed Missing Dependency of: userman 5.3.3 Refreshing all UCP Assets, this could take a while... Generating Module Scripts...Done Generating Module CSS...Done Generating Main Scripts...Done Generating Main CSS...Done Done! Module ucp successfully installed

SETTING FILE PERMISSIONS..............Done Removing any dangling symlinks Dangling symlinks removed Module ucp successfully enabled installed Framework has been detected as being in Developer mode, Please make sure to run './install_amp --update-links' manually so that any database or system settings can be updated Module framework successfully installed

SETTING FILE PERMISSIONS..............Done Removing any dangling symlinks Dangling symlinks removed Please update your modules and reload Asterisk by browsing to your server.

  • Note: It's possible that if you click the red 'Update Now' bar BEFORE *
  • updating your modules, your machine will start dropping calls. Ensure *
  • that all modules are up to date BEFORE YOU CLICK THE RED BAR. As long *
  • as this is observed, your machine will be fully functional whilst the *
  • upgrade is in progress. *
  • At This Time Please Restart Asterisk *

@]

  1. %item value=9% Stop asterisk

%commandbox% [@asterisk -rx "core stop now"@]


  1. %item value=10% Start asterisk with amportal script

%commandbox% [@amportal start@]

  1. %item value=11% Open the freepbx URL in a browser, http://ip address you specified and create the default admin user

Attach:screen10.png

  1. %item value=12% Login to freepbx at http://ip address you specified, using your credentials and navigate to .

Attach:screen11.png


  1. %item value=13% Click the red "Apply config" button.
  1. %item value=14% Under Admin->Module admin menu, use “check on line” to check for module updates. Upgrade the Framework module. Click on "Apply config" button.
  1. %item value=15% Go back to module administration and upgrade the remaining modules. Click on "Apply config" button.

-> Later you may go back to module administration and pick further modules from online ones (for example Sip settings, IVR, Queues, Annoucements, Call flow control etc.)


  1. %item value=16% You will need to open the firewall port for sip and rtp. The lines below with --permanent option add the rule permanently but does not take effect unless the firewalld service is restarted, so the lines without permanent add the rule dynamically

%commandbox% [@firewall-cmd --zone=public --add-port=5060-5061/udp firewall-cmd --permanent --zone=public --add-port=5060-5061/udp firewall-cmd --zone=public --add-port=10000-20000/udp firewall-cmd --permanent --zone=public --add-port=10000-20000/udp@]

  1. %item value=17% In order to have amportal start from systemd, it is necessary to modify one of the default settings for sudoers

%commandbox% [@vi /etc/sudoers@]

-> comment out (by putting # in front) %resultbox% [@#Defaults requiretty@]

  1. %item value=18% place the following file in /usr/lib/systemd/system/amportal.service. If you get a 203/EXEC error when starting up, check that the path to the amportal script is correct (by using the command whereis amportal).

%resultbox% [@ [Unit] Description=Freepbx After=network.target remote-fs.target nss-lookup.target httpd.service mariadb.service

[Service] Type=forking ExecStart=/usr/local/sbin/amportal start ExecReload=/usr/local/sbin/amportal reload ExecStop=/usr/local/sbin/amportal stop KillSignal=SIGCONT PIDFile=/var/run/asterisk/asterisk.pid SuccessExitStatus=1

[Install] WantedBy=multi-user.target

@]

  1. %item value=19% Reload systemd files

%commandbox% [@systemctl daemon-reload@]

  1. %item value=20% Check that you can successfully start, view the status and stop freepbx with the following commands

-> If it was already running stop amportal

%commandbox% [@amportal stop@]

-> Then start via systemd service

%commandbox% [@systemctl start amportal.service systemctl status amportal.service systemctl stop amportal.service@]

  1. %item value=21% Set to run on startup and then do a reboot to check if asterisk starts up correctly

%commandbox% [@systemctl enable amportal.service@]