Freepbx за nat
Содержание:
- Upgrade Option 2: Upgrade Using Commercial System Administration Pro Module
- Resolving OS configuration file changes
- Install Ubuntu 12.04 LTS 32 or 64-bit
- Install Ubuntu 12.04 LTS 32 or 64-bit
- The Hard Way
- Configuring FreePBX with Remote CDR Database
- Install Ubuntu 12.04 LTS 32 or 64-bit
- Install Ubuntu 12.04 LTS 32 or 64-bit
- Upgrade Option 1: Manual Upgrade Using Version Upgrade Scripts
Upgrade Option 2: Upgrade Using Commercial System Administration Pro Module
If you have the sysadmin module installed and have also purchased the SysAdmin Pro commercial license for it, you can use either the FreePBX web GUI to perform an update, or you can run the script shown below from the command line to auto-update your system to the latest version.
Using the Command Line
/usr/sbin/sysadmin_update_system
Resolving OS configuration file changes
Some upgrade scripts will result in .rpm package updates that need configuration files to be manually cleaned up afterwards. The general procedure is described in the page Cleaning up files from a RPM update.
CentOS is a Trademark of Red Hat and we do not claim to have any relationship with either Red Hat or CentOS
Install Ubuntu 12.04 LTS 32 or 64-bit
Initial System Setup
Install Required Dependencies
apt-get install -y build-essential linux-headers-`uname -r` openssh-server apache2 mysql-server mysql-client bison flex php5 php5-curl php5-cli php5-mysql php-pear php-db php5-gd curl sox libncurses5-dev libssl-dev libmysqlclient15-dev mpg123 libxml2-dev libnewt-dev sqlite3 libsqlite3-dev git
reboot
Install Dependencies for Google Voice
Install iksemel
cd /usr/src wget https://iksemel.googlecode.com/files/iksemel-1.4.tar.gz tar xf iksemel-1.4.tar.gz cd iksemel-1.4 ./configure make make install
Install and Configure Asterisk
Download Asterisk source files.
cd /usr/src wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.4-current.tar.gz wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-11-current.tar.gz
Compile and install DAHDI.
tar xvfz dahdi-linux-complete-current.tar.gz cd dahdi-linux-complete-2.6.1+2.6.1 make all make install make config
cd /usr/src tar xvfz libpri-1.4-current.tar.gz cd libpri-1.4.13
make make install
Compile and install Asterisk
cd .. tar xvfz asterisk-11-current.tar.gz cd asterisk-11.0.1 ./configure contrib/scripts/get_mp3_source.sh make menuselect make make install make config
Install Asterisk-Extra-Sounds
cd /var/lib/asterisk/sounds wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-gsm-current.tar.gz tar xvfz asterisk-extra-sounds-en-gsm-current.tar.gz
Install and Configure FreePBX
Download and extract FreePBX.
export VER_FREEPBX=2.11 cd /usr/src svn co http://www.freepbx.org/v2/svn/freepbx/branches/${VER_FREEPBX} freepbx cd freepbx cp amportal.conf /etc/
Now create the Asterisk user and set ownership permissions.
adduser asterisk --disabled-password --no-create-home --gecos "Asterisk User" chown asterisk. /var/run/asterisk chown -R asterisk. /etc/asterisk chown -R asterisk. /var/{lib,log,spool}/asterisk mkdir /var/www/html chown -R asterisk. /var/www/
A few small modifications to Apache.
sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php5/apache2/php.ini cp /etc/apache2/apache2.conf /etc/apache2/apache2.conf_orig sed -i 's/^\(User\|Group\).*/\1 asterisk/' /etc/apache2/apache2.conf service apache2 restart
Configure Asterisk database in MYSQL.
export MYSQL_ROOT_PW=ROOTPASSWORD export ASTERISK_DB_PW=ROOTPASSWORD mysqladmin -u root -p${MYSQL_ROOT_PW} create asterisk mysqladmin -u root -p${MYSQL_ROOT_PW} create asteriskcdrdb mysql -u root -p${MYSQL_ROOT_PW} asterisk < SQL/newinstall.sql mysql -u root -p${MYSQL_ROOT_PW} asteriskcdrdb < SQL/cdr_mysql_table.sql mysql -u root -p${MYSQL_ROOT_PW}
Set permissions on MYSQL database.
GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY "${ASTERISK_DB_PW}"; GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY "${ASTERISK_DB_PW}"; flush privileges; exit
ln -s /var/lib/asterisk/moh /var/lib/asterisk/mohmp3 amportal start
Install Ubuntu 12.04 LTS 32 or 64-bit
Initial System Setup
Install Required Dependencies
apt-get install -y build-essential linux-headers-`uname -r` openssh-server apache2 mysql-server mysql-client bison flex php5 php5-curl php5-cli php5-mysql php-pear php-db php5-gd curl sox libncurses5-dev libssl-dev libmysqlclient15-dev mpg123 libxml2-dev libnewt-dev sqlite3 libsqlite3-dev pkg-config automake libtool autoconf git subversion uuid uuid-dev
reboot
Install Dependencies for Google Voice
Install iksemel
cd /usr/src wget https://iksemel.googlecode.com/files/iksemel-1.4.tar.gz tar xf iksemel-1.4.tar.gz cd iksemel-* ./configure make make install
Install and Configure Asterisk
Download Asterisk source files.
cd /usr/src wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.4-current.tar.gz wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-11-current.tar.gz
Compile and install DAHDI.
cd /usr/src tar xvfz dahdi-linux-complete-current.tar.gz cd dahdi-linux-complete-* make all make install make config
Compile and install Asterisk
cd /usr/src tar xvfz asterisk-11-current.tar.gz cd asterisk-* ./configure contrib/scripts/get_mp3_source.sh make menuselect make make install make config
Install Asterisk-Extra-Sounds
cd /var/lib/asterisk/sounds wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-gsm-current.tar.gz tar xfz asterisk-extra-sounds-en-gsm-current.tar.gz rm asterisk-extra-sounds-en-gsm-current.tar.gz
Install and Configure FreePBX
Download and extract FreePBX.
export VER_FREEPBX=2.11 cd /usr/src svn co http://www.freepbx.org/v2/svn/freepbx/branches/${VER_FREEPBX} freepbx cd freepbx
Now create the Asterisk user and set ownership permissions.
adduser asterisk --disabled-password --no-create-home --gecos "Asterisk User" chown asterisk. /var/run/asterisk chown -R asterisk. /etc/asterisk chown -R asterisk. /var/{lib,log,spool}/asterisk chown -R asterisk. /usr/lib/asterisk mkdir /var/www/html chown -R asterisk. /var/www/
A few small modifications to Apache.
sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php5/apache2/php.ini cp /etc/apache2/apache2.conf /etc/apache2/apache2.conf_orig sed -i 's/^\(User\|Group\).*/\1 asterisk/' /etc/apache2/apache2.conf service apache2 restart
Configure Asterisk database in MYSQL.
export ASTERISK_DB_PW=amp109 mysqladmin -u root create asterisk -p mysqladmin -u root create asteriskcdrdb -p mysql -u root asterisk -p < SQL/newinstall.sql mysql -u root asteriskcdrdb -p < SQL/cdr_mysql_table.sql
Set permissions on MYSQL database.
mysql -u root -p -e "GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY '${ASTERISK_DB_PW}';" mysql -u root -p -e "GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY '${ASTERISK_DB_PW}';" mysql -u root -p -e "flush privileges;"
ln -s /var/lib/asterisk/moh /var/lib/asterisk/mohmp3 amportal start
The Hard Way
The hard way to install FreePBX is to set-up a machine running Centos, Asterisk, and all other required applications, and then install FreePBX manually.
Configuring FreePBX with Remote CDR Database
There are TWO steps to get CDRs working with a remote MySQL database. This should work on FreePBX Distro versions 6.12 and 10.13 running either Asterisk 11 or 13. Other versions or non-distro systems may also work, but have not been tested. There are legacy options to use non-mysql databases, but it’s not a supported configuration. It is assumed that the remote MySQL database has already been created with user credentials set to appropriate permissions.
- In FreePBX, Advanced settings, scroll to the CDR section and enter necessary details for host, database name, user, password, tables, etc. You can leave fields empty if they are the same default value on the remote database as they are on the local. Click submit, and apply settings. If the details are correct, and the user details have the appropriate permissions, the apply settings will work. If not, you have to address your connectivity issues. Once this step is done, you can browse to Reports, CDR and view the records in the remote database.
- Step one done, you must configure asterisk to write the CDR records to the new database. At the Asterisk CLI, type: «odbc show all», you will see output like:
*CLI> odbc show all ODBC DSN Settings ----------------- Name: asteriskcdrdb DSN: MySQL-test Last connection attempt: 1969-12-31 20:00:00
Take note of the DSN. Now locate the file: /etc/odbc.ini and create a new section that matches the DSN like this:
Description=MySQL connection to remote 'test' database driver=MySQL user=remote_user password=password server=hostname.fqdn.com database=test Port=3306 option=BIG_PACKETS=1 Charset=utf-8
Save the file and restart asterisk with ‘fwconsole restart’ (or ‘amportal restart’). Going back to asterisk again, the earlier command will now show something a bit different:
*CLI> odbc show all ODBC DSN Settings ----------------- Name: asteriskcdrdb DSN: MySQL-test Last connection attempt: 1969-12-31 20:00:00 Pooled: No Connected: Yes
You want to confirm that the database is now connected. Now when you make calls, they get written to the remote database and you can see them in FreePBX. This technique should work in both FreePBX 12 and 13 with Asterisk versions 11 and 13.
Install Ubuntu 12.04 LTS 32 or 64-bit
Initial System Setup
Install Required Dependencies
apt-get install -y build-essential linux-headers-`uname -r` openssh-server apache2 mysql-server mysql-client bison flex php5 php5-curl php5-cli php5-mysql php-pear php-db php5-gd curl sox libncurses5-dev libssl-dev libmysqlclient15-dev mpg123 libxml2-dev libnewt-dev sqlite3 libsqlite3-dev git subversion
reboot
Install Dependencies for Google Voice
Install iksemel
cd /usr/src wget https://iksemel.googlecode.com/files/iksemel-1.4.tar.gz tar xf iksemel-1.4.tar.gz cd iksemel-1.4 ./configure make make install
Install and Configure Asterisk
Download Asterisk source files.
cd /usr/src wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.4-current.tar.gz wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-11-current.tar.gz
Compile and install DAHDI.
tar xvfz dahdi-linux-complete-current.tar.gz cd dahdi-linux-complete-2.6.1+2.6.1 make all make install make config
Compile and install Asterisk
cd /usr/src tar xvfz asterisk-11-current.tar.gz cd asterisk-11.1.0 ./configure contrib/scripts/get_mp3_source.sh make menuselect make make install make config
Install Asterisk-Extra-Sounds
cd /var/lib/asterisk/sounds wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-gsm-current.tar.gz tar xvfz asterisk-extra-sounds-en-gsm-current.tar.gz
Install and Configure FreePBX
Download and extract FreePBX.
export VER_FREEPBX=2.11 cd /usr/src svn co http://www.freepbx.org/v2/svn/freepbx/branches/${VER_FREEPBX} freepbx cd freepbx cp amportal.conf /etc/
Now create the Asterisk user and set ownership permissions.
adduser asterisk --disabled-password --no-create-home --gecos "Asterisk User" chown asterisk. /var/run/asterisk chown -R asterisk. /etc/asterisk chown -R asterisk. /var/{lib,log,spool}/asterisk mkdir /var/www/html chown -R asterisk. /var/www/
A few small modifications to Apache.
sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php5/apache2/php.ini cp /etc/apache2/apache2.conf /etc/apache2/apache2.conf_orig sed -i 's/^\(User\|Group\).*/\1 asterisk/' /etc/apache2/apache2.conf service apache2 restart
Configure Asterisk database in MYSQL.
export MYSQL_ROOT_PW=ROOTPASSWORD export ASTERISK_DB_PW=ROOTPASSWORD mysqladmin -u root -p${MYSQL_ROOT_PW} create asterisk mysqladmin -u root -p${MYSQL_ROOT_PW} create asteriskcdrdb mysql -u root -p${MYSQL_ROOT_PW} asterisk < SQL/newinstall.sql mysql -u root -p${MYSQL_ROOT_PW} asteriskcdrdb < SQL/cdr_mysql_table.sql mysql -u root -p${MYSQL_ROOT_PW}
Set permissions on MYSQL database.
GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY "${ASTERISK_DB_PW}"; GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY "${ASTERISK_DB_PW}"; flush privileges; exit
ln -s /var/lib/asterisk/moh /var/lib/asterisk/mohmp3 amportal start
Install Ubuntu 12.04 LTS 32 or 64-bit
Initial System Setup
Install Required Dependencies
apt-get install -y build-essential linux-headers-`uname -r` openssh-server apache2 mysql-server mysql-client bison flex php5 php5-curl php5-cli php5-mysql php-pear php-db php5-gd curl sox libncurses5-dev libssl-dev libmysqlclient15-dev mpg123 libxml2-dev libnewt-dev sqlite3 libsqlite3-dev git
reboot
Install Dependencies for Google Voice
Install iksemel
cd /usr/src wget https://iksemel.googlecode.com/files/iksemel-1.4.tar.gz tar xf iksemel-1.4.tar.gz cd iksemel-1.4 ./configure make make install
Install and Configure Asterisk
Download Asterisk source files.
cd /usr/src wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.4-current.tar.gz wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-11-current.tar.gz
Compile and install DAHDI.
tar xvfz dahdi-linux-complete-current.tar.gz cd dahdi-linux-complete-2.6.1+2.6.1 make all make install make config
cd .. tar xvfz libpri-1.4-current.tar.gz cd libpri-1.4.13 make make install
Compile and install Asterisk
cd .. tar xvfz asterisk-11-current.tar.gz cd asterisk-11.0.1 ./configure contrib/scripts/get_mp3_source.sh make menuselect make make install make config
Install Asterisk-Extra-Sounds
cd /var/lib/asterisk/sounds wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-gsm-current.tar.gz tar xvfz asterisk-extra-sounds-en-gsm-current.tar.gz
Install and Configure FreePBX
Download and extract FreePBX.
export VER_FREEPBX=2.11 cd /usr/src svn co http://www.freepbx.org/v2/svn/freepbx/branches/${VER_FREEPBX} freepbx cd freepbx cp amportal.conf /etc/
Now create the Asterisk user and set ownership permissions.
adduser asterisk --disabled-password --no-create-home --gecos "Asterisk User" chown asterisk. /var/run/asterisk chown -R asterisk. /etc/asterisk chown -R asterisk. /var/{lib,log,spool}/asterisk mkdir /var/www/html chown -R asterisk. /var/www/
A few small modifications to Apache.
sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php5/apache2/php.ini cp /etc/apache2/apache2.conf /etc/apache2/apache2.conf_orig sed -i 's/^\(User\|Group\).*/\1 asterisk/' /etc/apache2/apache2.conf service apache2 restart
Configure Asterisk database in MYSQL.
export MYSQL_ROOT_PW=ROOTPASSWORD export ASTERISK_DB_PW=ROOTPASSWORD mysqladmin -u root -p${MYSQL_ROOT_PW} create asterisk mysqladmin -u root -p${MYSQL_ROOT_PW} create asteriskcdrdb mysql -u root -p${MYSQL_ROOT_PW} asterisk < SQL/newinstall.sql mysql -u root -p${MYSQL_ROOT_PW} asteriskcdrdb < SQL/cdr_mysql_table.sql mysql -u root -p${MYSQL_ROOT_PW}
Set permissions on MYSQL database.
GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY "${ASTERISK_DB_PW}"; GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY "${ASTERISK_DB_PW}"; flush privileges; exit
ln -s /var/lib/asterisk/moh /var/lib/asterisk/mohmp3 amportal start
Upgrade Option 1: Manual Upgrade Using Version Upgrade Scripts
1) Check the current FreePBX Distro Version. Display the current version file (as above) to confirm the current installed version of FreePBX Distro.
2) Download and run the applicable upgrade script. To install an update script via the Linux command line, use the following commands, substituting the proper scripts from above. Download the upgrade script matching the current version of FreePBX Distro installed, mark it as executable and run it.
cd ~ mkdir upgradescripts cd upgradescripts wget http://upgrades.freepbxdistro.org/stable/6.13.66/upgrade-6.13.66-2.sh chmod +x upgrade-6.13.66-2.sh ./upgrade-6.13.66-2.sh
The FreePBX Distro upgrade script will update both FreePBX components (Asterisk, the FreePBX web GUI) and all base CentOS components.
3) Specific script instructions: Note any special instructions displayed at the end of the upgrade if any are displayed, such as to reboot the system.
4) Confirm the new FreePBX Distro version. Cat the updated (now current) version file (as above) to confirm the current installed version of FreePBX Distro is the expected newer version.