FreeSwitch Linux(CentOS 6.5) 安装教程

2023-07-19 17:05:58 浏览数 (1)

1. 安装所需环境插件

代码语言:javascript复制
yum install -y git gcc-c   wget alsa-lib-devel autoconf automake bison broadvoice-devel bzip2 curl-devel db-devel e2fsprogs-devel flite-devel g722_1-devel gdbm-devel gnutls-devel ilbc2-devel ldns-devel libcodec2-devel libcurl-devel libedit-devel libidn-devel libjpeg-devel libmemcached-devel libogg-devel libsilk-devel libsndfile-devel libtiff-devel libtheora-devel libtool libvorbis-devel libxml2-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 python26-devel python-devel soundtouch-devel speex-devel sqlite-devel unbound-devel unixODBC-devel libuuid-devel which yasm zlib-devel

2. 获取源码包

代码语言:javascript复制
wget  http://files.freeswitch.org/freeswitch-releases/freeswitch-1.*.*.tar.gz

这是资源站点,自行选择版本:http://files.freeswitch.org/freeswitch-releases/

3. 安装yasm

代码语言:javascript复制
((which nasm) || (which yasm) || (git clone https://github.com/yasm/yasm.git && cd yasm && ./autogen.sh && make && make install))

4. 安装 lua-devel

代码语言:javascript复制
yum install lua lua-devel

5. 安装ODBC

代码语言:javascript复制
yum install -y unixODBC unixODBC-devel mysql-connector-odbc

编辑 /etc/odbc.ini

如不存在该文件,可复制odbcinst.ini,然后命名为odbc.ini

代码语言:javascript复制
[freeswitch]
Driver = MySQL
SERVER = localhost
PORT = 3306
DATABASE = freeswitch
OPTION = 67108864
USER = root
PASSWORD = fdx660312
CHARSET = UTF8

6. 测试ODBC

代码语言:javascript复制
isql -v freeswitch

7. 配置FS的mod

编辑 /usr/local/freeswitch-1.*.*/modules.conf

根据你的需要开启mod

8. 安装FS

./configure (默认,如需开启特殊mod支持,可参考odbc configure)

./configure --enable-core-odbc-support (开启odbc支持)

代码语言:javascript复制
make
make install

以下为错误提示解决方案!!!

错误提示: You must install libopus-dev to build mod_opus

代码语言:javascript复制
yum -y install opus-devel
#可能需要清理
make clean 
#或者使用
./configure
#又或者
make

如果还是报这个错误, 就注释这两行,在Makefile:

代码语言:javascript复制
vim freeswitch/src/mod/codecs/mod_opus/Makefile
代码语言:javascript复制
# Comment line 896 & 897
#install: error
#all: error

错误提示 : You must install libsndfile-dev to build mod_sndfile

代码语言:javascript复制
yum install libsndfile-devel

然后 重新 configure 再 make

如果还是报这个错误,就修改这两行,在 Makefile 末尾:

代码语言:javascript复制
vim src/mod/formats/mod_sndfile/Makefile

# 修改这两行 install: install-am

all: install

然后 再 make

错误提示: You must install libyuv-dev to build mod_fsv

代码语言:javascript复制
#按步骤执行如下命令:
cd freeswitch/libs  
git clone https://freeswitch.org/stash/scm/sd/libyuv.gitcd libyuv
make -f linux.mk CXXFLAGS="-fPIC -O2 -fomit-frame-pointer -Iinclude/"
make install
cp /usr/lib/pkgconfig/libyuv.pc /usr/lib64/pkgconfig/

错误提示: You must install libvpx-dev to build ....

代码语言:javascript复制
#按步骤执行如下命令:
cd freeswitch/libs
git clone https://freeswitch.org/stash/scm/sd/libvpx.git
cd libvpx
./configure --enable-pic --disable-static --enable-shared
make
make install
cp /usr/local/lib/pkgconfig/vpx.pc /usr/lib64/pkgconfig/

错误提示: You must install libpng-dev to build ....

代码语言:javascript复制
#按步骤执行如下命令:
cd freeswitch/libs
git clone https://freeswitch.org/stash/scm/sd/libpng.git
cd libpng
./configure
make
make install
cp /usr/local/lib/pkgconfig/libpng* /usr/lib64/pkgconfig/

错误提示: You must install libav-dev to build mod_av或者 : You must install libavformat-dev to build mod_av

代码语言:javascript复制
#按步骤执行如下命令:
cd freeswitch/libs
git clone https://freeswitch.org/stash/scm/sd/libav.git
#或者 
wget https://freeswitch.org/stash/rest/api/latest/projects/SD/repos/libav/archive?format=zip
cd libav
./configure             #CFLAGS="-fPIC" ./configure --enable-pic --enable-shared
make                    # make CXXFLAGS="-fPIC"
make install

0 人点赞