1.参考https://freeswitch.org/confluence/display/FREESWITCH/Debian
安装建立source.list需要的软件
apt-get update && apt-get install -yq gnupg2 wget lsb-release下载证书,建立source.list
TOKEN=YOURSIGNALWIRETOKEN
--downlaod 证书
apt-get update && apt-get install -yq gnupg2 wget lsb-releasewget --http-user=yourname --http-password=$TOKEN -O /usr/share/keyrings/signalwire-freeswitch-repo.gpg https://freeswitch.signalwire.com/repo/deb/debian-release/signalwire-freeswitch-repo.gpg
--建立验证文件
echo "machine freeswitch.signalwire.com login signalwire password $TOKEN" > /etc/apt/auth.conf
--建立freeswitch.list源文件
echo "deb [signed-by=/usr/share/keyrings/signalwire-freeswitch-repo.gpg] https://freeswitch.signalwire.com/repo/deb/debian-release/ `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-release/ `lsb_release -sc` main" >> /etc/apt/sources.list.d/freeswitch.list
echo "deb [signed-by=/usr/share/keyrings/signalwire-freeswitch-repo.gpg] https://freeswitch.signalwire.com/repo/deb/debian-release/ `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-release/ `lsb_release -sc` main" >> /etc/apt/sources.list.d/freeswitch.list
安装编译依赖
apt-get build-dep freeswitch 这个命令慎用,如果安装失败,许多包没法使用automove--git clone source code
cd /usr/src/git clone https://github.com/signalwire/freeswitch.git -bv1.10 freeswitch
cd freeswitch
--因为分支会重构,设置下列参数,防止冲突
git config pull.rebase true--开始配置,编译安装
./bootstrap.sh -j
./configure
make
make install
./configure
make
make install
设置用户及权限
# create user 'freeswitch'
# add it to group 'freeswitch'# change owner and group of the freeswitch installation
cd /usr/local
sudo groupadd freeswitch
sudo adduser --quiet --system --home /usr/local/freeswitch --gecos "FreeSWITCH open source softswitch" --ingroup freeswitch freeswitch --disabled-password
sudo chown -R freeswitch:freeswitch /usr/local/freeswitch/
sudo chmod -R ug=rwX,o= /usr/local/freeswitch/
sudo -i
sudo chmod -R u=rwx,g=rx /usr/local/freeswitch/bin/*
sudo chmod -R u=rwx,g=rx /usr/local/freeswitch/bin/*
添加系统服务启动脚本
sudo cp /usr/src/freeswitch/debian/freeswitch-systemd.freeswitch.service /etc/systemd/system/freeswitch.service
sudo chmod +x /etc/systemd/system/freeswitch.service
链接执行文件freeswitch fs_cli
ln -s /usr/local/freeswitch/bin/freeswitch /usr/bin/freeswitchln -s /usr/local/freeswitch/bin/fs_cli /usr/bin/fs_cli
添加服务
systemctl enable freeswitchsystemctl daemon-reload
systemctl start freeswitch
经过折腾,我的树莓派B还是无法启动freeswitch,看来只有换板,这段时间树莓派涨得太厉害了。
根据网上的文章,重新进行了编译,没有按照github上的指南
set https_proxy = http://192.168.199.161:10811/
export https_proxy
root@mserver:~# more .wgetrc
echo "use_proxy = on" | tee -a ~/.wgetrc
echo "https_proxy = http://192.168.199.161:10811/" | tee -a ~/.wgetrc
echo "net.ipv6.conf.all.disable_ipv6 = 1" | tee -a /etc/sysctl.d/70-disabel-ipv6.conf
sysctl -p -f /etc/sysctl.d/70-disabel-ipv6.conf
apt update && apt upgrade
apt install git
git config --global https.proxy http://192.168.199.161:10811
git config --global --unset https.proxy
apt install -y build-essential gdb gnupg2 wget autoconf lsb-release libtool libtool-bin libtiff-dev uuid-dev pkg-config openssl libssl-dev sqlite3 libsqlite3-dev libcurl4-openssl-dev libspeexdsp-dev libldns-dev libedit-dev yasm nasm ffmpeg libswscale-dev libavformat-dev lua5.4 liblua5.4-dev libopus-dev libpq-dev libmariadb-dev unixodbc unixodbc-dev libsndfile1-dev libpcre3-dev python3-pip python3-distutils
#install libks
git clone https://github.com/signalwire/libks.git
cmake .
make
sudo make install
#install spandsp
git clone https://github.com/freeswitch/spandsp
cd spandsp
./bootstrap.sh
./configure
make
make install
ldconfig
#install sofia-sip
git clone https://github.com/freeswitch/sofia-sip.git
cd sofia-sip
./bootstrap.sh -j
./configure
make
make install
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
#install freeswitch
git clone https://github.com/signalwire/freeswitch.git -bv1.10 freeswitch
cd freeswitch
git config pull.rebase true
./bootstrap.sh -j
modules.conf #注释掉不需要的模块mod_signalwire freeswitch连接到SignalWire CLOUD的模块
./configure
make
make install
make sounds-install
make moh-install
make cd-sounds-install #只用安装完cd后保持音乐才正常
make cd-moh-install
#set owner and permissions
cd /usr/local
groupadd freeswitch
adduser --quiet --system --home /usr/local/freeswitch --gecos "FreeSWITCH open source softswitch" --ingroup freeswitch freeswitch --disabled-password
chown -R freeswitch:freeswitch /usr/local/freeswitch/
chmod -R ug=rwX,o= /usr/local/freeswitch/
chmod -R u=rwx,g=rx /usr/local/freeswitch/bin/*
#startup servcie
cp /usr/src/freeswitch/debian/freeswitch-systemd.freeswitch.service /etc/systemd/system/freeswitch.service
systemctl daemon-reload
systemctl start freeswitch
systemctl enable freeswitch