preloader
blog-post

在中标麒麟系统中安装FSGUI/postgresql13.6

author image

  由于在客户现场需要使用各类国产系统,之前银河麒麟、中标麒麟都也试过,但之前没做记录,所以这次拿中标麒麟做下记录。

系统版本

一、应用场景

  较为传统的指挥报警系统,因为安全等因素,所以我们建议使用鼎信通达的MTG系列网关来实现电话业务的呼入及呼出,使用FSGUI进行排队以及相关消息通知。

二、安装postgresql 13.6


wget https://ftp.postgresql.org/pub/source/v13.6/postgresql-13.6.tar.gz

yum install libedit* -y

tar zxvf postgresql-13.6.tar.gz

cd postgresql-13.6

./configure

make

su

make install

adduser postgres

mkdir /db/data
chown postgres /db/data
su - postgres
/usr/local/pgsql/bin/initdb -D /db/data
/usr/local/pgsql/bin/pg_ctl -D /db/data -l logfile start
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/createdb nwaycc
/usr/local/pgsql/bin/psql test
####然后处理自启脚本
exit    #退到root下的postgresql-13.6目录
vim contrib/start-scripts/linux
#PGDATA改为以下
PGDATA="/db/data"
#:wq保存退出
cp contrib/start-scripts/linux /etc/init.d/postgresql

然后导入宁卫nwaycc数据库

pg_restore -h 127.0.0.1 -U postgres -W -d nwaycc -v "nwaycc.backup"

三、编译FreeSWTICH

安装依赖包

在系统中先安装各式的依赖或编译环境包,在编译时,使用make -j 4 中4代表是有4核的cpu

yum install -y   rpmdevtools yum-utils git
 

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

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

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

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

yum -y install ldns-devel libidn-devel unbound-devel

yum -y install libjpeg-devel sqlite-devel libcurl-devel

yum -y install pcre-devel libuuid-devel bison-devel bison

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

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

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

yum install libvpx-devel.x86_64 libcurl-devel.x86_64 jsoncpp-devel -y

yum install mariadb-devel.x86_64 libshout-devel.x86_64 mpg123-devel.x86_64 twolame-devel.x86_64 lame-devel.x86_64 -y

yum install libjpeg-turbo-devel.x86_64 sqlite-devel.x86_64 jpegoptim.x86_64 openjpeg2-devel.x86_64 turbojpeg-devel.x86_64 -y

先下载fs

cd /opt/

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

cd freeswitch

./bootstrap.sh

先配置PKG_CONFIG_PATH

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
Fdk-aac
cd /opt/freeswitch/libs
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
#git clone https://code.videolan.org/videolan/x264.git
cd /opt/freeswitch/libs
git clone https://gitee.com/nwaycn/x264.git
cd x264
#./bootstrap.sh
./configure --enable-shared –enable-static --disable-asm  
sudo make
sudo make install
ffmpeg
#git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
cd /opt/freeswitch/libs
git clone https://gitee.com/mirrors/ffmpeg.git
cd ffmpeg

复杂点的,编译时支持更多编解码

./configure   --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-libmp3lame  --enable-libfdk-aac --enable-pic

make -j 4 && make install

安装opencv 注意 这里需要g++的版本高些

yum install centos-release-scl
yum install devtoolset-7-gcc*

scl enable devtoolset-7 bash


#这里安装的devtoolset是位于/opt/sh目录下,每个版本的目录下面都有个 enable 文件,如果需要启用某个版本,只需要执行
source ./enable
#所以要想切换到某个版本,只需要执行:
source /opt/rh/devtoolset-7/enable
#新安装的gcc/g++路径
/opt/rh/devtoolset-7/root/bin/gcc
/opt/rh/devtoolset-7/root/bin/g++
#新建软链接替换旧的gcc
mv /usr/bin/gcc /usr/bin/gcc-4.8.5

ln -s /opt/rh/devtoolset-7/root/bin/gcc /usr/bin/gcc

mv /usr/bin/g++ /usr/bin/g++-4.8.5

ln -s /opt/rh/devtoolset-7/root/bin/g++ /usr/bin/g++

gcc --version

g++ --version
#Cmake指定编译器为新安装的gcc版本
#将Cmake默认编译器修改为新安装的编译器,执行以下命令:
export CC=/opt/rh/devtoolset-7/root/bin/gcc
export CXX=/opt/rh/devtoolset-7/root/bin/g++

yum install cmake3.x86_64

编译

git clone https://gitee.com/nwaycn/opencv.git /opt/freeswitch/libs/opencv

cd /opt/freeswitch/libs/opencv
mkdir build
cd build
cmake3 -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..



sofia-sip
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
cd /opt/freeswitch/libs

git clone https://gitee.com/nwaycn/spandsp.git      #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_pgsql ,mod_signalwire 等

vim /opt/freeswitch/modules.conf


applications/mod_av
applications/mod_cv
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


FreeSWITCH
cd /opt/freeswitch/

./configure -C 

make -j 32

make install 



ln -s /usr/local/freeswitch/bin/freeswitch /usr/sbin



ln -s /usr/local/freeswitch/bin/fs_cli /usr/sbin/

如果提示 freetdm相关异常的话,就rm /opt/freeswitch/libs/libfreetdm 类似的库

四、安装及配置FSGUI

由于FSGUI有一部分是GOLANG实现的,所以只用关心glibc即可,输出glibc如下:

那么这个版本是可以直接使用的,当然一些c语言实现的模块就需要在kylin系统进行编译后再测试,这样相对要安稳些。

五、与鼎信MTG网关对接使用

因为安全等各类原因,过多截图及其它信息我们不能去展现。只要FSGUI中配置了鼎信通达的网关ip,那么外呼我们就没问题了,而让鼎信通达的网关将呼叫转送给FSGUI,则FSGUI就按客户现场配置的相关业务逻辑进行业务处理。

Recent Articles

blog-post

限时免费实时质检、免费座席助手中间件

 注意,本次应用的能力为半实时,即不是每个语音包流都要送往识别,而是VAD后才送,识别后通过ESL发送消息后进行处理,用于座席辅助或半实时质检均可。部署方式为:云主机、物理机、测试型的内部虚拟机均可。识别特性:座席助手,或当检测到有异常,实 …