樹莓派版本: Raspberry Pi 4B
操作系統 : Ubuntu Server 20.04_x64
freeswitch版本 : 1.10.3
1、下載freeswitch源代碼
wget http://files.freeswitch.org/releases/freeswitch/freeswitch-1.10.3.-release.tar.gz tar zxvf freeswitch-1.10.3.-release.tar.gz cd freeswitch-1.10.3.-release/
如果下載過慢,也可以從文章末尾提供的鏈接下載。
2、安裝依賴環境
sudo apt install gcc g++ autoconf automake make unixodbc-dev ncurses-dev zlib1g-dev libjpeg-dev libtiff-dev liblua5.1-0-dev libsqlite3-dev libsndfile-dev libavformat-dev libswscale-dev libcurl4-openssl-dev libpcre3-dev libspeex-dev libspeexdsp-dev libedit-dev libtool libldns-dev libopus-dev libpq-dev
安裝 libks:
sudo apt install uuid-dev cd /usr/local/src git clone https://github.com/signalwire/libks.git cd libks cmake . make sudo make install
安裝signalwire-c:
git clone https://github.com/signalwire/signalwire-c.git cd signalwire-c cmake . make sudo make install
如果下載過慢,也可以從文章末尾提供的鏈接下載。
3、開始安裝,依次執行如下命令:
./devel-bootstrap.sh && ./configure && make sudo make install sudo make hd-sounds-install sudo make hd-moh-install sudo make cd-sounds-install sudo make cd-moh-install sudo make samples
預編譯文件可以從文章末尾提供的鏈接下載。
4、建立軟連接,以方便使用
sudo ln -sf /usr/local/freeswitch/bin/freeswitch /usr/local/bin/ sudo ln -sf /usr/local/freeswitch/bin/fs_cli /usr/local/bin/
5、修改配置,以便可以正常啟動
更新文件conf/vars.xml
<X-PRE-PROCESS cmd="stun-set" data="external_rtp_ip=$${local_ip_v4}"/> <X-PRE-PROCESS cmd="stun-set" data="external_sip_ip=$${local_ip_v4}"/>
更新文件conf/autoload_configs/event_socket.conf.xml
<configuration name="event_socket.conf" description="Socket Client"> <settings> <param name="nat-map" value="false"/> <param name="listen-ip" value="127.0.0.1"/> <param name="listen-port" value="8021"/> <param name="password" value="ClueCon"/> <!--<param name="apply-inbound-acl" value="loopback.auto"/>--> <!--<param name="stop-on-bind-error" value="true"/>--> </settings> </configuration>
6、啟動測試
啟動freeswith
sudo freeswitch -nc -nonat : 后台啟動freeswitch
使用命令行客戶管理freeswith
fs_cli -r: 進入客戶端(/exit退出客戶端)
關閉freeswitch
sudo freeswitch -stop
本文涉freeswitch代碼及預編譯程序下載地址:https://pan.baidu.com/s/1fOL01ygev3rvsr4vSLjxsw
可關注微信公眾號(聊聊博文)后回復 2020081001 獲取提取碼
本文github地址:
https://github.com/mike-zhang/mikeBlogEssays/blob/master/2020/20200810_樹莓派安裝freeswitch.rst