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/

 

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM