Instala Asterisk e FreePBX no CentOS
Install process for CentOS 5.1
- Fonte: http://www.freepbx.org/28
1. Install CentOS, enabling the following packages:
- DNS Server
- Web Server
- Mail Server
- MySQL Database
- Development Tools
yum install nano
reboot
2. Edit Network settings
nano /etc/sysconfig/network
HOSTNAME=internal.hostname.DOMAIN.com (Set your internal hostname name here)
Ctrl-X to save, 'Y' to confirm
nano /etc/sysconfig/network-scripts/ifcfg-eth0
IPADDR=192.168.1.20
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
NETWORK=192.168.1.0
Ctrl-X to save, 'Y' to confirm
echo \"options {\" > > /etc/named.conf
echo \" directory \\\"/var/named\\\" \" > > /etc/named.conf
echo \" dump-file \\\"/var/named/data/cache_dump.db\\\" \" > > /etc/named.conf
echo \" statistics-file \\\"/var/named/data/named_stats.txt\\\" \" > > /etc/named.conf
echo \"} \" > > /etc/named.conf
echo \"include \\\"/etc/rndc.key\\\" \" > > /etc/named.conf
service named start
chkconfig named on
nano /etc/resolv.conf
search internal.DOMAIN.com (Set your internal domain name here)
nameserver 192.168.1.5
nameserver 127.0.0.1
nano /etc/hosts
127.0.0.1 internal.hostname.DOMAIN.com (Set your internal hostname name here)
127.0.0.1 asterisk1.local
127.0.0.1 localhost
Ctrl-X to save, 'Y' to confirm
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -F
iptables -X
/etc/init.d/iptables save
service network restart
3. Update:
yum -y update
4. Disable Selinux:
echo \"selinux=disabled\" > /etc/selinux/config
reboot
5. Install dependencies and extra packages:
yum install e2fsprogs-devel keyutils-libs-devel krb5-devel libogg libselinux-devel libsepol-devel libxml2-devel libtiff-devel gmp php-pear php-pear-DB php-gd php-mysql php-pdo kernel-devel ncurses-devel audiofile-devel libogg-devel openssl-devel mysql-devel zlib-devel perl-DateManip sendmail-cf
cd /usr/src
wget <a title=\"http://easynews.dl.sourceforge.net/sourceforge/lame/lame-3.97.tar.gz\" href=\"http://easynews.dl.sourceforge.net/sourceforge/lame/lame-3.97.tar.gz\">http://easynews.dl.sourceforge.net/sourceforge/lame/lame-3.97.tar.gz</a>
tar zxvf lame-3.97.tar.gz
cd lame-3.97
./configure
make
make install
6. Install Asterisk and FreePBX:
cd /usr/src
wget <a title=\"http://downloads.digium.com/pub/asterisk/asterisk-1.4-current.tar.gz\" href=\"http://downloads.digium.com/pub/asterisk/asterisk-1.4-current.tar.gz\">http://downloads.digium.com/pub/asterisk/asterisk-1.4-current.tar.gz</a>
wget <a title=\"http://downloads.digium.com/pub/asterisk/asterisk-addons-1.4-current.tar.gz\" href=\"http://downloads.digium.com/pub/asterisk/asterisk-addons-1.4-current.tar.gz\">http://downloads.digium.com/pub/asterisk/asterisk-addons-1.4-current.tar...</a>
wget <a title=\"http://downloads.digium.com/pub/zaptel/zaptel-1.4-current.tar.gz\" href=\"http://downloads.digium.com/pub/zaptel/zaptel-1.4-current.tar.gz\">http://downloads.digium.com/pub/zaptel/zaptel-1.4-current.tar.gz</a>
wget <a title=\"http://downloads.digium.com/pub/libpri/libpri-1.4-current.tar.gz\" href=\"http://downloads.digium.com/pub/libpri/libpri-1.4-current.tar.gz\">http://downloads.digium.com/pub/libpri/libpri-1.4-current.tar.gz</a>
wget <a title=\"http://mirror.freepbx.org/freepbx-2.5.0.tar.gz\" href=\"http://mirror.freepbx.org/freepbx-2.5.0.tar.gz\">http://mirror.freepbx.org/freepbx-2.5.0.tar.gz</a>
tar zxvf asterisk-1.4-current.tar.gz
tar zxvf asterisk-addons-1.4-current.tar.gz
tar zxvf zaptel-1.4-current.tar.gz
tar zxvf libpri-1.4-current.tar.gz
tar zxvf freepbx-2.5.0.tar.gz
cd /usr/src/zaptel-1.4-current
./configure
make
make install
make config
/sbin/ztcfg
echo \"/sbin/ztcfg\" > > /etc/rc.d/rc.local
cd /usr/src/libpri-1.4-current
make clean
make
make install
cd /usr/src/asterisk-1.4-current
useradd -c \"Asterisk PBX\" -d /var/lib/asterisk asterisk
mkdir /var/run/asterisk
mkdir /var/log/asterisk
chown -R asterisk:asterisk /var/run/asterisk
chown -R asterisk:asterisk /var/log/asterisk
chown -R asterisk:asterisk /var/lib/php/session/
nano +231 /etc/httpd/conf/httpd.conf
Change User apache and Group apache to User asterisk and Group asterisk.
Ctrl-X to save, 'Y' to confirm
nano +329 /etc/httpd/conf/httpd.conf
Change AllowOverride None to AllowOverride All
Ctrl-X to save, 'Y' to confirm
./configure
make
make install
/etc/init.d/mysqld start
cd /usr/src/freepbx-2.5.0
mysqladmin create asterisk
mysqladmin create asteriskcdrdb
mysql asterisk < SQL/newinstall.sql
mysql asteriskcdrdb < SQL/cdr_mysql_table.sql
mysql
GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY 'SOMEPASSWORD'
GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY 'SOMEPASSWORD'
flush privileges
\\q
mysqladmin -u root password 'SOMEPASSWORD'
cd /usr/src/asterisk-addons
./configure
make
make install
cd /usr/src/freepbx-2.5.0
./start_asterisk start
yum install php-pear-DB
yum install php-mysql
./install_amp --username=asteriskuser --password=SOMEPASSWORD
echo \"/usr/local/sbin/amportal start\" > > /etc/rc.local
chkconfig httpd on
chkconfig mysqld on
Open browser to <a title=\"http://ipaddressofpbx/admin\" href=\"http://ipaddressofpbx/admin\">http://ipaddressofpbx/admin</a>
Click red bar in FreePBX
7. Fix ARI password:
nano -w /var/www/html/recordings/includes/main.conf.php
$ari_admin_password = \"SOMEPASSWORD\"
Ctrl-X to save, 'Y' to confirm
8. Configure Sendmail:
nano /etc/mail/sendmail.mc
define(`SMART_HOST', `relay.DOMAIN.com)dnl
MASQUERADE_AS(`pbx.DOMAIN.com')dnl
FEATURE(`masquerade_envelope')dnl
Ctrl-X to save, 'Y' to confirm
make -C /etc/mail
9. Edit sip_nat.conf for proper NAT:
nano /etc/asterisk/sip_nat.conf
localnet=192.168.1.0/255.255.255.0
externhost=pbx.DOMAIN.com (Set your external hostname name here)
externrefresh=10
fromdomain=DOMAIN.com (Set your external domain name here)
nat=yes
qualify=yes
canreinvite=no
Ctrl-X to save, 'Y' to confirm
10. Add extra codecs to config:
nano /etc/asterisk/sip_custom.conf
allow=gsm
allow=h261
allow=h263
allow=h263p
videosupport=yes
Ctrl-X to save, 'Y' to confirm
nano /etc/asterisk/iax_custom.conf
allow=gsm
allow=h261
allow=h263
allow=h263p
videosupport=yes
Ctrl-X to save, 'Y' to confirm
asterisk -rx reload
11. Edit voicemail config:
nano /etc/amportal.conf
If the web interface on your PBX will be accessible on the internet:
AMPWEBADDRESS=pbx.DOMAIN.com (Set your external hostname name here)
If the web interface on your PBX will be accessible only on your internal network:
AMPWEBADDRESS=internal.hostname.DOMAIN.com (Set your internal hostname name here)
Ctrl-X to save, 'Y' to confirm
or if your users will NOT have access to the web interface:
nano /etc/asterisk/vm_email.inc
remove \"Visit http://AMPWEBADDRESS/cgi-bin/vmail.cgi?action=login& mailbox=${VM_MAILBOX} to check your voicemail with a web browser.\\n\"
Ctrl-X to save, 'Y' to confirm
nano /etc/asterisk/vm_general.inc
serveremail=pbx@DOMAIN.com Who the e-mail notification should appear to come from
fromstring=DOMAIN PBX Real name of email sender
Ctrl-X to save, 'Y' to confirm
12. Fix MOH directory:
ln -s /var/lib/asterisk/moh /var/lib/asterisk/mohmp3
asterisk -rx reload
14. Open browser to <a title=\"http://ipaddressofpbx\" href=\"http://ipaddressofpbx/\">http://ipaddressofpbx</a>
Done!
Optional Package:
ConfControl is a partial rewrite of Web-MeetMe which includes only the conference control page and not all the scheduling options. It includes a replacement index.html page which adds a link to ConfControl from the FreePBX home page.
cd /var/www/html
wget <a title=\"http://www.2l2o.com/asterisk/ConfControl1.0.tar.gz\" href=\"http://www.2l2o.com/asterisk/ConfControl1.0.tar.gz\">http://www.2l2o.com/asterisk/ConfControl1.0.tar.gz</a>
tar zxvf ConfControl1.0.tar.gz