Debian 9 安装 asterisk
https://linuxize.com/post/how-to-install-asterisk-on-debian-9/
configure 过程中遇到的问题
具体安装过程,网上说明很多,仅仅记录中间遇到的问题及解决办法
1) configure 过程中,提示 uuid support not found (this typically means the libjansson development package is missing):
解决办法:
yum -y install uuid-devel
yum -y install libuuid libuuid-devel
2)configure 过程中,提示: JSON support not found
解决:
下载:jansson-2.5.tar.gz
tar -zxf jansson-2.5.tar.gz
cd jansson*
./configure --prefix=/usr/ && make clean && make && make install && ldconfig
3 configure 过程中提示:'libxml2'development package,
configure: *** The Asterisk menuselect tool requires the 'libxml2' development package.
configure: *** Please install the 'libxml2' development package.
下载libxml2-2.6.32.tar.gz:http://download.chinaunix.net/down.php?id=28493&ResourceID=6095&site=1
解压:tar -zxf libxml2-2.6.32.tar.gz
编译、安装
4). configure: error: *** Asterisk now uses SQLite3 for the internal Asterisk database.
解决办法:
下载sqlite-3.3.5.tar.gz:http://download.chinaunix.net/down.php?id=19777&ResourceID=9862&site=1
解压:tar -zxf sqlite-3.3.5.tar.gz
编译、安装
至此,可以 configure通过,然后 make,make install, make samples 即可完成安装。
5)启动asterisk时报错显示:
asterisk: error while loading shared libraries: libasteriskssl.so.1: cannot open shared object file: No such file or directory
或,asterisk: error while loading shared libraries: libjansson.so.4: cannot open shared object file: No such file or directory
是安装的动态链接库文件的路径不对,默认安装的/usr/local/lib目录下了,了,(可在系统根目下,用 find -name libasteriskssl* 命令搜索文件所在位置)。
用ln命令将需要的so文件链接到/usr/lib或者/lib这两个默认的目录下边
ln -s /usr/local/lib/*.so /usr/lib
ln -s /usr/local/lib/*.so.4 /usr/lib
ln -s /usr/local/lib/*.so.1 /usr/lib
然后重新载入:ldconfig 即可!
安装libpri库报错
重新编译asterisk
find / -name chan_dahdi.so 查找到这个文件的位置。进去后 执行ldd 命令 如图显示才算安装成功。
/usr/lib/asterisk/modules
如果没有正常显示,请确保libpri安装成功,然后先卸载asterisk 再重新编译安装saterisk。
重新载入:ldconfig
修改最大文件数,修改RTP 范围
编译asterisk报错提示:
recipe for target ‘chan_sip.so’ failed
或者
recipe for target ‘chan_iax.so’ failed
解决方法:
in order to compile, it needs this flag in
./configure LDFLAGS="-z muldefs"
it would be worth to add it to the project