1、下载相关软件和包
http://ftp.digium.com/pub/asterisk/releases/asterisk-sounds-1.2.1.tar.gz
http://mirror.freepbx.org/freepbx-2.9.0.tar.gz
http://easynews.dl.sourceforge.net/sourceforge/lame/lame-3.97.tar.gz
1、安装asterisk-addons
Description : This package contains additional modules for Asterisk which are, for one reason or another, not included in the normal base distribution. Many of these modules are experimental.
[root@cspbx asterisk-addons-1.6.2.2]# ./configure[root@cspbx asterisk-addons-1.6.2.2]# make[root@cspbx asterisk-addons-1.6.2.2]# make install[root@cspbx asterisk-addons-1.6.2.2]# make samples
2、安装asterisk-sounds
Description : This packet is not for hardware dependency. It’s just the necessarypacket (Include many sound file) for asterisk server.
[root@cspbx asterisk-sounds-1.2.1]# make install
1、安装lame
Description : LAME is an educational tool to be used for learning about MP3 encoding. The goal of the LAME project is to use the open source model to improve the psycho acoustics, noise shaping and speed of MP3. LAME is not for everyone - it is distributed as source code only and requires the ability to use a C compiler. However, many popular ripping and encoding programs include the LAME encoding engine.
[root@cspbx lame-3.97]# ./configure[root@cspbx lame-3.97]# make[root@cspbx lame-3.97]# make install
2、安装freepbx的准备工作,设置freepbx需要的五个密码
password1--- root密码Password2---asterisk数据库密码Password3---freepbx管理员密码Password4---freepbx运营面板密码Password5---asterisk录音接口密码
1、创建数据库
[root@cspbx freepbx-2.9.0]# mysqladmin -uroot –pmysqlpass create asterisk #创建asterisk数据库[root@cspbx freepbx-2.9.0]# mysqladmin -uroot -phmkj.com123 create asteriskcdrdb #创建cdr数据库[root@cspbx freepbx-2.9.0]# mysql -uroot -pmysqlpass asterisk <SQL/newinstall.sql #导入asterisk数据表[root@cspbx freepbx-2.9.0]# mysql -uroot -pmysqlpass asteriskcdrdb <SQL/newinstall.sql #导入cdr数据表
2、创建数据库用户
[root@cspbx freepbx-2.9.0]# mysql –uroot -pmysqlpassmysql> GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskpbx@localhost IDENTIFIED BY 'passowrd2';mysql> GRANT ALL PRIVILEGES ON asterisk.* TO asteriskpbx@localhost IDENTIFIED BY 'passowrd2';mysql> flush privileges;
3、创建用户及相应的用户权限
[root@cspbx freepbx-2.9.0]# useradd -c "Asterisk PBX" -d /var/lib/asterisk asterisk[root@cspbx freepbx-2.9.0]# chown -R asterisk:asterisk /var/run/asterisk[root@cspbx freepbx-2.9.0]# chown -R asterisk:asterisk /var/log/asterisk[root@cspbx freepbx-2.9.0]# chown -R asterisk:asterisk /var/lib/php/session
4、修改apache主配置文件
[root@cspbx freepbx-2.9.0]# sed -i "s/User apache/User asterisk/" /etc/httpd/conf/httpd.conf[root@cspbx freepbx-2.9.0]# sed -i "s/Group apache/Group asterisk/" /etc/httpd/conf/httpd.conf[root@cspbx freepbx-2.9.0]# sed -i "s/AllowOverride None/AllowOverride All/" /etc/httpd/conf/httpd.conf
5、启动asterisk服务
[root@cspbx freepbx-2.9.0]# ./start_asterisk start
6、安装freepbx,报错
[root@cspbx freepbx-2.9.0]# ./install_amp --username=asteriskpbx --password=password2Checking for PEAR DB..FAILED PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Chongqing' for 'CST/8.0/no DST' instead in /home/pro/asterisk/freepbx-2.9.0/amp_conf/htdocs/admin/libraries/utility.functions.php on line 71[FATAL] PEAR must be installed (requires DB.php). Include path: .:/usr/share/pear:/usr/share/ph PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Chongqing' for 'CST/8.0/no DST' instead in /home/pro/asterisk/freepbx-2.9.0/amp_conf/htdocs/admin/libraries/utility.functions.php on line 71
问题处理方法:
[root@cspbx freepbx-2.9.0]# pear install dbWARNING: "pear/DB" is deprecated in favor of "pear/MDB2"WARNING: channel "pear.php.net" has updated its protocols, use "pear channel-updatepear.php.net" to updatedownloading DB-1.7.14.tgz ...Starting to download DB-1.7.14.tgz (133,103 bytes)................done: 133,103 bytesnstall ok: channel://pear.php.net/DB-1.7.14
[root@cspbx freepbx-2.9.0]# vim /etc/php.ini
修改date.timezone = PRC
重新输入安装命令[root@cspbx freepbx-2.9.0]# ./install_amp --username=root --password=mysqlpass
Checking for PEAR DB..OK Checking for PEAR Console::Getopt..OKUsing username: rootUsing password: *********Checking user..OKChecking if Asterisk is running..running with PID: 1563..OKChecking for /etc/amportal.conf../etc/amportal.conf does not exist, copying defaultCreating new /etc/amportal.confEnter your USERNAME to connect to the 'asterisk' database:[asteriskpbx] asteriskpbx 填入连接asterisk数据库的用户名Enter your PASSWORD to connect to the 'asterisk' database:[password2] password2 填入连接asterisk数据库的密码Enter the hostname of the 'asterisk' database:[localhost] localhostEnter a USERNAME to connect to the Asterisk Manager interface:[admin] adminEnter a PASSWORD to connect to the Asterisk Manager interface:[amp111]password3Enter the path to use for your AMP web root:[/var/www/html]Enter the IP ADDRESS or hostname used to access the AMP web-admin:[xx.xx.xx.xx] 填入本机IPEnter a PASSWORD to perform call transfers with the Flash Operator Panel:[passw0rd] password4Use simple Extensions [extensions] admin or separate Devices and Users [deviceanduser]?[extensions]Enter directory in which to store AMP executable scripts:[/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 lineOKReading /etc/amportal.conf..OKChecking for /etc/asterisk/asterisk.conf..OKReading /etc/asterisk/asterisk.conf..OKUsing asterisk as PBX EngineChecking for Asterisk version..1.6.2.13Checking for selinux..OKConnecting to database..OK
进入安装完成
7、修改
[root@cspbx freepbx-2.9.0]# vim /etc/amportal.conf# Default Value: databaseAUTHTYPE=database# Default Value:ARI_ADMIN_USERNAME=admin# User Portal Admin Password# Default Value: ari_passwordARI_ADMIN_PASSWORD=password5Optionally, you can turn off the FOP completely by changing the following settings.FOPRUN=falseFOPDISABLE=true[root@cspbx ~]# echo "/usr/local/sbin/amportal start" >>/etc/rc.local[root@cspbx freepbx-2.9.0]# chown -R asterisk:asterisk /var/www/html[root@cspbx freepbx-2.9.0]#reboot
登录首页界面:
进入后台管理界面
联系客服