FreeSwitch(一):安装

# 总体环境:Ubuntu 20.04 LTS + freeswitch.1.10.5

# 第一步下载源代码:

  git clone https://github.com/signalwire/freeswitch.git

#.Ubuntu 20.04 LTS 环境安装以下依赖:

  apt-get -y install build-essential subversion automake autoconf wget libtool libtool-bin libncurse5-dev libssl-dev libsndfile-dev

# 编译安装 

  ./bootstrap.sh

  ./configure (--enable-core-pgsql-support)

  sudo make

  sudo make install

 

# 由于安装的是最新版本fs.1.10.5,中途会提示你缺少spandsp,然后这玩意需要编译安装(https://github.com/freeswitch/sofia-sip 这里有教程)

  git clone http://github.com/freeswitch/spandsp.git

  ./bootstrap.sh

  ./configure

  sudo make

  sudo make install  

  export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:${PKG_CONFIG_PATH}  【正是缺少执行这条,导致我装失败好久】

  ldconfig

  可是,装完提示任然不存在。。。。救我。。。

 

#.安装sofia-sip

 cd /usr/local/src/freeswitch-1.10.5.-release
 git clone https://github.com/freeswitch/sofia-sip.git
 cd sofia-sip
 sh autogen.sh (if building from darcs)

 ./configure
 make
 make install
 ldconfig

 然后重新编译fs

 

# 接下来。。。。

环境:Ubuntu 20.04 LTS

一. 环境搭建:

Freeswitch依赖的包安装

sudo apt-get install git libcurl4-openssl-dev libexpat1-dev libssl-dev libtiff4-dev libx11-dev unixodbc-dev python-dev zlib1g-dev libzrtpcpp-dev libasound2-dev libogg-dev libvorbis-dev libperl-dev libgdbm-dev libdb-dev python-dev uuid-dev bison autoconf g++ libncurses-dev

 

二. 下载源码

git clone https://freeswitch.org/stash/scm/fs/freeswitch.git

三. 编译生成

./bootstrap.sh
./configure
在编译的时候, 遇到的问题:

错误1:
checking for sqlite3 >= 3.6.20...Package sqlite3 was not found in the pkg-config search path. Perhaps you shouldadd the directory containing `sqlite3.pc' to the PKG_CONFIG_PATH environmentvariable No package 'sqlite3' foundconfigure: error: Library requirements(sqlite3 >= 3.6.20) not met; consider adjusting the PKG_CONFIG_PATHenvironment variable if your libraries are in a nonstandard prefix sopkg-config can find them
解决:sudo apt-get install libsqlite3-dev

错误2:
checking for libpcre >= 7.8... Packagelibpcre was not found in the pkg-config search path. Perhaps you should add thedirectory containing `libpcre.pc' to the PKG_CONFIG_PATH environment variableNo package 'libpcre' found configure: error: Library requirements(libpcre >= 7.8) not met; consider adjusting the PKG_CONFIG_PATH environmentvariable if your libraries are in a nonstandard prefix so pkg-config can findthem.

解决:sudo apt-get install libpcre3-dev

错误3:

checking for speex >= 1.2rc1 speexdsp>= 1.2rc1... Package speex was not found in the pkg-config search path.Perhaps you should add the directory containing `speex.pc' to thePKG_CONFIG_PATH environment variable No package 'speex' found Package speexdspwas not found in the pkg-config search path. Perhaps you should add thedirectory containing `speexdsp.pc' to the PKG_CONFIG_PATH environment variableNo package 'speexdsp' found configure: error: Library requirements(speex >= 1.2rc1 speexdsp >= 1.2rc1) not met; consider adjusting thePKG_CONFIG_PATH environment variable if your libraries are in a nonstandardprefix so pkg-config can find them.

解决:sudo apt-get install libspeexdsp-dev

 

错误4:

checking for libldns >= 1.6.6...checking for ldns_str2rdf_a in -lldns... noconfigure: error: You need to either installlibldns-dev or disable mod_enum in modules.conf

解决:sudo apt-get install libldns-dev

 

错误5:

configure: error: You need to eitherinstall libedit-dev (>= 2.11) or configure with--disable-core-libedit-suppor

 解决:sudo apt-get install libedit-dev

 

编译完成后执行

make; 

sudo make install 

在make时, 出现错误:

  Neither yasm nor nasm have been found....

解决:sudo apt-get install yasm

 

错误6:

 You must install libavformat-dev and libswscale-dev to build mod_av.  Stop.

解决:

 sudo apt-get install libavformat-dev libswscale-dev

 

错误:

 sudo make 时,出现mod_lua.cpp:37:10: fatal error: lua.h: 没有那个文件或目录

解决:

 sudo apt-get install liblua5.2-dev lua5.2(这玩意不能装5.3版本)

 然后很重要的是,装完要重新执行./configure,不然不生效

还有个libks、signalwire-c、需要编译安装。。。。

重新make通过

 

#安装完成后,做两个链接到搜索路径中

  ln -sf /usr/local/freeswitch/bin/freeswitch /usr/local/bin/

  ln -sf /usr/local/freeswitch/bin/fs_cli /usr/local/bin/

 

 

 

 

posted @ 2021-10-24 09:29  LoveMe7788  阅读(2184)  评论(0编辑  收藏  举报