前提下先安装 ubuntu 10.10 + LAMP + asterisk asterisk的安装可参考前文 1)apt-get install php5-gd php-pear php-db sox curl phpmyadmin 2)下载 freepbx #cd /tmp #wget http://mirror.freepbx.org/freepbx-2.9.0.tar.gz #cd /usr/src #sudo tar xvzf /tmp/freepbx-2.9.0.tar.gz #cd freepbx-2.8.1/ 3)建立 freepbx 数据库 mysqladmin create asterisk -u root -p mysqladmin create asteriskcdrdb -u root -p mysql -u root -p asterisk < SQL/newinstall.sql mysql -u root -p asteriskcdrdb < SQL/cdr_mysql_table.sql
4)数据库建表
mysql -u root -p mysql>GRANT ALL PRIVILEGES ON asterisk.* TO asterisk@localhost IDENTIFIED BY '填上asterisk的密码'; mysql>GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asterisk@localhost IDENTIFIED BY '填上asterisk的密码'; mysql>flush privileges; mysql>quit;
5)备份一下配置文件
cp /etc/asterisk/modules.conf ~/asterisk-modules.conf
6)运行 freepbx 安装脚本 ./install_amp
Enter your USERNAME to connect to the ‘asterisk’ database:
[asteriskuser] asterisk
Enter your PASSWORD to connect to the ‘asterisk’ database:
[amp109] badasspassword
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] /var/www/pabx.domain/public
Enter the IP ADDRESS or hostname used to access the AMP web-admin:
[xx.xx.xx.xx] pabx.domain
Enter a PASSWORD to perform call transfers with the Flash Operator Panel:
[passw0rd] password
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]
7)
cp ~/asterisk-modules.conf /etc/asterisk/modules.conf
adduser www-data asterisk
/etc/amportal.conf
:
AMPASTERISKUSER=www-data
AMPASTERISKGROUP=asterisk
AMPASTERISKWEBUSER=www-data
AMPASTERISKWEBGROUP=asterisk
amportal start
update-rc.d -f asterisk remove
sed -e s/BACKGROUND=0/BACKGROUND=1/ -i /usr/sbin/safe_asterisk
Edit your /etc/rc.local and add the following line before the exit 0 line.
/usr/local/sbin/amportal start
重启服务器即可!