首页 > 极客资料 博客日记
在Debian上安装freeswitch
2024-08-12 12:00:03极客资料围观29次
本篇文章分享在Debian上安装freeswitch,对你有帮助的话记得收藏一下,看极客之家收获更多编程知识
在Debian上安装freeswitch
说明:
- 首次发表日期:2024-08-12
- 参考文档:
- https://medium.com/@jogikrunal9477/ultimate-guide-to-installing-freeswitch-on-ubuntu-22-04-lts-3745ef6a6bd6
- https://developer.signalwire.com/freeswitch/FreeSWITCH-Explained/Installation/Linux/Deprecated-Installation-Instructions/Debian-Post-Install-Tasks_13172868/
- https://blog.csdn.net/qq_36369267/article/details/131564019
安装系统依赖
查看系统版本:
cat /etc/issue
Debian GNU/Linux 12 \n \l
安装系统依赖:
sudo apt update
sudo apt-get install build-essential automake autoconf git-core wget libtool cmake pkg-config uuid-dev
sudo apt-get install libncurses5-dev libtiff-dev libjpeg-dev zlib1g-dev libssl-dev libsqlite3-dev
sudo apt-get install libpcre3-dev libspeexdsp-dev libspeex-dev libcurl4-openssl-dev libopus-dev libpq5 libpq-dev unixodbc-dev libldns-dev libedit-dev yasm liblua5.2-dev liblua5.2-0 libxml2-dev lua5.2 lua5.2-doc libtiff5-dev libsndfile1-dev unzip sngrep libreadline-dev ntpdate
sudo apt install python3 python3-venv python3-pip python3-distutils
sudo apt install libavformat-dev libswscale-dev
构建和安装依赖库
libks
git clone -b v2.0.6 https://github.com/signalwire/libks.git
cd libks
cmake . -DCMAKE_BUILD_TYPE=Release
make -j 32
sudo make install
注意:可能需要注释掉CMakeList.txt
中Generate a Debian compliant changelog
的部分
singalwire-c
git clone -b v2.0.0 https://github.com/signalwire/signalwire-c.git
cd signalwire-c
cmake . -DCMAKE_BUILD_TYPE=Release
make -j 32
sudo make install
spansdp
参考: https://blog.csdn.net/qq_36369267/article/details/131564019
git clone https://github.com/freeswitch/spandsp.git
cd spandsp/
git checkout -b finecode20230705 0d2e6ac65e0e8f53d652665a743015a88bf048d4
./bootstrap.sh
./configure
make -j 32
sudo make install
sofia-sip
git clone -b v1.13.17 https://github.com/freeswitch/sofia-sip.git
cd sofia-sip
./bootstrap.sh
./configure
make -j 32
sudo make install
安装 freeswitch
wget https://files.freeswitch.org/freeswitch-releases/freeswitch-1.10.12.-release.tar.gz
tar -xvf freeswitch-1.10.12.-release.tar.gz
cd freeswitch-1.10.12.-release
./configure --enable-core-odbc-support --enable-core-pgsql-support
make -j 32
sudo make install
注意:源码打包为tar.gz前已经执行了bootstrap.sh
了,所以不需要执行bootstrap.sh
安装声音文件:
# 标准
sudo make sounds-install
sudo make moh-install
# 高清
sudo make cd-sounds-install
sudo cd-moh-install
配置软链接:
sudo ln -sf /usr/local/freeswitch/bin/freeswitch /usr/bin/
sudo ln -sf /usr/local/freeswitch/bin/fs_cli /usr/bin
sudo ln -s /usr/local/freeswitch/conf /etc/freeswitch
设置权限:
sudo groupadd freeswitch
sudo adduser --quiet --system --home /usr/local/freeswitch --gecos 'FreeSWITCH open source softswitch' --ingroup freeswitch freeswitch --disabled-password
sudo chown -R $USER:freeswitch /usr/local/freeswitch/
sudo chmod -R ug=rwX,o= /usr/local/freeswitch/
sudo chmod -R u=rwx,g=rx /usr/local/freeswitch/bin/*
运行
freeswitch
其中
/etc/freeswitch/
文件夹下存放配置文件/usr/local/freeswitch/db
存放可能用到的sqlite数据库文件,如core.db
检查进程查看freeswitch是否在运行:
ps aux | grep freeswitch
查看freeswitch监听的IP地址:
netstat -an | grep 5060
配置为系统服务(开机启动)
创建service文件:
sudo vi /etc/systemd/system/freeswitch.service
粘贴如下内容:
[Unit]
Description=FreeSWITCH
Wants=network-online.target
Requires=network.target local-fs.target
After=network.target network-online.target local-fs.target
[Service]
Type=forking
PIDFile=/usr/local/freeswitch/run/freeswitch.pid
Environment="DAEMON_OPTS=-nonat"
Environment="USER=freeswitch"
Environment="GROUP=freeswitch"
EnvironmentFile=-/etc/default/freeswitch
ExecStartPre=/bin/chown -R ${USER}:${GROUP} /usr/local/freeswitch
ExecStart=/usr/local/freeswitch/bin/freeswitch -u ${USER} -g ${GROUP} -ncwait ${DAEMON_OPTS}
TimeoutSec=45s
Restart=always
[Install]
WantedBy=multi-user.target
Reload systemd daemon:
sudo systemctl daemon-reload
开启和启动服务:
sudo systemctl enable freeswitch.service
sudo systemctl start freeswitch.service
查看服务状态:
sudo systemctl status freeswitch.service
版权声明:本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:jacktools123@163.com进行投诉反馈,一经查实,立即删除!
标签:
相关文章
最新发布
- Nuxt.js 应用中的 prerender:routes 事件钩子详解
- 【问题解决】Tomcat由低于8版本升级到高版本使用Tomcat自带连接池报错无法找到表空间的问题
- 【FAQ】HarmonyOS SDK 闭源开放能力 —Vision Kit
- 六、Spring Boot集成Spring Security之前后分离认证流程最佳方案
- 《JVM第7课》堆区
- .NET 8 高性能跨平台图像处理库 ImageSharp
- 还在为慢速数据传输苦恼?Linux 零拷贝技术来帮你!
- 刚毕业,去做边缘业务,还有救吗?
- 如何避免 HttpClient 丢失请求头:通过 HttpRequestMessage 解决并优化
- 让性能提升56%的Vue3.5响应式重构之“版本计数”