Debian13编译安装FreeSWITCH

使用的Debian13版本

sh 复制代码
root@DESKTOP-826O1MK:/home/gillbert# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 13 (trixie)
Release:        13
Codename:       trixie

安装FreeSWITCH需要的依赖包

sh 复制代码
apt-get install -y \
    build-essential cmake automake autoconf libtool libtool-bin pkg-config \
    libssl-dev zlib1g-dev libdb-dev unixodbc-dev libncurses-dev libexpat1-dev libgdbm-dev bison erlang-dev libtpl-dev libtiff5-dev uuid-dev \
    libpcre2-dev libedit-dev libsqlite3-dev libcurl4-openssl-dev nasm \
    libogg-dev libspeex-dev libspeexdsp-dev \
    libldns-dev \
    python3-dev \
    libavformat-dev libswscale-dev libresample1-dev \
    liblua5.2-dev \
    libopus-dev \
    libpq-dev \
    libshout3-dev libmpg123-dev libmp3lame-dev\
    libsndfile1-dev libflac-dev libogg-dev libvorbis-dev sudo

与Debian12不同的是Debian13使用了libpcre2-devlibncurses-dev安装包.因为FreeSWITCH在最新的master中将pcre升级到了pcre2.

编译FreeSWITCH

克隆FreeSWITCH

sh 复制代码
git clone https://github.com/signalwire/freeswitch.git

下载依赖的库

sh 复制代码
# 下载libks源码
git clone https://github.com/signalwire/libks
# 下载sofia-sip源码
git clone https://github.com/freeswitch/sofia-sip
# 下载spandsp源码
git clone https://github.com/freeswitch/spandsp
# 下载signalwire-c源码
git clone https://github.com/signalwire/signalwire-c

安装libks

libks的主要目的是为VoIP通信提供端到端加密

sh 复制代码
cd libks
cmake . -DCMAKE_INSTALL_PREFIX=/usr -DWITH_LIBBACKTRACE=1
make install
cd ..

安装sofia-sip

Sofia-SIP通常被嵌入其他VoIP软件平台中,作为其SIP网络连接能力和通信功能的底层模块。

sh 复制代码
cd sofia-sip
./bootstrap.sh
./configure CFLAGS="-g -ggdb" --with-pic --with-glib=no --without-doxygen --disable-stun --prefix=/usr
make -j`nproc --all`
sudo make install
cd ..

安装spandsp

Spandsp是一个开源的 VoIP/Fax 流处理和控制软件库。它主要用于以下方面:

  • 语音处理:包括语音编码(G.711, G.729等)、信令(RTP, RTCP等)以及音频转码等。
  • Fax处理:实现传真呼叫控制、文档传输和信令处理,支持主流Fax标准。
  • DTMF检测:识别DTMF按键音,支持各种DTMF方案。
  • 音频格式转换:实现音频数据格式之间的转换,如ulaw到alaw。
  • RTP/RTCP:处理RTP/RTCP数据包以实现语音和传真的流控制。
  • 信道编解码:实现对信道数据(如PCM)的编解码。
  • DSP功能:包括音频采样、降噪、回音消除、语音活动检测等DSP算法。
sh 复制代码
cd spandsp
# 切换到一个稳定的提交hash上
git checkout 0d2e6ac
./bootstrap.sh
./configure CFLAGS="-g -ggdb" --with-pic --prefix=/usr
make -j`nproc --all`
sudo make install
cd ..

安装signalwire-c

sh 复制代码
cd signalwire-c
PKG_CONFIG_PATH=/usr/lib/pkgconfig cmake . -DCMAKE_INSTALL_PREFIX=/usr
sudo make install
cd ..

编译FreeSWITCH

我们使用最新的master分支进行编译

sh 复制代码
# 编译安装FreeSWITCH
cd freeswitch
./bootstrap.sh -j
./configure 
make -j`nproc`
sudo make install
# 安装英文声音资源(可选)
# 带有sounds-install的声音文件表示提示音,比如用于通话期间的语音提示,如VoiceMail的提示音,支持TTS的提示音等
# 带有moh-install的声音文件表示在Hold状态下播放的音乐,即Music On Hold (MOH)

# CD音质的声音文件
make cd-sounds-install
make cd-moh-install

# 超高清声音文件
make uhd-sounds-install
make uhd-moh-install

# 高清声音文件
make hd-sounds-install
make hd-moh-install

# 标准声音文件
make sounds-install
make moh-install
cd ..

创建软连接

freeswitchfs_cli较常用,我们创建下软链接。

sh 复制代码
ln -s /usr/local/freeswitch/bin/freeswitch /usr/bin/freeswitch
ln -s /usr/local/freeswitch/bin/fs_cli /usr/bin/fs_cli
相关推荐
hello 早上好19 小时前
Spring Boot 核心启动机制与配置原理剖析
java·spring boot·后端
武子康19 小时前
大数据-112 Flink DataStream API :数据源、转换与输出 文件、Socket 到 Kafka 的完整流程
大数据·后端·flink
Terio_my21 小时前
Spring Boot 缓存技术
spring boot·后端·缓存
IT_陈寒21 小时前
Python 3.12 性能暴增50%!这5个新特性让老项目直接起飞
前端·人工智能·后端
你的人类朋友1 天前
【操作系统】说说 x86 和 x64
后端·程序员·操作系统
半夏知半秋1 天前
基于skynet框架业务中的gateway实现分析
服务器·开发语言·后端·学习·gateway
青柠编程1 天前
基于Spring Boot的选课管理系统架构设计
java·spring boot·后端
码事漫谈1 天前
C++内存泄漏排查:从基础到高级的完整工具指南
后端
王嘉俊9251 天前
ThinkPHP 入门:快速构建 PHP Web 应用的强大框架
开发语言·前端·后端·php·框架·thinkphp
码事漫谈1 天前
C++多线程数据竞争:从检测到修复的完整指南
后端