1. CentOS8 安裝FreeSWITCH 1.10.4 及mod_av(全網第一份):
  2. 寧衛通信
  3. 新聞動態
  4. 寧衛新聞
  5. CentOS8 安裝FreeSWITCH 1.10.4 及mod_av(全網第一份)

CentOS8 安裝FreeSWITCH 1.10.4 及mod_av(全網第一份)

在系統中先安裝各式的依賴或編譯環境包,在編譯時,使用make -j 4 中4代表是有4核的cpu

```bash
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm -y

dnf-builddep -y freeswitch

dnf install -y yum-plugin-ovl centos-release-scl rpmdevtools yum-utils git

dnf install -y devtoolset-4-gcc*

dnf install -y git subversion autoconf automake libtool gcc-c++ ncurses-devel make 

dnf -y install expat-devel openssl-devel libtiff-devel libX11-devel unixODBC-devel libssl-devel python-devel  

dnf -y install zlib-devel libzrtpcpp-devel alsa-lib-devel libogg-devel libvorbis-devel perl-libs gdbm-devel  

dnf -y install libdb-devel uuid-devel @development-tools  patch 

dnf -y install ldns-devel libidn-devel unbound-devel 

dnf -y install libjpeg-devel sqlite-devel libcurl-devel 

dnf -y install pcre-devel libuuid-devel bison-devel bison 

dnf -y install speex-devel libtheora-devel yasm nasm libedit-devel libicu

dnf install libsndfile-devel.x86_64 cmake lua-devel -y

dnf install opus-devel.x86_64 opusfile-devel.x86_64 -y

dnf install libvpx-devel.x86_64 -y

dnf install mariadb-devel.x86_64 -y

dnf install libogg.x86_64 opus.x86_64 -y

dnf install ldns.x86_64 -y
 
dnf install lua -y
 
dnf install spandsp-devel.x86_64 -y

dnf install speex.x86_64 baresip-speex_pp.x86_64 speexdsp.x86_64 -y
```

由于CentOS8缺一些庫的dnf下載,所以把一些依賴通過從其它網站上下載后,再安裝模式 

```bash
wget http://www.rpmfind.net/linux/centos/8.2.2004/PowerTools/x86_64/os/Packages/speex-devel-1.2.0-1.el8.x86_64.rpm

wget http://www.rpmfind.net/linux/centos/8.2.2004/AppStream/x86_64/os/Packages/speexdsp-1.2-0.13.rc3.el8.x86_64.rpm

wget http://www.rpmfind.net/linux/centos/8.2.2004/PowerTools/x86_64/os/Packages/speexdsp-devel-1.2-0.13.rc3.el8.x86_64.rpm

wget http://www.rpmfind.net/linux/centos/8.2.2004/PowerTools/x86_64/os/Packages/ldns-devel-1.7.0-21.el8.x86_64.rpm

 wget http://www.rpmfind.net/linux/centos/8-stream/PowerTools/x86_64/os/Packages/libedit-devel-3.1-23.20170329cvs.el8.x86_64.rpm
 rpm -hiv libedit-devel-3.1-23.20170329cvs.el8.x86_64.rpm ldns-devel-1.7.0-21.el8.x86_64.rpm speexdsp-devel-1.2-0.13.rc3.el8.x86_64.rpm speexdsp-1.2-0.13.rc3.el8.x86_64.rpm speex-devel-1.2.0-1.el8.x86_64.rpm
 
 wget http://www.rpmfind.net/linux/centos/8-stream/AppStream/x86_64/os/Packages/libvpx-1.7.0-8.el8.x86_64.rpm
 
 wget http://www.rpmfind.net/linux/centos/8-stream/PowerTools/x86_64/os/Packages/libvpx-devel-1.7.0-8.el8.x86_64.rpm
 rpm -hiv libvpx-devel-1.7.0-8.el8.x86_64.rpm libvpx-1.7.0-8.el8.x86_64.rpm
 
  wget http://www.rpmfind.net/linux/centos/8-stream/PowerTools/x86_64/os/Packages/nasm-2.13.03-2.el8.x86_64.rpm
  
  wget http://www.rpmfind.net/linux/centos/8.2.2004/PowerTools/x86_64/os/Packages/yasm-1.3.0-7.el8.x86_64.rpm
  rpm -hiv nasm-2.13.03-2.el8.x86_64.rpm
  rpm -hiv yasm-1.3.0-7.el8.x86_64.rpm
  
  wget http://www.rpmfind.net/linux/centos/8.2.2004/PowerTools/x86_64/os/Packages/lua-devel-5.3.4-11.el8.x86_64.rpm
  rpm -hiv lua-devel-5.3.4-11.el8.x86_64.rpm
  
  wget http://www.rpmfind.net/linux/centos/8.2.2004/PowerTools/x86_64/os/Packages/opus-devel-1.3-0.4.beta.el8.x86_64.rpm
  
  wget http://www.rpmfind.net/linux/centos/8.2.2004/PowerTools/x86_64/os/Packages/libogg-devel-1.3.2-10.el8.x86_64.rpm
  rpm -hiv libogg-devel-1.3.2-10.el8.x86_64.rpm opus-devel-1.3-0.4.beta.el8.x86_64.rpm
  
  wget http://www.rpmfind.net/linux/centos/8-stream/PowerTools/x86_64/os/Packages/libsndfile-devel-1.0.28-10.el8.x86_64.rpm
   rpm -hiv libsndfile-devel-1.0.28-10.el8.x86_64.rpm
  

```





先下載fs

```bash
cd /opt/

git clone -b v1.10.4 https://gitee.com/nwaycn/freeswitch.git
```



