爬虫
分类: LINUX
2015-09-29 18:37:00
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/
chown -R asterisk /var/lib/php #比较重要
./configure
提示安装一堆的devel库,看清楚提示。
jansson这个包yum源没有,需要下载安装
/>
make
make install
yum install doxygen
make samples
make progdocs
cd /usr/local/src/freepbx-2.9.0/
mysqladmin create asterisk –uroot –p123456
mysqladmin create asteriskcdrdb –uroot –p123456
mysql asterisk < SQL/newinstall.sql –uroot –p123456
mysql asteriskcdrdb < SQL/cdr_mysql_table.sql –uroot –p123456
mysql –uroot –p123456
GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asterisk@localhost IDENTIFIED BY ‘123456’;
GRANT ALL PRIVILEGES ON asterisk.* TO asterisk@localhost IDENTIFIED BY ‘123456’;
grant all privileges on *.* to asterisk@localhost identified by “123456”;
flush privileges;
exit
用asterisk登陆一下mysql试试:mysql –uasterisk –p123456
如果成功,表明设置正确。
修改httpd。conf文件
User asterisk
Group asterisk
AllowOverride ALL
./start_asterisk start
mkdir /var/www/html/asterisk/
mkdir /var/www/html/asterisk/cgi-bin
chown -R asterisk:asterisk /var/www/html/asterisk
yum install php-posixpear install db //需要,否则下面一句过不去
./install_amp
=======================================
[root@localhost freepbx]# ./install_amp
Checking for PEAR DB..OK
Checking for PEAR Console::Getopt..OK
Checking user..OK
Checking if Asterisk is running..running with PID: 44651..OK
Checking for /etc/amportal.conf../etc/amportal.conf does not exist, copying default
Creating new /etc/amportal.conf
Enter your USERNAME to connect to the 'asterisk' database:
[asteriskuser] asterisk
Enter your PASSWORD to connect to the 'asterisk' database:
[amp109] 123456
Enter the hostname of the 'asterisk' database:
[localhost] 127.0.0.1
Enter a USERNAME to connect to the Asterisk Manager interface:
[admin] admin
Enter a PASSWORD to connect to the Asterisk Manager interface:
[amp111] admin
Enter the path to use for your AMP web root:
[/var/www/html]
If you get the following line at amportal start:
PHP Fatal error: Cannot make static method DB::connect() non static in class freepbx_db in /var/www/freepbx/admin/libraries/freepbx_DB.php on line 57
pear uninstall db
pear install db-1.7.14
===========================
了解了一下 PJSip,发现它并不是什么新鲜玩意,只是 FreePBX 刚把它整合进来。其他 Sip 相关软件,如 CSipSimple,已经用 PJSip 很久了。
之前的 FreePBX 只有一种 Sip,现在 Sip Settings, Sip Extensions, Sip Trunks 都分为 PJSip 和 Sip。有时显示为 Chan PJSip 和 Chan Sip,但又不一致,象我这样的新手误以为 Chan Sip 不是原来的 Sip,因此琢磨到底是该用 PJSip 还是 Sip,浪费了不少时间。
现在 FreePBX 把 PJSip 放在 Sip 前面,PJSip 沿用常用的5060 端口,Sip 则另开了 5061 端口,大有 PJSip 取代 Sip 的意思。而我一开始也没发现 Sip 改端口了,使劲注册分机都是徒劳。
FreePBX 创建了 PJSip 分机,我用 CSipSimple 去注册,CSipSimple 端显示在线,但在 FreePBX PBX Status 里看不到可用分机线。我想是 FreePBX 在应用 PJSip 时有 bug,所以不要强求,用 Sip 已然不错。