Code Search for Developers
 
 
  

INSTALL from freePBX at Krugle


Show INSTALL syntax highlighted

###
Installing FreePBX

### 
Important Warning!
FreePBX _will_ overwrite any exisiting asterisk configurations you may have. This project attempts
to manage as much of asterisk as it can, and this means lots of automatically generated dialplans.
Please visit both the Documentation wiki (http://www.aussievoip.com.au/wiki/FreePBX) and the Dev
wiki (http://www.freepbx.org/wiki) for instructions, hints and tips. As a rule of thumb, any 
existing sip, iax, or extensions files can be copied to the same name with _custom.conf appended,
and things will continue to work as before.


###
FreePBX has several requirements, including the following packages (names may vary based on distro):

	libxml2
	libxml2-devel
	libtiff
	libtiff-devel
	lame
	httpd (or Apache2)
	mysql (or mysql-client)
	mysql-devel (or libmysqlclient10-dev)
	mysql-server
	php (or php4) 
	(on debian, also install libapache2-mod-php4)
	php4-pear (if pear is not included with your php)
	php-mysql
	(on SUSE, also install php4-gettext and php4-session)
	php-gd
	openssl
	openssl-devel (or libssl-dev)
	kernel-devel (or linux-source)
	perl
	perl-CPAN
	bison
	ncurses-devel (or libncurses5-dev)
	audiofile-devel (or libaudiofile-devel)
	curl
	sox

	
###
FreePBX requires the following changes to php and apache for uploading new MOH files:
(Note: Thise are reasonably distro specifc. Check http://www.aussievoip.com/wiki/FreePBX 
for more documentation)


	- vi +482 /etc/php.ini  (or /etc/php4/apache2/php.ini)
		upload_max_filesize=20M
	- vi +14 /etc/httpd/conf.d/php.conf (if you have it)
		LimitRequestBody 20000000

###
Download the latest FreePBX files:

	- download the latest FreePBX tarball to /usr/src
	- tar -zxvf freepbx<version>.tar.gz

###
Getting Asterisk and Zaptel from SVN or download the latest Asterisk and Zaptel source archives
(FreePBX uses the v2.0 branch)

	- cd /usr/src
	- svn checkout http://svn.digium.com/svn/asterisk/branches/1.2 asterisk-1.2
	- svn checkout http://svn.digium.com/svn/zaptel/branches/1.2 zaptel-1.2
	- svn checkout http://svn.digium.com/svn/libpri/branches/1.2 libpri-1.2

###
For TDM zap devices (FXO/FXS):

	- cd /usr/src/zaptel
	- make && make install

	If you will be using a Digium telephony card that supports T1/E1 signaling do this step as well:
	- cd /usr/src/libpri
	- make && make install
	
###
Patching Asterisk with softfax/spandsp.

	- Download the latest 0.2 spandsp files from http://www.soft-switch.org
	- cd /usr/src/spandsp-xxx
	- ./configure
	- make && make install

	The spandsp libraries are installed to /usr/local/lib.  Therefore /usr/local/lib must be added to the LD_LIBRARY_PATH environment variable of the user that starts the asterisk process. To be safe, also add it to /etc/ld.so.conf and run ldconfig.

	Copy the following files (from soft-switch.org) to /usr/src/asterisk/apps/ :

	- cp app_rxfax.c /usr/src/asterisk/apps/
	- cp app_txfax.c /usr/src/asterisk/apps/
	- cp apps_makefile.patch /usr/src/asterisk/apps/

	- cd /usr/src/asterisk/apps
	- patch < apps_makefile.patch

		
###
Create a group and non-root user:

	- groupadd asterisk
	- useradd -c "asterisk PBX" -d /var/lib/asterisk -g asterisk asterisk
	
	
###
Building Asterisk and configuring it to run as a non-root user

	- mkdir /var/run/asterisk
	- cd /usr/src/asterisk
	- make clean && make && make install

###
Get and build cdr_mysql module for asterisk

	- cd /usr/src/asterisk-addons
	- perl -p -i.bak -e 's/CFLAGS.*D_GNU_SOURCE/CFLAGS+=-D_GNU_SOURCE\nCFLAGS+=-DMYSQL_LOGUNIQUEID/' Makefile
	- make clean && make && make install
	
###
Install asterisk-sounds

	- cd /usr/src/asterisk-sounds
	- make install
	
###
Setting up MySQL for CDR and FreePBX web interface

	- /usr/bin/mysql_install_db
	- /etc/init.d/mysqld start (or /etc/init.d/mysql start) 

	- mysqladmin -u root password 'db_root_pwd'
	- mysqladmin create asteriskcdrdb -p
	- mysql --user=root --password=db_root_pwd asteriskcdrdb < /usr/src/freepbx<version>/SQL/cdr_mysql_table.sql
	
	- mysqladmin create asterisk -p
	- mysql --user root -p asterisk < /usr/src/freepbx<version>/SQL/newinstall.sql

	
###
Grant access to these two databases you just created

**Note the default mysql username/password is asteriskuser/amp109.  
**If you change either of these, you will be prompted for them while running ./install below

	- mysql --user root -p

		mysql> GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY 'amp109';
		Query OK, 0 rows affected (0.00 sec)

		mysql> GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY 'amp109';
		Query OK, 0 rows affected (0.00 sec)
		
		mysql> quit

###
Run the "install" script to install all the FreePBX files:  

	- /usr/src/FreePBX/install_amp
	
###
Configure zaptel driver:

	a. Edit /etc/zaptel.conf to reflect installed Digium telephony card(s).
	
        Only the parameters/values relevant to a TDM400P with 4 FXO modules are included below:

	fxsks=1-4
	loadzone=us
	defaultzone=us

        Only the parameters/values relevant to a TE110P (T1 configuration) are included below:
        
	span=1,1,0,esf,b8zs
	bchan=1-23
	dchan=24
	loadzone=us
	defaultzone=us

	b. ztcfg -v

			Zaptel Configuration
			======================
			
			1 channels configured.
	
	If you get a warning about unable to open master device /dev/zap/ctl, that's ok.  It's a result
	of the zaptel module(s) not loaded yet.

	Detailed information with regard to Asterisk's configuration files can be found here:
	http://voip-info.org/wiki-Asterisk+config+files

###
Configure zapata module in asterisk config.

	- edit /etc/asterisk/zapata.conf to reflect installed digium interfaces (see zapata.conf.template)

	Only the parameters/values relevant to a TDM400P with 4 FXO modules are included below:

	[channels]
	language=en
	#include zapata_additional.conf
	context=from-pstn
	signalling=fxs_ks
	faxdetect=incoming
	usecallerid=yes
	callerid=asreceived
	echocancel=yes
	callprogress=no
	busydetect=no
	echocancelwhenbridged=no
	echotraining=800
	group=0
	channel=1-4


	Only the parameters/values relevant to a TE110P (T1 configuration) are included below:

	[channels]
	language=en
	#include zapata_additional.conf
	context=from-pstn
	switchtype=national
	pridialplan=national
	signalling=pri_cpe
	faxdetect=incoming
	usecallerid=yes
	echocancel=yes
	callerid=asreceived
	echocancelwhenbridged=no
	echotraining=800
	group=0
	channel=1-23


	Note: if your configuration is using zap channels as FXS endpoints, zapata.conf must
	contain the following line in order to provision these endpoints in FreePBX's Extensions admin:
	#include zapata_additional.conf

	Detailed information with regard to Asterisk's configuration files can be found here:
	http://voip-info.org/wiki-Asterisk+config+files

###
httpd (Apache) configuration

	- Edit /etc/httpd/conf/httpd.conf (or /etc/apache2/apache2.conf) so that:

		User asterisk
		Group asterisk
		
###
Chown the PHP session.save_path directory:

	- chown asterisk /var/lib/php/session

		
###
Amportal Control Script

	FreePBX's amportal control script starts, stops or kills services in the FreePBX environment, and sets permissions on directories/files in the
	FreePBX environment:

	[root@pbx root]# amportal
	
	----------AMP Control Script-----------
	Usage: amportal start|stop|kill|chown
	start: Starts Asterisk and Flash Operator Panel server
	stop: Gracefully stops Asterisk and the FOP server
	kill: Kills Asterisk and the FOP server
	chown: Sets appropriate permissions on files
	
	The amportal script is the recommended way to stop and start asterisk:
	
	[root@pbx root]# /usr/sbin/amportal stop
	[root@pbx root]# /usr/sbin/amportal start

###
Auto Start

	The module/driver that you load at boot time depends upon whether you are using a
	TDM400P or TE110P. The wcfxs module should be loaded for the former and the wcte11xp
	module should be loaded for the latter.

	The following scripts are for RedHat and derivatives that use an rc.local:
	
	Edit /etc/rc.d/rc.local to include the following for the TDM400P:
	#!/bin/sh
	#
	# This script will be executed *after* all the other init scripts.
	# You can put your own initialization stuff in here if you don't
	# want to do the full Sys V style init stuff.
	touch /var/lock/subsys/local
	echo Loading wcfxs
	/sbin/modprobe wcfxs
	/usr/sbin/amportal start

	Edit /etc/rc.d/rc.local to include the following for the TE110P:

	#!/bin/sh
	#
	# This script will be executed *after* all the other init scripts.
	# You can put your own initialization stuff in here if you don't
	# want to do the full Sys V style init stuff.
	touch /var/lock/subsys/local
	echo Loading wcte11xp
	/sbin/modprobe wcte11xp
	/usr/sbin/amportal start

	For Debian and others (?), you'll have to add startup script(s) to /etc/init.d and link them
	to the appropriate rc?.d runlevel.

	
	Also ensure that mysql and apache are set to start at bootup. For RedHat-based systems do the following:
	
	- chkconfig --level 3 httpd on
	- chkconfig --level 3 mysqld on

###
Start everything (or reboot and it should start automagically):

	- As root run:

		service httpd restart
		(or /etc/init.d/apache2 restart)

	- As root run:

		amportal start

	- Point your browser to:

		http://[ip address]  (default login is admin/admin)

If you notice any errors or updates that are needed to this document, please e-mail:
info@coalescentsystems.ca




See more files for this project here

freePBX

FreePBX is the most powerful GUI (Web Based) configuration tool for Asterisk. It provides everything that a standard legacy phone system can, plus a huge amount of new features. All documentation and information is avalable from http://www.freepbx.org

Project homepage: http://sourceforge.net/projects/amportal
Programming language(s): PHP,Shell Script,SQL
License: other

  SQL/
    cdr_mysql_table.sql
    newinstall.sql
    newinstall.sqlite3.sql
  amp_conf/
    agi-bin/
      phpagi-asmanager.php
      phpagi.php
    astetc/
      cdr_mysql.conf
      enum.conf
      extensions_custom.conf.sample
      features.conf
      indications.conf
      logger.conf
      manager.conf
      meetme.conf
      modem.conf
      modules.conf
      musiconhold.conf
      phone.conf
      phpagi.conf
      privacy.conf
      queues.conf
      rtp.conf
      vm_email.inc
      vm_general.inc
      voicemail.conf.template
      zapata.conf.template
    bin/
      archive_recordings
      bounce_op.sh
      freepbx-cron-scheduler.php
      freepbx_engine
      libfreepbx.confgen.php
      module_admin
      retrieve_conf
      retrieve_op_conf_from_mysql.pl
      retrieve_parse_amportal_conf.pl
    htdocs/
      _asterisk/
        animlogo.gif
        play.gif
        vmail.css
      admin/
        cdr/
          css/
          images/
          jpgraph_lib/
          lib/
          CHANGELOG.txt
          about.php
          call-comp.php
          call-daily-load.php
          call-last-month.php
          call-log.php
          cdr.php
          counter.txt
          encrypt.js
          export_csv.php
          export_pdf.php
          graph_hourdetail.php
          graph_pie.php
          graph_stat.php
          graph_statbar.php
          info.txt
        common/
          db_connect.php
          ie.css
          interface.dim.js
          jquery-1.1.3.1.js
          jquery.dimensions.js
          jquery.tabs-2.7.4.js
          json.inc.php
          libfreepbx.javascripts.js
          mainstyle-alternative.css
          mainstyle.css
          php-asmanager.php
          script.js.php
          script.legacy.js
          tabber-minimized.js
        i18n/
          de_DE/
          es_ES/
          fr_FR/
          he_IL/
          it_IT/
          pt_PT/
          ru_RU/
          readme.txt
        images/
          accept.png
          amp.png
          arrow_rotate_clockwise.png
          blank.gif
          cancel.png
          category1.png
          database_gear.png
          delete.gif
          freepbx.png
          freepbx_large.png
          freepbx_small.png
          header-back.png
          loading.gif
          logo.png
          modules-current1.png
          modules-hover1.png
          modules1.png
          scrolldown.gif
          scrollup.gif
          shadow-corner.png
          shadow-side-background.png
          shadow-side.png
          shadow-top.png
          tab-first-current.png
          tab-first.png
          tab-hover.png
          tab-select.png
          tab.png
          trash.png
          watermark.png
        modules/
          _cache/
          .htaccess
          import.sh
          modlist.sh
          remove.sh
          status.sh
          update.sh
        views/
          freepbx.php
          freepbx_admin.php
          freepbx_reload.php
          freepbx_reloadbar.php
          loggedout.php
          menuitem_disabled.php
          noaccess.php
          panel.php
          reports.php
          unauthorized.php
          welcome.php
          welcome_nomanager.php
        components.class.php
        config.php
        extensions.class.php
        favicon.ico
        featurecodes.class.php
        functions.inc.php
        header.php
        header_auth.php
        index.php
        page.modules.php
        panel.php
        reports.php
      recordings/
        includes/
        locale/
        misc/
      index.html
      mainstyle.css
    htdocs_panel/
    mohmp3/
    sbin/
    sounds/
  buildtools/
  docs/
  upgrades/
  CHANGES
  CONTRIB.txt
  ChangeLog
  FAQ
  INSTALL
  LICENSE
  UPGRADE
  amportal.conf
  apply_conf.sh
  asterisk.conf
  freepbx.pot
  install_amp
  libfreepbx.install.php
  setup_svn.php
  sqlite.readme
  start_asterisk
  update_l10n.sh