在Debian上安装freeswitch

说明:

安装系统依赖

查看系统版本:

cat /etc/issue
Debian GNU/Linux 12 \n \l

安装系统依赖:

参考 https://medium.com/@jogikrunal9477/ultimate-guide-to-installing-freeswitch-on-ubuntu-22-04-lts-3745ef6a6bd6

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.txtGenerate 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

find / -name core.db 2>/dev/null

安装声音文件:

# 标准
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

设置权限:

参考: https://developer.signalwire.com/freeswitch/FreeSWITCH-Explained/Installation/Linux/Deprecated-Installation-Instructions/Debian-Post-Install-Tasks_13172868#set-owner-and-permissions

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

在Debian上安装freeswitch的更多相关文章

  1. 在 Debian 上安装 SQL Server vNext CTP1

    微软在开源 .NET Framework 之后,相继推出了跨平台的编辑器 Visual Studio Code,跨平台的 SQL Server 数据库 SQL Server vNext,Visual ...

  2. Mosquitto安装_Ubuntu/Debian上安装消息队列Mosquitto

    Mosquitto安装_Ubuntu/Debian上安装消息队列Mosquitto MQTT是IBM开发的一个即时通讯协议.MQTT是面向M2M和物联网的连接协议,采用轻量级发布和订阅消息传输机制.M ...

  3. 在 DEBIAN 上安装 SQL SERVER

    微软在开源 .NET Framework 之后,相继推出了跨平台的编辑器 Visual Studio Code,跨平台的 SQL Server 数据库 SQL Server vNext,Visual ...

  4. 如何在Debian上安装和使用PHP Composer

    1.条件 shell使用sudo权限访问正在运行的debian系统. 必须安装和配置5.3或更高版本的PHP. 2.在Debian上安装Composer 可以通过运行以下命令从getcomposer. ...

  5. Debian上安装java

    Debian 8 Jessie上安装命令: echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main&qu ...

  6. debian上安装lua编辑器

    Debian服务器上安装lua 1)下载压缩包 wget http://www.lua.org/ftp/lua-5.1.4.tar.gz 2)解压文件 tar  zxvf lua-5.1.4.tar. ...

  7. debian上安装docker ce

    在Debian9上安装Docker CE 使用从包中安装的方式 Docker是一个开源的容器引擎,它有助于更快地交付产品.Docker可将应用程序和基础设施层隔离,并且将基础设施当作程序一样进行管理. ...

  8. Linux(Debian) 上安装tomcat并注册服务开机自启动

    1.准备工作 a.下载tomcat linux的包,地址:http://tomcat.apache.org/download-80.cgi,我们下载的版本是8.0,下载方式如图:          b ...

  9. 在debian上安装最新版erlang

    参考这里https://www.erlang-solutions.com/downloads/download-erlang-otp 源码安装的无视 sudo gvim /etc/apt/source ...

  10. Debian上安装Apache+Django全过程

    -->start sudo apt-get install apache2 libapache2-mod-wsgi #https://wiki.debian.org/zh_CN/Apache s ...

随机推荐

  1. 欢迎 Stable Diffusion 3 加入 🧨 Diffusers

    作为 Stability AI 的 Stable Diffusion 家族最新的模型,Stable Diffusion 3 (SD3) 现已登陆 Hugging Face Hub,并且可用在 Diff ...

  2. 安装Ingress-Nginx

    目前,DHorse(https://gitee.com/i512team/dhorse)只支持Ingress-nginx的Ingress实现,下面介绍Ingress-nginx的安装过程. 下载安装文 ...

  3. WebUI测试-获取html页面表格数据并存到Excel中

    from selenium.webdriver.support import expected_conditions as EC import pandas as pd table=WebDriver ...

  4. Spring之WebMvcConfigurationSupport

    WebMvcConfigurationSupport是mvc的核心配置.开发spring,了解和掌握这个是必须的. 为了简约篇幅,本文把"WebMvcConfigurationSupport ...

  5. Java常用的十大开源工具类库总结

    以下是个人总结的Java常用的十大开源工具类库,根据具体需求和项目,可以选择合适的工具类库来提高开发效率.1. Apache Commons:Apache Commons是一个开源的工具类库,提供了大 ...

  6. 在Linux驱动中使用proc子系统

    在Linux驱动中使用proc子系统 背景 proc文件系统是个简单有用的东东:驱动创建一个proc虚拟文件,应用层通过读写该文件,即可实现与内核的交互. 本文适用于3.10以后的内核,v3.10以前 ...

  7. mtr和traceroute的区别,以及为什么traceroute不显示路径mtr却可以显示路径

    最近工作主要都是网络策略的开通和网络测试,在测试的过程当中发现当网络不通时,用traceroute来看路由路径的时候总是无法显示出来,于是就换了个工具-mtr,发现mtr可以正常显示出路由路径,帮助我 ...

  8. Go 如何对多个网络命令空间中的端口进行监听

    Go 如何对多个网络命令空间中的端口进行监听 需求为 对多个命名空间内的端口进行监听和代理. 刚开始对 netns 的理解不够深刻,以为必须存在一个新的线程然后调用 setns(2) 切换过去,如果有 ...

  9. Redis缓存雪崩,击穿,穿透以及解决方案

    Redis读写过程 一般情况下,Redis都是作为client与MySQL间的一层缓存,尽量减少MySQL的读压力,数据流向如图所示: Redis的五种数据类型及使用场景 String 这个其实没啥好 ...

  10. yb课堂 视频详情页模块开发《三十八》

    CourseDetail基础模块开发 CourseDetail模块开发,拆分组件 CourseDetail.vue Header.vue Course.vue Tab.vue Summary.vue ...