FS转码安装

安装文件上传

yum install -y wget
tar -zxvf FS-G729-20.tar
cd FS-G729-20/
./install.sh

1、安装说明,install.sh分别替成下面几个文件执行

①上传运行install1.sh到/root/FS-G729-20/,内容为:

#!/bin/bash
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
sed -i 's/Defaults match_group_by_gid/#Defaults match_group_by_gid/' /etc/sudoers
yum remove -y perl perl-DBI mysql mysql-*
yum -y install epel-release
yum makecache fast
yum install -y http://files.freeswitch.org/freeswitch-release-1-6.noarch.rpm epel-release
mv /etc/yum.repos.d/freeswitch-testing.repo /etc/yum.repos.d/freeswitch-testing.repogg
mv /etc/yum.repos.d/freeswitch.repo /etc/yum.repos.d/freeswitch.repogg

 

 执行完此步骤后,注释掉/etc/yum.repos.d/freeswitch-testing.repo#,/etc/yum.repos.d/freeswitch.repo# 

②上传运行install2.sh到/root/FS-G729-20/,内容为:

#!/bin/bash
yum install -y gcc gcc-c++ autoconf automake libtool wget python ncurses-devel zlib-devel ldns-devel
yum install -y openssl-devel libevent libevent-devel sqlite-devel libcurl-devel pcre-devel libxml2-devel
yum install -y libdb4* libidn-devel unbound-devel libuuid-devel lua-devel libsndfile-devel libjpeg-devel
yum install -y speex-devel libedit-devel e2fsprogs-devel gsm gsm-devel re2c redis mariadb mariadb-server
yum install -y git nginx php php-fpm php-devel php-pdo php-mysql php-mysqli php-mcrypt php-mbstring
yum install -y alsa-lib-devel autoconf automake bison broadvoice-devel bzip2 curl-devel e2fsprogs-devel flite-devel g722_1-devel gcc-c++ 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 libtheora-devel libtiff-devel libtool libuuid-devel 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 wget which yasm zlib-devel
yum install -y unixODBC-devel
yum install -y mysql-connector-odbc
yum install -y net-tools wget

groupadd pbx
usermod -g pbx nginx

cd /root/FS-G729-20/freeswitch-1.6.20/
./configure --disable-debug --disable-libyuv --disable-libvpx
mv /root/FS-G729-20/freeswitch-1.6.20/src/mod/codecs/mod_opus /root/FS-G729-20/freeswitch-1.6.20/src/mod/codecs/ggmod_opusgg

 执行完此步骤后,注释掉/root/FS-G729-20/freeswitch-1.6.20/src/mod/codecs/#mod_opus#

③上传运行install3.sh到/root/FS-G729-20/,内容为:

#!/bin/bash
cd /root/FS-G729-20/freeswitch-1.6.20/

make && make install

cd /root/FS-G729-20/freeswitch-1.6.20
cd libs/esl
make phpmod
\cp -Rf php/ESL.so /usr/lib64/php/modules

cd /root/FS-G729-20/phpredis
phpize
./configure
make && make install

