freeswitch的安装真的是一个巨坑啊,我踩了无数的坑过来的,把经历记录下避免再次掉坑里
先安装用到的库(包括不限于),可以一起yum安装
yum install -y gcc-c++ libcurl-devel speex-devel sqlite3-devel ldns-devel libedit-devel automake autoconf nasm lua-devel libsndfile-devel libtool libtiff-devel libjpeg-devel openssl-devel
不同版本的包不一样,如果提示不存在,就yum search搜索一下 例如sqlite3-devel 有的就是叫libsqlite3x-devel
下载代码
cd /usr/local/src
//为了方便,我直接从github导入到gitee了,不然下载太慢了
git clone -b v1.10.6 --depth=1 https://gitee.com/qiuyuan/freeswitch.git
cd freeswitch
//下载spandsp
git clone https://gitee.com/qiuyuan/spandsp.git
//下载sofia-sip
git clone https://gitee.com/qiuyuan/sofia-sip.git
后面两个是迟早要用的,所以干脆一起下载吧,可以先安装下面那俩,流程都是一样的,把下面的命令每个目录执行一遍
cd spandsp
./bootstrap.sh -j //我不知道为什么要加-j 看别人加,干脆全部都加上把
./configure //通常有些博客会在这一步后面加一堆参数,我不加好像也差不多,干脆不加了
make && make install
cd ../sofia-sip
./bootstrap.sh -j //我不知道为什么要加-j 看别人加,干脆全部都加上把
./configure //通常有些博客会在这一步后面加一堆参数,我不加好像也差不多,干脆不加了
make && make install
//spandsp安装后还需要执行以下命令,不然还是会提示安装spandsp,这个非常重要!!!很多博客没有写这个
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:${PKG_CONFIG_PATH}
ldconfig
在开始编译freeswitch之前,最好先把module.conf编辑一下,里面有一些module如果用不到的话,就可以注释掉了,也可以减少一些麻烦,比如视频通话,视频会议那些,依赖的环境一大堆,装起来还超麻烦
开始编译freeswitch
cd /usr/local/src/freeswitch
./bootstrap.sh -j
./configure
make
make install
我在make的时候报错
git clone https://github.com/libexpat/libexpat.git
其他问题
You should recreate aclocal.m4 with macros from libtool 2.4.6
运行configure后运行:
aclocal
libtoolize --force
autoconf
autoheader
automake
然后重新运行make
collect2: error: ld returned 1 exit status
重新./configure就好了
fatal error: openssl/ssl.h: No such file or directory
yum install openssl-devel