freeswitch 安装常见问题汇总
freeswitch 编译过程中可能遇到的问题:
可能遇到的问题及解决方案
1,报错:
make[4]: Entering directory '/home/root/code/freeswitch-1.8.5/src/mod/applications/mod_signalwire'
Makefile:930: *** You must install libks to build mod_signalwire. Stop.
make[4]: Leaving directory '/home/root/code/freeswitch-1.8.5/src/mod/applications/mod_signalwire' Makefile:683: recipe for target 'mod_signalwire-all' failed
make[3]: *** [mod_signalwire-all] Error 1 make[3]: Leaving directory '/home/root/code/freeswitch-1.8.5/src/mod' Makefile:591: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/root/code/freeswitch-1.8.5/src' Makefile:3494: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory '/home/root/code/freeswitch-1.8.5'
Makefile:1255: recipe for target 'all' failed make: *** [all] Error 2
- 解决步骤如下:
# 下载并编译libks cd /usr/local/src git clone https://github.com/signalwire/libks.git
cd libks
cmake .
这时很大可能会遇到下面这个问题:
2,报错:
-- Checking for module 'uuid' -- No package 'uuid' found CMake Error at /home/root/tools/cmake-3.13.3-Linux-x86_64/share/cmake-3.13/Modules/FindPkgConfig.cmake:452 (message): A required package was not found Call Stack (most recent call first): /home/root/tools/cmake-3.13.3-Linux-x86_64/share/cmake-3.13/Modules/FindPkgConfig.cmake:622 (_pkg_check_modules_internal) cmake/FindUUID.cmake:15 (pkg_check_modules) CMakeLists.txt:294 (include) -- Configuring incomplete, errors occurred! See also "/home/root/code/libks/CMakeFiles/CMakeOutput.log". See also "/home/root/code/libks/CMakeFiles/CMakeError.log".
- 解决步骤如下
# 解决方法:下载并编译libuuid源码 wget https://jaist.dl.sourceforge.net/project/libuuid/libuuid-1.0.3.tar.gz
tar -zxvf libuuid-1.0.3.tar.gz
cd libuuid-1.0.3
./configure make make install # 重新执行libks的 cmake . #### 问题解决。然后执行libks的 make make install
3,报错:
make[4]: Entering directory '/home/root/code/freeswitch-1.8.5/src/mod/applications/mod_signalwire' Makefile:930: *** You must install signalwireto build mod_signalwire. Stop. make[4]: Leaving directory '/home/root/code/freeswitch-1.8.5/src/mod/applications/mod_signalwire' Makefile:683: recipe for target 'mod_signalwire-all' failed make[3]: *** [mod_signalwire-all] Error 1 make[3]: Leaving directory '/home/root/code/freeswitch-1.8.5/src/mod' Makefile:591: recipe for target 'all-recursive' failed make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory '/home/root/code/freeswitch-1.8.5/src' Makefile:3494: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory '/home/root/code/freeswitch-1.8.5' Makefile:1255: recipe for target 'all' failed make: *** [all] Error 2
- 解决方法如下
# 解决方法:下载并编译signalwire-c cd /usr/local/src git clone https://github.com/signalwire/signalwire-c.git cd signalwire-c cmake .
make
make install
4,这时有可能会出现问题:
报错:
CMake Error at CMakeLists.txt:168 (string): string sub-command REPLACE requires at least four arguments. -- Configuring incomplete, errors occurred! See also "/home/root/code/signalwire-c/CMakeFiles/CMakeOutput.log".
- 解决方法如下
# 阅读CMakeLists.txt,发现出问题的地方是使用git命令生成changelog的。对编译代码无影响。注释掉相关内容: # Get git log info #execute_process(COMMAND ${GIT_EXECUTABLE} log --no-merges --pretty=format:"%n [%an]%n * %s" --since="last month" # OUTPUT_VARIABLE CHANGELOG # WORKING_DIRECTORY . # OUTPUT_STRIP_TRAILING_WHITESPACE) #string(REPLACE """ "" CHANGELOG ${CHANGELOG}) ## Create changelog #file(WRITE changelog.Debian ${CHANGELOG_HEADER} ${CHANGELOG} ${CHANGELOG_FOOTER}) #execute_process(COMMAND ${GZIP_CMD} -f -9 -n changelog.Debian) # Install changelog #install(FILES "${CMAKE_BINARY_DIR}/changelog.Debian.gz" COMPONENT "runtime" DESTINATION "share/doc/${CPACK_DEBIAN_PACKAGE_NAME}") # 在signalwire下重新执行 cmake . make make install
5,报错:
- 解决方法如下
更换openssl 版本1.1.1
执行命令查看 openssl version
OpenSSL 1.1.1 11 Sep 2018
OpenSSL 1.1.1 11 Sep 2018
6,报错
checking for spandsp >= 3.0... configure: error: no usable spandsp; please install spandsp3 devel package or equivalent
checking for sofia-sip-ua >= 1.xx.xx... configure: error: no usable sofia-sip; please install sofia-sip-ua devel package or equivalent
- 解决方法如下
git cloen https://github.com/freeswitch/sofia-sip.git
如果网络不太好,git可能下载不下来,可以直接下载sofia-sip的zip压缩包
cd sofia-sip
./bootstrap.sh
./configure
make
make install
安装spandsp:
git clone https://github.com/freeswitch/spandsp
如果网络不太好,git可能下载不下来,可以直接下载spandsp的zip压缩包
cd spandsp
./bootstrap.sh
./configure
make
make install
解决方法如下
使用安装源中的uuid库,修改软件链接sudo apt-get install uuid-dev
ln -sf /usr/lib/x86_64-linux-gnu/libuuid.so.1 /usr/local/lib/libuuid.so.1
再次运行后,不会再出现如上的提示信息
8,报错信息:
解决方法如下
报x264_bit_depth声明未找到的问题,导致编译失败。
应该是x264某个版本之后哪位大神将原来的x264_bit_depth改成了大写的X264_BIT_DEPTH。所以一个思路找到这个定义修改之前的某个版本的x264重新clone下来进行编译。后来发现还有另外一种方法更为简便,就是直接修改libx264.c文件,将此文件中的所有x264_bit_depth直接替换为X264_BIT_DEPTH,然后重新进行编译
应该是x264某个版本之后哪位大神将原来的x264_bit_depth改成了大写的X264_BIT_DEPTH。所以一个思路找到这个定义修改之前的某个版本的x264重新clone下来进行编译。后来发现还有另外一种方法更为简便,就是直接修改libx264.c文件,将此文件中的所有x264_bit_depth直接替换为X264_BIT_DEPTH,然后重新进行编译