~~ffmpeg的rpm安裝方式~~,如果是mini centos安裝,以下不要執行

```bash
#su -c 'dnf localinstall --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'

#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-1.el7.nux.noarch.rpm

#dnf install ffmpeg ffmpeg-devel`
 
 
```

~~從源碼編譯ffmpeg,帶265~~



如果之前已經通過yum安裝了,那么需要先刪掉,即rpm -qa | grep ffmpeg后按版本,類似于

```bash
rpm -e ffmpeg-devel-3.4.8-1.el7.x86_64 ffmpeg-libs-3.4.8-1.el7.x86_64 ffmpeg-3.4.8-1.el7.x86_64 libavdevice-3.4.8-1.el7.x86_64 
```

先配置PKG_CONFIG_PATH

```bash
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
```

Fdk-aac

```bash
git clone --depth 1 git://github.com/mstorsjo/fdk-aac.git
cd fdk-aac
autoreconf -fiv
./configure --disable-shared --with-pic
make && make install
```

h264

```bash
git clone https://code.videolan.org/videolan/x264.git
cd x264
./bootstrap.sh
./configure --enable-shared –enable-static --disable-asm  
sudo make
sudo make install
```

h265

```bash
wget -c https://bitbucket.org/multicoreware/x265/downloads/x265_3.4.tar.gz

tar zxvf x265_3.4.tar.gz

cd x265_3.4

cd build/linux

./make-Makefiles.bash

make && make install
```

ffmpeg

```bash
git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
cd ffmpeg
./configure --enable-libx264 --enable-libx265 --enable-pic --enable-gpl
make -j 4
make install
```

復雜點的,編譯時支持更多編解碼

```bash
 ./configure   --prefix=/opt/nway/ffmpeg --extra-cflags=-I/opt/nway/ffmpeg/include  --extra-ldflags=-L/opt/nway/ffmpeg/lib --enable-gpl   --enable-version3  --enable-nonfree --disable-static --enable-shared --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages  --enable-zlib --enable-iconv --enable-libx264 --enable-libx265 --enable-libmp3lame  --enable-libfdk-aac --enable-pic

make -j 4 && make install

```



Freeswitch

```bash
cd /opt/

git clone -b v1.10.4 https://gitee.com/nwaycn/freeswitch.git

cd freeswitch

./bootstrap.sh -j
```



sofia-sip

```bash
cd /opt/freeswitch/libs

git clone https://github.com/freeswitch/sofia-sip.git

cd sofia-sip/

sh autogen.sh 

./configure --with-pic

make && make install

cp /usr/local/lib/pkgconfig/sofia-sip-ua.pc /usr/lib64/pkgconfig/.
```



spandsp

```bash
cd /opt/freeswitch/libs

git clone https://github.com/freeswitch/spandsp.git

cd spandsp

./bootstrap.sh

./configure --with-pic

make && make install

cp /usr/local/lib/pkgconfig/spandsp.pc /usr/lib64/pkgconfig/.
```

修改modules.conf為以下,當然如果不需要postgresql的支持就把它去掉,mod_av需要ffmpeg支持

```latex
#applications/mod_av

applications/mod_blacklist
applications/mod_callcenter

applications/mod_commands
applications/mod_conference

applications/mod_db

applications/mod_dptools

applications/mod_enum
applications/mod_esf

applications/mod_expr
applications/mod_fifo

applications/mod_fsv
applications/mod_hash

applications/mod_httapi
 
applications/mod_sms
 
applications/mod_spandsp
 
applications/mod_valet_parking

 
applications/mod_voicemail
 
codecs/mod_amr
 
codecs/mod_b64

codecs/mod_g723_1
codecs/mod_g729
codecs/mod_h26x
 
codecs/mod_opus
 
#databases/mod_pgsql
dialplans/mod_dialplan_asterisk
 
dialplans/mod_dialplan_xml
 
endpoints/mod_rtc
 
endpoints/mod_skinny
endpoints/mod_sofia
endpoints/mod_verto
 
event_handlers/mod_cdr_csv
 

event_handlers/mod_cdr_pg_csv
event_handlers/mod_cdr_sqlite
 
event_handlers/mod_event_socket
event_handlers/mod_fail2ban
 
formats/mod_local_stream
formats/mod_native_file
formats/mod_png
 
formats/mod_sndfile
 
formats/mod_tone_stream
 
languages/mod_lua
 
loggers/mod_console
 
loggers/mod_logfile
loggers/mod_syslog
 
xml_int/mod_xml_cdr
xml_int/mod_xml_curl
 
xml_int/mod_xml_rpc
xml_int/mod_xml_scgi

#../../libs/freetdm/mod_freetdm
```

如果是純內網中,需要修改 /usr/local/freeswitch/conf/vars.xml中

```xml
<X-PRE-PROCESS cmd="stun-set" data="external_rtp_ip=10.0.0.25"/>
<X-PRE-PROCESS cmd="stun-set" data="external_sip_ip=10.0.0.25"/>
```

FreeSWITCH

```bash
cd /opt/freeswitch/

./configure -C && make -j 4

./make install 
```

如果提示 freetdm相關異常的話,就rm /opt/freeswitch/libs/libfreetdm  類似的庫

ag真人视讯腾讯微博 山西快乐十分钟如何玩 极速11选5投注技巧 浙江快乐12开预测 微信捕鱼红包的游戏 双色球大奖2000年 天天德州百家乐 2021年119期码报 宁夏11选5走势图手机版下载 体彩七乐彩走势图 极速赛车走势图 支付宝理财产品 怎么打好武汉麻将 148期足彩预计奖金 ag视讯app在哪下载 陕西快乐10分走势图彩票站专用软件 快乐赛车开奖结果