首页 > 其他分享 >FS转码安装

FS转码安装

时间:2022-12-27 11:22:33浏览次数:44  
标签:FS conf 转码 devel etc install freeswitch 033 安装

安装文件上传

yum install -y wget
tar -zxvf FS-G729-20.tar
cd FS-G729-20/
先编译FS,编译完后重名/root/FS-G729-20/freeswitch-1.6.20/src/mod/codecs/#mod_opus#
这个编码不常用,但是影响安装。
./install.sh

1、安装说明,install.sh替换为下面内容

#!/bin/bash
READPROCFD=`readlink /proc/$$/fd/255`
MYDIR=$(dirname $READPROCFD)
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 #安装完此步,注释掉freeswitch-testing.repo#,freeswitch.repo#
mv  /etc/yum.repos.d/freeswitch-testing.repo /etc/yum.repos.d/freeswitch-testing.repo#
mv  /etc/yum.repos.d/freeswitch.repo /etc/yum.repos.d/freeswitch.repo#
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 root
usermod -g root nginx

cd $MYDIR/freeswitch*
./configure --disable-debug --disable-libyuv --disable-libvpx #运行完此步,注释掉/root/FS-G729-20/freeswitch-1.6.20/src/mod/codecs/#mod_opus#
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/#mod_opus#
make && make install

cd libs/esl
make phpmod
\cp -Rf php/ESL.so /usr/lib64/php/modules

cd $MYDIR/phpredis
phpize
./configure
make && make install

cd $MYDIR/yaf-2.3.5
phpize
./configure
make && make install
cd $MYDIR
\cp -Rf cdr /var/
\cp -Rf www /var/
mkdir -p /var/record
chown -R root:root /var/cdr
chown -R root:root /var/www
chown -R root:root /var/record
chmod -R g+w /var/record
chmod -R 7777 /var/record
chmod -R 777 /var/cdr
chmod -R 777 /var/www
cd $MYDIR/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:root /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 rootmon configuration     ";echo -e "\033[32m [ OK ] \033[0m"	
systemctl restart mariadb.service
/usr/bin/mysql < rootmon.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 $MYDIR
cd ..

useradd -s /sbin/nologin -M pbx
nginx -c /etc/nginx/nginx.conf
nginx -s reload
reboot

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">

 

标签:FS,conf,转码,devel,etc,install,freeswitch,033,安装
From: https://www.cnblogs.com/flyoung/p/17007663.html

相关文章