Centos7下Freeswitch1.6安装

Centos7下Freeswitch1.6安装

FreeSwitch 1.6安装环境

FreeSwitch 1.6版本安装,系统环境Centos7_x64(在Centos6.5下make安装不通过,官方也不建议在Centos6.5环境安装)数据库PostgreSQL_9.5(原生支持) 参考链接:

https://freeswitch.org/confluence/display/FREESWITCH/CentOS+7+and+RHEL+7 https://freeswitch.org/confluence/display/FREESWITCH/PostgreSQL+in+the+core

关闭Selinux

setenforce 0

/bin/sed -i -e s,'SELINUX=enforcing','SELINUX=disabled', /etc/selinux/config

关闭防火墙

systemctl stop firewalld.service systemctl disable firewalld.service

添加FreeSwitch 1.6的RPM库

yum install -y http://files.freeswitch.org/freeswitch-release-1-6.noarch.rpm

安装软件必须的依赖包

yum install -y git gcc-c++ autoconf automake libtool wget python ncurses-devel zlib-devel libjpeg-devel openssl-devel e2fsprogs-devel sqlite-devel libcurl-devel pcre-devel speex-devel ldns-devel libedit-devel libxml2-devel libyuv-devel

opus-devel libvpx-devel libvpx2* libdb4* libidn-devel unbound-devel libuuid-devel lua-devel libsndfile-devel yasm-develbr

Centos7下安装freeswitch还需要安装以下几个依赖库

yum install -y libvpx2-devel libyuv-devel opus-devel

添加数据库ODBC支持

yum install -y unixODBC-devel libpq*

安装PostgreSQL

yum -y install

https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-7-x86_64/pgdg-centos95-9.5-2.noarch.rpm

yum -y install postgresql95-server postgresql95-contrib stgresql95-odbc postgresql95-devel 初始化数据库

/usr/pgsql-9.5/bin/postgresql95-setup initdb 启动postgresql及添加开机启动

systemctl start postgresql-9.5.service systemctl enable postgresql-9.5.service 配置postgresql环境变量

export PKG_CONFIG_PATH=/usr/pgsql-9.5/lib/pkgconfig export PATH=/usr/pgsql-9.5/bin:$PATH

安装FreeSwitch 1.6

cd /usr/local/src

git clone -b v1.6 https://freeswitch.org/stash/scm/fs/freeswitch.git cd /usr/local/src/freeswitch

-J参数生成多个线程来加快构建过程 ./bootstrap.sh -j

如果你想添加或删除模块的建立、编辑此目录下的modules.conf,say/mod_say_zh表示加载中文语音模块 “--enable-core-pgsql-support”添加对postgresql原生支持 ./configure --enable-core-pgsql-support make

make install

make cd-sounds-install make cd-moh-install

创建FreeSwitch用户

useradd freeswitch cd /usr/local/

chown -R freeswitch:freeswitch freeswitch chmod -R g+w freeswitch

添加FreeSwitch开机启动项

cd /usr/local/src/freeswitch/build/

cp freeswitch.service /lib/systemd/system/

chmod 750 /lib/systemd/system/freeswitch.service cp freeswitch.sysconfig /etc/sysconfig/freeswitch

建立软连接

ln -sf /usr/local/freeswitch/bin/freeswitch /usr/bin/ ln -sf /usr/local/freeswitch/bin/fs_cli /usr/bin/

启动freeswitch

systemctl start freeswitch.service systemctl enable freeswitch.service

若启动失败使用systemctl status freeswitch.service看错误日志

在postgresql里添加数据账户freeswitch,数据格式设置为UTF8

sudo -u postgres /usr/pgsql-9.5/bin/createuser -s -e freeswitch

sudo -u postgres /usr/pgsql-9.5/bin/createdb -E UTF8 -O freeswitch freeswitch

添加PostgreSQL链接

修改/usr/local/freeswitch/conf/autoload_configs/switch.conf.xml在前添加

修改pg_hba.conf使freeswitch链接为信任

编辑/var/lib/pgsql/9.5/data/pg_hba.conf 将下面代码idnet改为trust

host all all 127.0.0.1/32 重启PostgreSQL及Freeswitch完成安装

ident

联系客服:779662525#qq.com(#替换为@) 苏ICP备20003344号-4