您的位置:首页 > 数据库 > MariaDB

FreeSwitch1.10版本安装及内置mariadb(mysql)使用记录

2020-07-15 10:01 1636 查看

【备注:因新浪博客莫名其妙的自动加密博文,导致前面发布在新浪博客的博文无法浏览,故而我在CSDN重发,以便需要的人参考】

因为FS现在停止了1.8(更不要说1.6),当前是1.10版本,于是对这个版本进行了安装配置的测试,小记如下:
1、初步安装测试,1.10版本在centos7.7下可以安装,运行OK
2、1.10版本的FS已经内置了mariadb(mysql)的数据库支持,可以不再用ODBC来启用mysql了(按FS官方的文档,1.10版本主要就是优化了数据库)

为测试这个版本,并主要测试使用内置mariadb数据库,进行的安装记录如下:

================== 使用 yum 安装 ==========================

1、centos7.7 最小安装

2、#这是centos7下面对 delta的补充安装,并安装wget备用

yum provides ‘*/applydeltarpm’
yum install deltarpm wget

3、#直接使用yum安装Freeswitch,仅安装英文语言包,启用xml-cdr和mariadb(mysql)
yum install -y https://files.freeswitch.org/repo/yum/centos-release/freeswitch-release-repo-0-1.noarch.rpm epel-release
yum install -y freeswitch-config-vanilla freeswitch-lang-en freeswitch-sounds-en-* freeswitch-sounds-music-* freeswitch-lua freeswitch-xml-cdr freeswitch-database-mariadb
systemctl enable freeswitch

4、使用内置mariadb数据库:注意,如果使用FS的mariadb支持就不能使用最新的mariadb,要用centos自带的,否则mysql C connector版本不兼容!
yum install -y mariadb mariadb-sever
service mariadb start
systemctl enable mariadb
mysql_secure_installation
上面修改root用户密码,后面需要创建freeswitch的空数据库(建议用默认字符集)

5、修改FS配置文件,启用mariadb:里面默认启用的是pgsql,mariadb的被注释了,启用即可
vi /etc/freeswitch/autoload_configs/pre_load_modules.conf.xml

6、修改FS配置文件,让FS的核心使用mariadb(mysql)数据库:需修改 core-db-dsn 或 odbc-dsn 数据库连接的相关信息,按上面自己设置的内容连接,连接串的格式为 mariadb://Server=localhost;Database=freeswitch;Uid=freeswitch;Pwd=pass;

vi /etc/freeswitch/autoload_configs/switch.conf.xml
vi /etc/freeswitch/autoload_configs/db.conf.xml
vi /etc/freeswitch/sip_profiles/internal.xml
vi /etc/freeswitch/sip_profiles/internal-ipv6.xml

7、启动FS
service freeswitch start

小记说明:测试运行正常,安装后配置文件中 mod_b64、mod_png、mod_av 这几个默认存在的模块都不可用,而且FS也没有相关的包,开发中需使用的ESL库(libesl.a)也不可用(没有相关包,安装了 freeswitch.devel 包也不包含,必须自己编译,所以,还是要下载源代码,又回到原点了)…,考虑到实际使用,看来源码编译安装还是不可替代的!所以吗, yum安装,仅对一般使用者,对有扩展开发的还是不行!!

================== 源代码编译 ======================

1、centos7.7 最小安装

2、FS的源代码编译基础环境,这里使用yum-builddep工具,基于FS的yum包依赖库批量安装,简单了很多:
yum install -y https://files.freeswitch.org/repo/yum/centos-release/freeswitch-release-repo-0-1.noarch.rpm epel-release yum-utils
yum-builddep -y freeswitch
yum install -y yum-plugin-ovl centos-release-scl rpmdevtools git
yum install -y devtoolset-4-gcc*

scl enable devtoolset-4 ‘bash’

3、下面这个是对mod_av的补充,mod_av需要libavformat-dev,但centos没有,通过第三方yum库安装ffmpeg-devel包实现(yum的FS版本里面是没有mod_av、mod_b64、mod_png的,所以上面的安装也就没有):
rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
yum install -y ffmpeg-devel

4、开始安装:
cd /usr/local/src
git clone -b v1.10 https://github.com/signalwire/freeswitch.git freeswitch
cd /usr/local/src/freeswitch
./bootstrap.sh -j
./configure --enable-portable-binary
–prefix=/usr --localstatedir=/var --sysconfdir=/etc
–with-gnu-ld --with-python --with-erlang --with-openssl
–enable-core-odbc-support --enable-zrtp
make
make -j install
make -j cd-sounds-install
make -j cd-moh-install

5、OK,又回到了熟悉的状态,yum没有的模块都回来了

6、对FS1.10新添加的mariadb模块的编译安装:
cd /usr/local/src/freeswitch/src/mod/databases/mod_mariadb
make
make install

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: