在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. Flutter 借助SearchDelegate实现搜索页面,实现搜索建议、搜索结果,解决IOS拼音问题

    搜索界面使用Flutter自带的SearchDelegate组件实现,通过魔改实现如下效果: 搜素建议 搜索结果,支持刷新和加载更多 IOS中文输入拼音问题 界面预览 拷贝源码 将SearchDele ...

  2. Zabbix---数据库表分区

    1) 查询zabbix数据库中各种表存储的大小和行数: mysql> select table_name, (data_length + index_length)/1024/1024 as t ...

  3. Python入门学习介绍

    什么是Python? Python它是一种直译式,面向对象,解释式的脚本语言.它和Java,C/C++,Go语言一样都是高级语言,但由于它是解释式语言,所以运行速度会比Java,C/C++等语言慢(虽 ...

  4. Python爬取小说+Servlet+C3P0+MVC构建小说api

    一.摘要: 使用python爬取网络小说数据存入数据库,利用C3P0数据库连接池获取数据库数据,采用MVC三层架构对数据库数据进行操作,输出JSON格式数据到前端页面 二.内容: 1.gitee外链消 ...

  5. [oeasy]python0132_变量含义_meaning_声明_declaration_赋值_assignment

    变量定义 回忆上次内容 上次回顾了一下历史 python 是如何从无到有的 看到 Guido 长期的坚持和努力   编程语言的基础都是变量声明 python是如何声明变量的呢?   变量 想要定义变量 ...

  6. oeasy教您玩转vim - 9 - # 换行插入

    插入新行 回忆上节课内容 上上次是 i.I 在光标前面插入 又加了 a.A 可以在光标后面插入 a 是在光标后插入 A 是在当前行最后插入 关于插入,还有什么命令吗? 我们继续去查阅 help :h ...

  7. [oeasy]教您玩转python - 0005- 勇闯地下城

     ​ 继续运行 回忆上次内容 上次从1行代码进化到了2行代码 yy p粘贴剪贴板中的内容 将剪贴板中的代码粘贴9999次 9999p 真的实现了万行代码梦 是真·圆梦 没有撒谎的那种 不过圆梦之后多少 ...

  8. 单细胞测序最好的教程(十四)测序原始数据公开至NCBI数据库

    作者按 国内对于单细胞测序相关的中文教程确实不够全面,当然NCBI官网给的上传教程也比较详细了,所以变成了会者不难.本教程你现在可能用不上,但是你如果做单细胞测序,那么未来你一定会用上,建议收藏. 在 ...

  9. app专项测试:app弱网测试

    app专项测试:app弱网测试 弱网测试背景 用户体验 APP使用过程中,弱网的高延迟和高丢包,在实时性要求非常高的场景,容易伤害用户体验 非正常情况下,Bug出现几率会增加 在解决日常支持需求中,经 ...

  10. 一款基于Fluent设计风格、现代化的WPF UI控件库

    前言 今天大姚给大家分享一款基于Fluent设计风格.开源(MIT License).现代化的WPF UI控件库,它提供直观的设计.主题.导航和全新的沉浸式控件,全部都是原生且无缝地集成在一起:WPF ...