编译安装FreeSWITCH 1.10.8

由 jafucong 发布

编译安装FreeSWITCH 1.10.8

本站FreeSWITCH镜像站:http://freeswitch.clx.fun:12130/
每日同步一次。

2022年10月14日,freeswitch的1.10.8版本发布了,许久没有编译FreeSWITCH源码了,为防止手生,特来回顾一下。

1. 安装源

修改系统仓库源为阿里云(解决官方源速度问题)

rm -rf /etc/yum.repos.d/*
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all && yum makecache

官方源(需要开发者帐号,速度尚可):

yum install -y https://files.freeswitch.org/repo/yum/centos-release/freeswitch-release-repo-0-1.noarch.rpm epel-release

本站镜像源:

yum install -y epel-release wget
wget -O /etc/yum.repos.d/freeswitch-release.repo http://freeswitch.clx.fun:12130/freeswitch-release.repo
yum clean all && yum makecache

2. 安装依赖

一般依赖
yum install -y yum-plugin-ovl centos-release-scl rpmdevtools yum-utils git
yum install -y spandsp3-devel
yum-builddep -y freeswitch --skip-broken
yum install -y alsa-lib-devel autoconf automake bison broadvoice-devel bzip2 centos-release-scl cmake3 curl-devel devtoolset-7 devtoolset-7-gcc* e2fsprogs-devel erlang flite-devel g722_1-devel gcc-c++ gdbm-devel git gnutls-devel ilbc2-devel lame-devel ldns-devel libatomic libcodec2-devel libcurl-devel libdb4* libdb4-devel libedit-devel libidn-devel libjpeg-devel libmemcached-devel libmpg123-devel libogg-devel libpqxx-devel libshout-devel libsilk-devel libsndfile-devel 
yum install -y libtheora-devel libtiff-devel libtool libuuid-devel libvorbis-devel libvpx2* libvpx-devel libxml2-devel libyuv-devel lua-devel lzo-devel mongo-c-driver-devel ncurses-devel net-snmp-devel openssl-devel opus-devel pcre-devel perl perl-ExtUtils-Embed pkgconfig portaudio-devel postgresql-devel postgresql-libs python-devel rpmdevtools soundtouch-devel speex-devel sqlite-devel unbound-devel unixODBC unixODBC-devel unixODBC-devel.x86_64 vim wget which yasm yasm-devel yum-plugin-ovl yum-utils zlib-devel 
yum install -y sofia-sip-devel libks nasm
mod_av依赖(以下为官方路径,本站路径请替换为:http://freeswitch.clx.fun:12130/src-releases/libs/)
wget -c http://files.freeswitch.org/downloads/libs/libx264.tar.bz2
tar -jxvf libx264.tar.bz2
cd libx264
./configure --enable-static --enable-shared --prefix=/usr
make
make install
cp /usr/lib/pkgconfig/x264.pc /usr/lib64/pkgconfig/
cp /usr/lib/libx264.so /usr/lib64/
cp /usr/lib/libx264.a /usr/lib64/
cd ../
# download and install libav
wget -c http://files.freeswitch.org/downloads/libs/libav-12.tar.bz2  
tar -jxvf libav-12.tar.bz2
cd libav
./configure --enable-pic --enable-shared  --enable-libx264 --enable-gpl --extra-libs="-ldl" --extra-cflags=-I/usr/include --extra-ldflags=-L/usr/lib64
make    # make CXXFLAGS="-fPIC"
make install
cp /usr/local/lib/pkgconfig/libavcodec.pc /usr/local/lib/pkgconfig/libavdevice.pc /usr/local/lib/pkgconfig/libavfilter.pc /usr/local/lib/pkgconfig/libavformat.pc /usr/local/lib/pkgconfig/libavresample.pc /usr/local/lib/pkgconfig/libavutil.pc /usr/local/lib/pkgconfig/libswscale.pc /usr/lib64/pkgconfig/
cd ../
# 执行刷新,以让FreeSWITCH运行时可以找到库
ldconfig

3. 编译FreeSWITCH

modules.conf中注释掉applications/mod_signalwire
如果不需要mod_av还需要注释掉applications/mod_av

wget http://freeswitch.clx.fun:12130/src-releases/freeswitch/freeswitch-1.10.8.-release.tar.gz
tar vzxf freeswitch-1.10.8.-release.tar.gz
cd freeswitch-1.10.8.-release
./bootstrap.sh -j
./configure --enable-portable-binary \
            --prefix=/usr --localstatedir=/var --sysconfdir=/etc \
            --with-gnu-ld --with-openssl \
            --enable-core-odbc-support --enable-zrtp
make
make -j install

make -j cd-sounds-install
make -j cd-moh-install

验证安装

[root@fs-dev ~]# freeswitch -nonat
.=============================================================.
|   _____              ______        _____ _____ ____ _   _   |
|  |  ___| __ ___  ___/ ___\ \      / /_ _|_   _/ ___| | | |  |
|  | |_ | '__/ _ \/ _ \___ \\ \ /\ / / | |  | || |   | |_| |  |
|  |  _|| | |  __/  __/___) |\ V  V /  | |  | || |___|  _  |  |
|  |_|  |_|  \___|\___|____/  \_/\_/  |___| |_| \____|_| |_|  |
|                                                             |
.=============================================================.
|   Anthony Minessale II, Michael Jerris, Brian West, Others  |
|   FreeSWITCH (http://www.freeswitch.org)                    |
|   Paypal Donations Appreciated: paypal@freeswitch.org       |
|   Brought to you by ClueCon http://www.cluecon.com/         |
.=============================================================.

.=======================================================================================================.
|       _                            _    ____ _             ____                                       |
|      / \   _ __  _ __  _   _  __ _| |  / ___| |_   _  ___ / ___|___  _ __                             |
|     / _ \ | '_ \| '_ \| | | |/ _` | | | |   | | | | |/ _ \ |   / _ \| '_ \                            |
|    / ___ \| | | | | | | |_| | (_| | | | |___| | |_| |  __/ |__| (_) | | | |                           |
|   /_/   \_\_| |_|_| |_|\__,_|\__,_|_|  \____|_|\__,_|\___|\____\___/|_| |_|                           |
|                                                                                                       |
|    ____ _____ ____    ____             __                                                             |
|   |  _ \_   _/ ___|  / ___|___  _ __  / _| ___ _ __ ___ _ __   ___ ___                                |
|   | |_) || || |     | |   / _ \| '_ \| |_ / _ \ '__/ _ \ '_ \ / __/ _ \                               |
|   |  _ < | || |___  | |__| (_) | | | |  _|  __/ | |  __/ | | | (_|  __/                               |
|   |_| \_\|_| \____|  \____\___/|_| |_|_|  \___|_|  \___|_| |_|\___\___|                               |
|                                                                                                       |
|     ____ _             ____                                                                           |
|    / ___| |_   _  ___ / ___|___  _ __         ___ ___  _ __ ___                                       |
|   | |   | | | | |/ _ \ |   / _ \| '_ \       / __/ _ \| '_ ` _ \                                      |
|   | |___| | |_| |  __/ |__| (_) | | | |  _  | (_| (_) | | | | | |                                     |
|    \____|_|\__,_|\___|\____\___/|_| |_| (_)  \___\___/|_| |_| |_|                                     |
|                                                                                                       |
.=======================================================================================================.


2022-10-20 11:32:24.867345 [INFO] switch_core.c:2494
FreeSWITCH Version 1.10.8-release~64bit (-release 64bit)

FreeSWITCH Started
Max Sessions [1000]
Session Rate [30]
SQL [Enabled]
2022-10-20 11:32:24.867359 [CONSOLE] switch_core.c:2502
[This app Best viewed at 160x60 or more..]
freeswitch@fs-dev>

4 条评论

  1. 八九不梨石
    八九不梨石 · 2023-03-30 14:43

    博主你好。咱们有交流群么?

    1. jafucong
      jafucong 回复 八九不梨石 · 2023-04-14 12:21 作者

      暂时没有哟。目前在研究硬件4G语音设备相关的。fs很久没做新的研究了。

  2. 惜何年
    惜何年 · 2022-12-29 21:08

    博主,我根据你的教程一步步往下,发现在你的仓库中提供的freeSwitch-1.10.8压缩包中并没有bootstrap.sh这个文件

    1. jafucong
      jafucong 回复 惜何年 · 2023-03-30 11:20 作者

      bootstrap.sh一般用于生成configure文件,freeswitch-1.10.8源码包已经内置了configure,你可以不执行。如果需要自己生成新的configure文件,可以使用rebootstrap.sh文件。

发表评论