本文使用Debian10部署FreeSWITCH最新版本。从实际工程应用出发,在服务部署的过程中可能遇到的问题和解决方法、以及关键配置。
准备工作
在阿里云申请购买ECS服务器,将操作系统设置为 Debian10。完成之后ssh登录服务器,先修改源以便于快速更新服务器。
# 先备份源
cp /etc/apt/source.list /etc/apt/source.list.back
#编辑源
vim /etc/apt/source.list
#在source.list文件中拷贝以下内容
deb https://mirrors.aliyun.com/debian/ buster main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ buster main non-free contrib
deb https://mirrors.aliyun.com/debian-security buster/updates main
deb-src https://mirrors.aliyun.com/debian-security buster/updates main
deb https://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
Signalwire 注册token
在开始之前,需要在Signalwire官网注册TOKEN,国内的手机号收不到短信验证码,但是可以用接听电话的方式获取。注册过程比较折腾几天才注册好!注册好之后进入个人界面,在左侧最下方找到“Personal Access Token”点击进去新建一个Token,这个Token就是下面要用到的Token
安装Freeswitch
以下安装方式来自Freeswitch官网,命令根据具体的环境进行调整:
apt update
TOKEN=pat_Rgwvz9TwdLCmxdPq3UwNpdJF
apt-get update && apt-get install -yq gnupg2 wget lsb-release
wget --http-user=signalwire --http-password=pat_Rgwvz9TwdLCmxdPq3UwNpdJF -O /usr/share/keyrings/signalwire-freeswitch-repo.gpg https://freeswitch.signalwire.com/repo/deb/debian-unstable/signalwire-freeswitch-repo.gpg
echo "machine freeswitch.signalwire.com login signalwire password pat_Rgwvz9TwdLCmxdPq3UwNpdJF" > /etc/apt/auth.conf
chmod 600 /etc/apt/auth.conf
echo "deb [signed-by=/usr/share/keyrings/signalwire-freeswitch-repo.gpg] https://freeswitch.signalwire.com/repo/deb/debian-unstable/ `lsb_release -sc` main" > /etc/apt/sources.list.d/freeswitch.list
echo "deb-src [signed-by=/usr/share/keyrings/signalwire-freeswitch-repo.gpg] https://freeswitch.signalwire.com/repo/deb/debian-unstable/ `lsb_release -sc` main" >> /etc/apt/sources.list.d/freeswitch.list
apt-get update
# Install dependencies required for the build
apt-get build-dep freeswitch
# Then let's get the source. Use the -b flag to get a specific branch
cd /usr/src/
git clone https://github.com/signalwire/freeswitch.git freeswitch
cd freeswitch
# Because we're in a branch that will go through many rebases, it's
# better to set this one, or you'll get CONFLICTS w