#下载freeswitch及其模块依赖的库 这边用了镜像站速度比较快
git clone https://hub.yzuu.cf/signalwire/freeswitch.git
git clone https://hub.yzuu.cf/freeswitch/sofia-sip.git
git clone https://hub.yzuu.cf/signalwire/libks.git
git clone https://hub.yzuu.cf/signalwire/signalwire-c.git
git clone https://hub.yzuu.cf/libav/libav
#进入和编译每个模块
cd sofia-sip
./bootstrap.sh -j
./configure
make
sudo make install
sudo ldconfig
cd ../libks
cmake .
make
sudo make install
sudo ldconfig
cd ../signalwire-c
cmake .
make
sudo make install
sudo ldconfig
cd ../libav
./configure --enable-shared
make
sudo make install
sudo ldconfig
#编译freeswitch, export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig这条命令告诉fs去哪里找sofia-sip和spandsp
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
cd ../freeswitch
./bootstrap.sh -j
./configure CFLAGS=-Wno-error
报错
./include/fspr_general.h:33:14: error: ‘__DARWIN_NSIG’ undeclared here (not in a function)
33 | #define NSIG __DARWIN_NSIG
将libs\apr\include\fspr_general.h 里第33行改为
#if !defined(NSIG) && !defined(_ANSI_SOURCE) && defined(_DARWIN_C_SOURCE)
继续编译
报错avformat.c: In function ‘mod_avformat_alloc_output_context2’:
avformat.c:405:18: error: ‘AVFormatContext’ has no member named ‘url’
405 | s->url = av_strdup(filename);
查看为版本号判断错误 将src\mod\applications\mod_av\avformat.c里402行改为
#if 1//(LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58,7,100))
重新编译
编译通过