当前位置: 首页 > article >正文

CentOS7.9 源码编译 FreeSWITCH 1.10.12

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


#!/bin/bash
 
### 更换 repo
 
mkdir /root/repo
mv /etc/yum.repos.d/*.repo /root/repo
 
 
cat <<"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-7
 
EOF

#!/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 \
    libatomic

cat <<"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=1

EOF

yum 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/openssl

yum install -y cmake3 --skip-broken
ln -s /usr/bin/cmake3 /usr/bin/cmake

yum 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 以及 freeswitch

export 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.gz

git clone https://github.com/unispeech/unimrcp.git /usr/src/unimrcp

git clone https://github.com/freeswitch/mod_unimrcp.git /usr/src/mod_unimrcp

export 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 install

cd /usr/src/unimrcp && ./bootstrap && ./configure && make && make install

cd /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.kler.cn/a/400579.html

相关文章:

  • 掌握Golang中的数据竞争检测:runtime/race包全面教程
  • 解决 Spring Boot 中 `Ambiguous mapping. Cannot map ‘xxxController‘ method` 错误
  • 美赛优秀论文阅读--2023C题
  • 【Nginx从入门到精通】03 、安装部署-让虚拟机可以联网
  • Python 人脸检测:使用 Dlib 和 OpenCV
  • ScubaGear:用于评估 Microsoft 365 配置是否存在安全漏洞的开源工具
  • 利用MQTT和SSL/TLS实现数据加密
  • 网络安全最新XSS漏洞
  • 【视觉SLAM】4b-特征点法估计相机运动之PnP 3D-2D
  • mysql bin log分析
  • SpringBoot(6)-Shiro
  • 无人机反制新突破,高功率激光反无技术详解
  • 在vue3中如何优雅的管理loading状态
  • 深入内核讲明白Android Binder【一】
  • C++ STL知识点100问
  • 基于YOLOv8深度学习的智慧农业柑橘病害识别检测系统(PyQt5界面+数据集+训练代码)
  • ISCTF 2024 web
  • aws云服务器:高可靠性和数据安全
  • 使用 Easegress 实现 Telegram 翻译机器人
  • 鸿蒙北向开发环境安装指南
  • 使用ivew-ui-plus 的Submit组件踩坑 injection “LoginInstance“ not found 记录 问题原因分析与解决方案
  • HarmonyOS 如何获取设备信息(系统、版本、网络连接状态)
  • HMSC联合物种分布模型在群落生态学中的贝叶斯统计分析应用
  • SpringBoot使用@Validated注解实现参数的验证
  • Docker中的一些常用命令
  • git根据远程分支创建本地新分支