本文主要是介绍ubuntu 18.04 server源码编译安装freeswitch 1.10.11——筑梦之路,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
前言
这里主要编译支持语音通话、视频通话、短信、webrtc功能的PBX。
安装编译工具包和依赖包
sudo apt-get updatesudo apt-get install -y autoconf git libtool g++ zlib1g-dev libjpeg-dev libcurl4-openssl-dev libspeex-dev libldns-dev libedit-dev libssl-dev pkg-config yasm liblua50-dev libopus-dev libsndfile1-dev libpq-dev libreadline-dev lua5.2 lua5.2-doc liblua5.2-dev libtiff5 libtiff5-devsudo apt-get install -y vimsudo apt-get install -y g++sudo apt-get install -y zlib1g-devsudo apt-get install -y libjpeg-devsudo apt-get install -y libsqlite3-devsudo apt-get install -y libcurl4-gnutls-devsudo apt-get install -y libpcre3-devsudo apt-get install -y libspeexdsp-devsudo apt-get install -y libedit-devsudo apt-get install -y libssl-devsudo apt-get install -y libopus-devsudo apt-get install -y liblua5.2-devsudo apt-get install -y libldns-devsudo apt-get install -y libsndfile1-devsudo apt-get install python3-pip -ysudo apt-get install unixodbc unixodbc-devsudo apt install libavformat-dev -ysudo apt install libswscale-dev -ysudo apt install doxygen cmake uuid-dev -y
编译安装sofia-sip
git clone https://github.com/freeswitch/sofia-sip.git./bootstrap.sh -j./configuremakemake install
编译安装spandsp
git clone https://github.com/freeswitch/spandsp.gitcd spandspgit checkout -b finecode20230705 0d2e6ac65e0e8f53d652665a743015a88bf048d4./bootstrap.sh -j./configuremakemake install
编译安装libks
git clone https://github.com/signalwire/libks.git
cd libks
sudo cmake .
sudo make
sudo make installcat /etc/profileexport PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:${PKG_CONFIG_PATH}source /etc/profile
编译安装freeswitch
git clone --branch v1.10.11 https://github.com/signalwire/freeswitch.git# 编辑配置,去掉模块mod_signalwire,启用模块mod_callcentersed -i 's/applications\/mod_signalwire/#applications\/mod_signalwire/g' freeswitch/modules.confsed -i 's/#applications\/mod_callcenter/applications\/mod_callcenter/g' freeswitch/modules.confcd freeswitch ./configure --enable-portable-binary --with-gnu-ld --with-python3 --with-openssl --enable-core-odbc-support --enable-zrtp --enable-core-pgsql-supportmake -j2make installmake -j cd-sounds-install
make -j cd-moh-install
配置软连接和后台启动
#freeswitch启动:
/usr/local/freeswitch/bin/freeswitch -nonat -nc#做软链,方便启动:
ln -s /usr/local/freeswitch/bin/fs_cli /usr/local/bin/
ln -s /usr/local/freeswitch/bin/freeswitch /usr/local/bin/
使用systemctl管理服务(可选)
cat /etc/systemd/system/freeswitch.service
[Unit]
Description=FreeSWITCH Soft-Switched Voice over IP Telephony
After=network.target[Service]
Type=forking
ExecStart=/usr/local/freeswitch/bin/freeswitch -nc
ExecStop=/usr/local/freeswitch/bin/freeswitch -stop[Install]
WantedBy=multi-user.target# ##################
systemctl daemon-reloadsystemctl enable freeswitch --nowsystemctl status freeswitch
测试验证
思路:使用软电话注册互拨测试就行,包括语音通话测试、视频通话测试、短信发送等。
这篇关于ubuntu 18.04 server源码编译安装freeswitch 1.10.11——筑梦之路的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!