在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. redis zset 延迟合并任务处理

    redis zset 延迟合并任务处理 @Autowired public RedisTemplate redisTemplate; ##1.发送端:在接口中收集任务ID,累计时间段之后,合并处理. ...

  2. java+SpringCloud开发的性能和环保问题

    对于大部分商业应用开发程序员而言,使用java+spring是一件幸福的事情. 一般情况下,我们使用cloud开发不是那么重要.精密的应用,这些应用包括例如大型的商业交易,社区等等. 因为这些应用天然 ...

  3. mysql5.7msi安装

    本文介绍的是只安装MySQL数据库的过程,并不包含各种其他附加工具.安装完成之后通常使用Navicat或SQLyog进行可视化操作. 清华的镜像网站只保存最新的几个MySQL版本,所以直链可能已经失效 ...

  4. Golang支持重试的http客户端ghttp

    简介 官方仓库:https://github.com/GuoFlight/ghttp 重试的逻辑依赖了github.com/avast/retry-go 入门 client := ghttp.Clie ...

  5. Fedora升级33->34

    Fedora升级33->34   1. dnf --refresh upgrade   2. dnf install dnf-plugin-system-upgrade --best   3. ...

  6. arm-gcc 命名规则

    背景 在 Ubuntu中交叉编译裸机程序的时候,注意到了这个问题:因此对此作为一个总结. 命名规则 交叉编译工具链的命名规则为:arch [-vendor] [-os] [-(gnu)eabi] ar ...

  7. Gmsh 和 FiPy 求解稳态圆柱绕流

    本项目的源码保存在 github 仓库 https://github.com/cjyyx/CFD_Learning/tree/main/CFD软件学习/FiPy/cylinder.如果下载整个目录,可 ...

  8. 背包DP——多重背包

    多重背包也是 0-1 背包的一个变式.与 0-1 背包的区别在于每种物品有 k 个,而非一个. 朴素 直接把相同的每个物品视作各个单独的物品,没有关联,仅条件相同: 转换后直接用01背包的状态转移方程 ...

  9. 【进阶篇】Java 项目中对使用递归的理解分享

    [进阶篇]Java 项目中对使用递归的理解分享 目录 [进阶篇]Java 项目中对使用递归的理解分享 前言 一.什么是递归 1.1基本概念 1.2优缺点 1.3与迭代的区别 二.实际案例 三.改进方案 ...

  10. 你使用过 Vuex 吗?

    Vuex 是一个专为 Vue.js 应用程序开发的状态(全局数据)管理模式.每一个 Vuex 应用的核心就是 store(仓库)."store" 基本上就是一个容器,它包含着你的应 ...