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
相关推荐
Java中文社群23 分钟前
26届双非上岸记!快手之战~
java·后端·面试
whitepure30 分钟前
万字详解Java中的面向对象(一)——设计原则
java·后端
autumnTop31 分钟前
为什么访问不了同事的服务器或者ping不通地址了?
前端·后端·程序员
用户6757049885021 小时前
SQL 判断是否“存在”?99% 的人还在写错!
后端
PetterHillWater1 小时前
12 MCP Servers的介绍
后端·aigc·mcp
杨杨杨大侠1 小时前
02 - 核心模型设计 🧩
后端
小Q圈圈1 小时前
BeanUtils 你走好!MapStruct 才是对象转换的真香神器!
后端
杨杨杨大侠1 小时前
01 - 项目初始化与架构设计
后端