cd /root/FS-G729-20/yaf-2.3.5
phpize
./configure
make && make install
cd /root/FS-G729-20
\cp -Rf cdr /var/
\cp -Rf www /var/
mkdir -p /var/record
chown -R root:pbx /var/cdr
chown -R root:pbx /var/www
chown -R root:pbx /var/record
chmod -R g+w /var/record
chmod -R 7777 /var/record
chmod -R 777 /var/cdr
chmod -R 777 /var/www
cd /root/FS-G729-20/config
echo -en "->\033[37m install mariadb configuration ";echo -e "\033[32m [ OK ] \033[0m"
\cp -Rf my.cnf /etc/my.cnf
chmod 644 /etc/my.cnf
echo -en "->\033[37m install php configuration ";echo -e "\033[32m [ OK ] \033[0m"
\cp -Rf php.ini /etc/php.ini
chmod 644 /etc/php.ini
echo -en "->\033[37m install nginx configuration ";echo -e "\033[32m [ OK ] \033[0m"
\cp -Rf nginx.conf /etc/nginx/nginx.conf
chmod 644 /etc/nginx/nginx.conf
echo -en "->\033[37m install freeswitch configuration ";echo -e "\033[32m [ OK ] \033[0m"
rm -rf /usr/local/freeswitch/conf
\cp -Rf conf /usr/local/freeswitch/conf
chown -R root:pbx /usr/local/freeswitch/conf
chmod -R g+w /usr/local/freeswitch/conf
chmod -R 777 /usr/local/freeswitch/conf
ln -s /usr/local/freeswitch/bin/fs_cli /usr/bin/fs_cli
ln -s /usr/local/freeswitch/bin/freeswitch /usr/bin/freeswitch
\cp -Rf freeswitch.service /etc/systemd/system/freeswitch.service
\cp -Rf mod_g729.so /usr/local/freeswitch/mod/mod_g729.so
chown root:root /etc/systemd/system/freeswitch.service
chmod 777 /etc/systemd/system/freeswitch.service
chmod 777 /usr/local/freeswitch/mod/mod_g729.so
echo -en "->\033[37m install sysctl configuration ";echo -e "\033[32m [ OK ] \033[0m"
\cp -Rf sysctl.conf /etc/sysctl.conf
chmod 644 /etc/sysctl.conf
echo -en "->\033[37m install limits configuration ";echo -e "\033[32m [ OK ] \033[0m"
\cp -Rf limits.conf /etc/security/limits.conf
chmod 644 /etc/security/limits.conf
echo -en "->\033[37m install redis-cli configuration ";echo -e "\033[32m [ OK ] \033[0m"
systemctl restart redis.service
/usr/bin/redis-cli < config.txt
echo -en "->\033[37m install pbxmon configuration ";echo -e "\033[32m [ OK ] \033[0m"
systemctl restart mariadb.service
/usr/bin/mysql < pbxmon.sql
systemctl stop firewalld
systemctl disable firewalld
systemctl disable auditd.service
systemctl disable firewalld.service
systemctl disable microcode.service
systemctl disable NetworkManager.service
systemctl disable postfix.service
systemctl disable tuned.service
systemctl enable freeswitch.service
systemctl enable nginx.service
systemctl enable php-fpm.service
systemctl enable redis.service
systemctl enable mariadb.service
yum install ntp crontabs ld-linux.so.2 -y
ntpdate us.pool.ntp.org
echo -e "01 00 * * * /usr/local/freeswitch/conf/reinit &" >> /var/spool/cron/root
echo -e "01 08 * * * reboot" >> /var/spool/cron/root
echo -e "04 3 * * * find /var/record/* -type d -mtime +90 -name "*" -exec rm -rf {} \;" >> /var/spool/cron/root
chmod -R 7777 /usr/local/freeswitch/conf/reinit
cd /root/FS-G729-20
cd ..
shutdown -r now

 

执行完后重启服务器。

2、安装完成后重启服务器

重启服务器后运行
useradd -s /sbin/nologin -M pbx
nginx -c /etc/nginx/nginx.conf
nginx -s reload
 
更改web端口:vi /etc/nginx/nginx.conf
重新加载nginx:nginx -s reload 重新编写或更新配置。

3、优化

#优化:更换编码库
#ipp库导入 mod_g729.so 导入下面位置
/usr/local/freeswitch/mod
#进入控制台(无打印日志状态进入)
fs_cli -q
reload mod_g729
fsctl shutdown now
/usr/local/freeswitch/bin/freeswitch -nc
#fs_cli -q

#关闭日志 link https:wsonh.com/article/103.html
vi /usr/local/freeswitch/conf/modules/switch.conf.xml
<param name="loglevel" value="crit">

 

 

posted @ 2022-12-27 11:19  Flyoung  阅读(87)  评论(0编辑  收藏  举报