debian11编译安装freeswitch

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
云数据库 RDS MySQL,高可用系列 2核4GB
简介: debian11编译安装freeswitch

前言

  • 环境:
  • 系统版本:debian 11 x86_64
  • FreeSWITCH版本:1.10.6

安装步骤

  1. 安装依赖(安装之前最好换apt软件源为国内的)
apt install -y 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
  1. 下载FreeSWITCH源码包
git clone https://github.com/signalwire/freeswitch.git -bv1.10 freeswitch
cd freeswitch
./bootstrap.sh -j
  1. 编译安装spandsp
git clone https://github.com/freeswitch/spandsp.git
cd spandsp
./bootstrap.sh -j
./configure
make
make install
ldconfig
  1. 编译安装sofia-sip
git clone https://github.com/freeswitch/sofia-sip.git
cd sofia-sip
./bootstrap.sh -j
./configure
make
make install
ldconfig
  1. 编译安装FreeSWITCH
# 预编译
./configure --prefix=/usr/local/freeswitch
# 编译。如果是多核处理器,比如4核,可以用make -j4,能加快编译速度
# 编译时可以编辑modules.conf,取消编译mod_signalwire、mod_opus
make
make install
  1. 启动
# 启动服务端
/usr/local/freeswitch/bin/freeswitch -nosql -nonat -nc
# 如果有ipv6相关报错,需要删掉/usr/local/freeswitch/etc/freeswitch/sip_profiles目录下名字带ipv6的目录和文件
# 进入控制台
/usr/local/freeswitch/bin/fs_cli

创建软链接

ln -s /usr/local/freeswitch/bin/freeswitch /usr/local/bin/
ln -s /usr/local/freeswitch/bin/fs_cli /usr/local/bin/

FreeSWITCH连接MySQL

mysql版本:5.7

从版本1.10.0开始,FreeSWITCH通过mod_mariadb原生支持MySQL

  1. 编译时修改module.conf.xml,取消mod_mariadb的注释
  2. 编辑autoload_configs/pre_load_modules.conf,注释掉mod_pgsql,取消mod_mariadb的注释
<configuration name="pre_load_modules.conf" description="Modules">
  <modules>
    <!-- Databases -->
    <load module="mod_mariadb"/>
    <!-- <load module="mod_pgsql"/> -->
  </modules>
</configuration>
  1. 编辑autoload_configs/switch.conf.xml,添加下面一行内容。注意修改IP、端口、数据库名、用户名、用户密码。如果有postgresql相关的配置信息,需要注释掉。
<param name="core-db-dsn" value="mariadb://Server=192.168.0.10;Port=3307;Database=freeswitch;Uid=root;Pwd=123456;" />
  1. 编辑sip_profile,添加下面内容,注意修改IP、端口、数据库名、用户名、用户密码。
<param name="core-db-dsn" value="mariadb://Server=192.168.0.10;Port=3307;Database=freeswitch;Uid=root;Pwd=123456;" />
  1. 测试启动:
/usr/local/freeswitch/bin/freeswitch -nonat
# 启动时会自动创建数据表
# 一些报错如"Specified key was too long; max key length is 3072 bytes"、"Duplicate key name"可忽略
  1. 使用软电话如MicroSIP注册,查看数据表registrations中有没有注册信息,有的话说明FreeSWITCH已连接MySQL
  2. 在FreeSWITCH控制台执行shutdown关闭FreeSWITCH,重新启动
/usr/local/freeswitch/bin/freeswitch -nonat -nosql -nc
相关实践学习
如何在云端创建MySQL数据库
开始实验后,系统会自动创建一台自建MySQL的 源数据库 ECS 实例和一台 目标数据库 RDS。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助 &nbsp; &nbsp; 相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
Ubuntu
避坑指南之Samba4在Ubuntu20.04 编译安装指南
避坑指南之Samba4在Ubuntu20.04 编译安装指南
826 0
避坑指南之Samba4在Ubuntu20.04 编译安装指南
|
Ubuntu
避坑指南之 Samba4在Ubuntu20.04 编译安装指南
避坑指南之 Samba4在Ubuntu20.04 编译安装指南
651 0
避坑指南之 Samba4在Ubuntu20.04 编译安装指南
|
监控 Ubuntu Linux
如何在 Ubuntu 上安装 Nagios?
Nagios 允许您使用提供实时状态数据的插件来监控主机(可以是物理机或虚拟机)以及 HTTP、SSH 和 SMTP 等服务。
138 1
|
Ubuntu Unix 计算机视觉
Ubuntu编译安装CMake
Ubuntu编译安装CMake
372 0
|
NoSQL Linux PHP
【Linux】编译安装phpredis
【Linux】编译安装phpredis
97 0
【Linux】编译安装phpredis
|
Ubuntu 应用服务中间件 nginx
ubuntu下安装nginx时依赖库zlib,pcre,openssl安装方法
ubuntu下安装nginx时依赖库zlib,pcre,openssl安装方法
3726 0
|
监控 Ubuntu Apache
ubuntu16.04安装配置nagios
参考博文:https://www.howtoing.com/ubuntu-nagios/ 该博文真实有效可供参考,按照步骤,基本可以成功 一.安装的先决条件 sudo apt-get install wget build-essential apache2 php apache2-mod-php7.
1919 0
|
Ubuntu Shell 开发工具
|
存储 监控 Ubuntu
|
Ubuntu 数据安全/隐私保护 Linux