CentOS7.9 源码编译 FreeSWITCH 1.10.12

news/2024/11/18 4:56:42/

建议 CentOS7.9 最小安装,不然容易冲突


#!/bin/bash### 更换 repomkdir /root/repo
mv /etc/yum.repos.d/*.repo /root/repocat <<"EOF" > /etc/yum.repos.d/ali.repo
[base]
name=CentOS-$releasever - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/http://mirrors.cloud.aliyuncs.com/centos/$releasever/os/$basearch/
gpgcheck=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#released updates
[updates]
name=CentOS-$releasever - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/http://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/http://mirrors.cloud.aliyuncs.com/centos/$releasever/updates/$basearch/
gpgcheck=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/
gpgcheck=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/http://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/
gpgcheck=0
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/http://mirrors.aliyuncs.com/centos/$releasever/contrib/$basearch/http://mirrors.cloud.aliyuncs.com/centos/$releasever/contrib/$basearch/
gpgcheck=0
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7EOF

#!/bin/bash### 编译工具,开发库等yum install -y --skip-broken epel-release \git curl wget autoconf automake bison wget \curl-devel \gdbm-devel \gcc-c++ \lua-devel \gnutls-devel \libcurl-devel \libjpeg-devel \libogg-devel \libtiff-devel \libtool \libuuid-devel \libxml2-devel \ncurses-devel \opus-devel \pcre-devel \pkgconfig \portaudio-devel \postgresql-devel \python3-devel \sqlite-devel \unixODBC-devel \zlib-devel \yasm \nasm \libedit-devel \libatomiccat <<"EOF" > /etc/yum.repos.d/okay.repo
[okay]
name=Extra OKay Packages for Enterprise Linux - $basearch
baseurl=http://repo.okay.com.mx/centos/$releasever/$basearch/release
failovermethod=priority
enabled=1
gpgcheck=0
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OKAY[okay-debuginfo]
name=Extra OKay Packages for Enterprise Linux - $basearch - Debug
baseurl=http://repo.okay.com.mx/centos/$releasever/$basearch/debug
failovermethod=priority
enabled=0
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OKAY
#gpgcheck=1EOFyum install -y openssl11-devel --skip-broken
ln -s /usr/lib64/pkgconfig/openssl11.pc /usr/lib64/pkgconfig/openssl.pc
ln -sf /usr/include/openssl11/openssl /usr/include/opensslyum install -y cmake3 --skip-broken
ln -s /usr/bin/cmake3 /usr/bin/cmakeyum localinstall -y --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-7.noarch.rpm
yum install -y --skip-broken ffmpeg-devel speex-devel speexdsp-devel libshout-devel libmpg123-devel lame-devel libsndfile-devel
#!/bin/bash### 编译 libks,sofia-sip, spandsp 以及 freeswitchexport PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib# libks
git clone https://github.com/signalwire/libks.git /usr/src/libks
cd /usr/src/libks
cmake .
make && make install# sofia-sip
git clone https://github.com/freeswitch/sofia-sip /usr/src/sofia-sip
cd /usr//src/sofia-sip
./bootstrap.sh
./configure
make && make install# spandsp
git clone https://github.com/freeswitch/spandsp /usr/src/spandsp
cd /usr/src/spandsp
# https://github.com/signalwire/freeswitch/issues/2248
git checkout 0d2e6ac
./bootstrap.sh
./configure
make &&  make install# freeswitch
git clone https://github.com/signalwire/freeswitch.git -b v1.10.12 /usr/src/freeswitch
cd /usr/src/freeswitch
./bootstrap.sh
sed -i '/mod_signalwire/d' modules.conf
sed -i '/mod_enum/d' modules.conf
sed -i '/mod_opus/d' modules.conf
sed -i 's+#formats/mod_shout+formats/mod_shout+g' modules.conf
sed -i 's+#event_handlers/mod_odbc_cdr+event_handlers/mod_odbc_cdr+g' modules.conf
./configure
make && make install
make cd-sounds-install && make cd-moh-install
echo '/usr/local/lib' >> /etc/ld.so.conf
ldconfig
ln -s /usr/local/freeswitch/bin/freeswitch /usr/bin
ln -s /usr/local/freeswitch/bin/fs_cli /usr/bin

#!/bin/bash### 编译 mod_unimrcp
### 以下步骤仅供参考wget https://www.unimrcp.org/project/component-view/unimrcp-deps-1-6-0-tar-gz/download -O /usr/src/unimrcp-deps-1.6.0.tar.gz
cd /usr/src
tar xvzf unimrcp-deps-1.6.0.tar.gzgit clone https://github.com/unispeech/unimrcp.git /usr/src/unimrcpgit clone https://github.com/freeswitch/mod_unimrcp.git /usr/src/mod_unimrcpexport PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig/:/usr/local/freeswitch/lib/pkgconfig:/usr/local/unimrcp/lib/cd /usr/src/unimrcp-deps-1.6.0 && cd libs/apr && ./configure --prefix=/usr/local/apr && \
make && make install && cd .. && cd apr-util && ./configure --prefix=/usr/local/apr --with-apr=/usr/local/apr && make && make installcd /usr/src/unimrcp && ./bootstrap && ./configure && make && make installcd /usr/src/mod_unimrcp && export PKG_CONFIG_PATH=/usr/local/freeswitch/lib/pkgconfig:/usr/local/unimrcp/lib/pkgconfig && ./bootstrap.sh && ./configure && make && make install

CentOS7.9 确实非常旧,但还是有很多人在使用,不要轻言放弃

还可以进一步优化:

1. sqlite-devel 升级,CentOS7.9 自带的的版本太旧了

2. lua5.1-devel 升级到 lua 5.2

3. 编译 mod_mariadb

4. 编译 mod_opus

等等

这些其实不难,以后如果有机会,我再慢慢补充


http://www.ppmy.cn/news/1547903.html

相关文章

linux进程、文件常见命令

文章目录 进程相关命令日志相关命令 进程相关命令 在Linux系统中&#xff0c;有多个命令可以用来管理和监控进程。以下是一些常用的进程相关命令&#xff1a; ps&#xff1a;查看当前运行的进程。 ps aux&#xff1a;显示所有运行中的进程。ps -ef&#xff1a;显示所有进程的…

【笔记】Vue3回忆录

下载Element-UI 其语句应为 npm install element-plus vue的模块装载 单张视图写完 - 在路由文件router.js中添加视图路径 - 将vue文件装在App.vue中(这一步不是必须的 只在你的视图需要固定待在主页面的时候 其他可切换页面用<router-view>) - 在main.js中导入route…

c# Encoding.GetEncoding

Encoding.GetEncoding 是 C# 中的一个方法&#xff0c;它用于获取特定名称的编码的 Encoding 对象。如果指定的编码名称不存在&#xff0c;则会抛出 ArgumentException。 获取 UTF-8 编码&#xff1a; Encoding encoding Encoding.GetEncoding(“utf-8”); 获取 ASCII 编码…

WebKit的Windows接口(适用2024年11月份版)

WebKit的Windows接口 使用cairo作为图形后端&#xff0c;libcurl作为网络后端。并且它只支持64位的Windows。 安装开发工具 安装带有“使用c进行桌面开发”工作负载的最新Visual Studio。 Activate Developer Mode.激活开发者模式。Build-webkit脚本创建一个指向生成的comp…

ZooKeeper单机、集群模式搭建教程

单点配置 ZooKeeper在启动的时候&#xff0c;默认会读取/conf/zoo.cfg配置文件&#xff0c;该文件缺失会报错。因此&#xff0c;我们需要在将容器/conf/挂载出来&#xff0c;在制定的目录下&#xff0c;添加zoo.cfg文件。 zoo.cfg logback.xml 配置文件的信息可以从二进制包…

hive表名重命名、rename重命名

文章目录 一、重命名表的语法二、重命名遇到的坑2.1、重命名后重建原先的表报表已存在 一、重命名表的语法 在Hive中&#xff0c;重命名表的语法如下&#xff1a; ALTER TABLE table_name RENAME TO new_table_name;示例&#xff1a;alter table user rename to user_bak;注意…

Python学习27天

字典 dict{one:1,two:2,three:3} # 遍历1&#xff1a; # 先取出Key for key in dict:# 取出Key对应的valueprint(f"key:{key}---value:{dict[key]}")#遍历2&#xff0c;依次取出value for value in dict.values():print(value)# 遍历3&#xff1a;依次取出key,value …

Linux自定义终端提示符

转移大全&#xff08;echo -e "\a"等&#xff09; 序列 显示值 \a 以 ASCII 格式编码的铃声 . 当遇到这个转义序列时&#xff0c;计算机会发出嗡嗡的响声。\d 以日&#xff0c;月&#xff0c;天格式来表示当前日期。例如&#xff0c;“Mon May 26.”\h 本地机的…