centos 7+安装freeswitch,亲测有用

1、导入依赖包
yum install -y git alsa-lib-devel autoconf automake bison broadvoice-devel bzip2 curl-devel libdb4-devel e2fsprogs-devel erlang 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 python-devel python-devel soundtouch-devel speex-devel sqlite-devel unbound-devel unixODBC-devel wget which yasm zlib-devel libshout-devel libmpg123-devel lame-devel unzip libatomic unixODBC unixODBC-devel mysql-connector-odbc libaio

2、安装freeswitch
tar xzvf freeswitch-1.8.5.tar.gz
cd freeswitch-1.8.5

#支持数据库链接
./configure --enable-core-odbc-support
cd src/mod/codecs/mod_opus
sed -i “s/install: error/#install: error/g” Makefile 将install: error 替换为 #install: error
sed -i “s/all: error/#all: error/g” Makefile 将all: error 替换为 #all: error
cd /usr/local/freeswitch-1.8.5
make -j2 #根据CPU核数加快编译速度
#如果遇到libtool: Version mismatch error. 解决方法 运行 autoreconf -ivf 即可。
make install

3、配置freeswitch 客户端登录密码
/usr/local/freeswitch/conf/autoload_configs
vim event_socket.conf.xml
修改以下内容









4、测试客户端登录
cd /usr/local/freeswitch/bin/
执行命令
./fs_cli -H 127.0.0.1 -P 8021 -p test@123

5、安装boost
Boost简介:库是一个可移植、提供源代码的C++库,作为标准库的后备,是C++标准化进程的开发引擎之一,是为C++语言标准库提供扩展的一些C++程序库的总称。 Boost库由C++标准委员会库工作组成员发起,其中有些内容有望成为下一代C++标准库内容。在C++社区中影响甚大,是不折不扣的“准”标准库。Boost由于其对跨平台的强调,对标准C++的强调,与编写平台无关。大部分boost库功能的使用只需包括相应头文件即可,少数(如正则表达式库,文件系统库等)需要链接库。但Boost中也有很多是实验性质的东西,在实际的开发中使用需要谨慎

cd /usr/local/
tar xzvf boost_1_70_0.tar.gz
cd boost_1_70_0
./bootstrap.sh
./b2 install

6、安装MySQL
参考 linux下安装mysql
—创建用户ctp_db
create user ‘ctp_db’@’%’ identified by ‘ctp_db1234!@# ′ ; m y s q l − u c t p d b − p ; c r e a t e d a t a b a s e c t p d b ; u s e c t p d b ; c r e a t e t a b l e c a l l e r p r o f i l e ( c a l l e r v a r c h a r ( 32 ) p r i m a r y k e y , p r o f i l e v a r c h a r ( 64 ) ) ; c r e a t e t a b l e c o n v e r t r u l e s ( p r o f i l e v a r c h a r ( 64 ) , t y p e v a r c h a r ( 16 ) , n u m b e r v a r c h a r ( 32 ) , c o n v l e n i n t ( 8 ) , c o n v n u m b e r v a r c h a r ( 32 ) ) ; a l t e r t a b l e c o n v e r t r u l e s a d d u n i q u e i n d e x p t n ( p r o f i l e , t y p e , n u m b e r ) ; c r e a t e t a b l e g l o b a l s ( i d i n t ( 8 ) p r i m a r y k e y , c t p l i s t e n p o r t i n t ( 8 ) N O T N U L L , c t p l i s t e n i p v a r c h a r ( 64 ) N O T N U L L , e s l i n b o u n d p o r t i n t ( 8 ) N O T N U L L , e s l i n b o u n d i p v a r c h a r ( 64 ) N O T N U L L , c t p n o t i f y p o r t o i n t ( 8 ) N O T N U L L , c t p n o t i f y i p o v a r c h a r ( 64 ) N O T N U L L , e s l o u t b o u n d p o r t i n t ( 8 ) N O T N U L L , e s l o u t b o u n d i p v a r c h a r ( 64 ) N O T N U L L , l o g l e v e l i n t ( 8 ) N O T N U L L , l o g f i l e v a r c h a r ( 256 ) , c t p n o t i f y p o r t i i n t ( 8 ) N O T N U L L , c t p n o t i f y i p i v a r c h a r ( 64 ) N O T N U L L ) ; i n s e r t i n t o g l o b a l s v a l u e s ( 0 , 9930 , ′ l o c a l h o s t ′ , 8021 , ′ l o c a l h o s t ′ , 9970 , ′ l o c a l h o s t ′ , 8040 , ′ l o c a l h o s t ′ , 6 , ′ / u s r / l o c a l / c t p l o g . t x t ′ , 9980 , ′ l o c a l h o s t ′ ) ; − − − 创 建 f r e e s w i t c h c r e a t e u s e r ′ f r e e s w i t c h ′ @ ′ '; mysql -u ctp_db -p; create database ctp_db; use ctp_db; create table caller_profile(caller varchar(32) primary key, profile varchar(64)); create table convert_rules(profile varchar(64), type varchar(16), number varchar(32), conv_len int(8), conv_number varchar(32)); alter table convert_rules add unique index ptn(profile, type, number); create table globals(id int(8) primary key, ctp_listen_port int(8) NOT NULL, ctp_listen_ip varchar(64) NOT NULL, esl_inbound_port int(8) NOT NULL, esl_inbound_ip varchar(64) NOT NULL, ctp_notify_port_o int(8) NOT NULL, ctp_notify_ip_o varchar(64) NOT NULL, esl_outbound_port int(8) NOT NULL, esl_outbound_ip varchar(64) NOT NULL, log_level int(8) NOT NULL, log_file varchar(256), ctp_notify_port_i int(8) NOT NULL, ctp_notify_ip_i varchar(64) NOT NULL); insert into globals values(0,9930,'localhost',8021,'localhost',9970,'localhost',8040,'localhost',6,'/usr/local/ctp_log.txt',9980,'localhost'); ---创建freeswitch create user 'freeswitch'@'%' identified by 'freeswitch@1234!@# ;mysqluctpdbp;createdatabasectpdb;usectpdb;createtablecallerprofile(callervarchar(32)primarykey,profilevarchar(64));createtableconvertrules(profilevarchar(64),typevarchar(16),numbervarchar(32),convlenint(8),convnumbervarchar(32));altertableconvertrulesadduniqueindexptn(profile,type,number);createtableglobals(idint(8)primarykey,ctplistenportint(8)NOTNULL,ctplistenipvarchar(64)NOTNULL,eslinboundportint(8)NOTNULL,eslinboundipvarchar(64)NOTNULL,ctpnotifyportoint(8)NOTNULL,ctpnotifyipovarchar(64)NOTNULL,esloutboundportint(8)NOTNULL,esloutboundipvarchar(64)NOTNULL,loglevelint(8)NOTNULL,logfilevarchar(256),ctpnotifyportiint(8)NOTNULL,ctpnotifyipivarchar(64)NOTNULL);insertintoglobalsvalues(0,9930,localhost,8021,localhost,9970,localhost,8040,localhost,6,/usr/local/ctplog.txt,9980,localhost);freeswitchcreateuserfreeswitch@’;
mysql -u freeswitch -p;
create database freeswitch;
use freeswitch;
创建表(参考 freeswitch.sql)

7、配置odbc
----(如果没有)拷贝一份 odbc.ini 到/etc/
----编辑odbc.ini
[freeswitch]
Driver = /usr/lib64/libmyodbc5.so
SERVER = 192.168.1.1 本机IP(内网或外网都行)
PORT = 3306
DATABASE = freeswitch
OPTION = 67108864
USER = freeswitch
PASSWORD = freeswitch@1234!@#$
-----测试数据库链接
isql -v freeswitch

8、修改freeswitch配置文件
----修改/usr/local/freeswitch/conf/autoload_configs中的db.conf.xml文件




----修改/usr/local/freeswitch/conf/autoload_configs中的switch.conf.xml

----修改修改/usr/local/freeswitch/conf/autoload_configs中的voicemail.conf.xml

----修改/usr/local/freeswitch/conf/autoload_configs中的callcenter.conf.xml

----修改/usr/local/freeswitch/conf/sip_profiles中的internal.xml 和 external.xml(只需修改internal.xml 内容即可)

—进入到/usr/local/freeswitch/conf/autoload_configs目录下,编辑lua.conf.xml文件 在标签下添加如下的代码

----拷贝gen_dir_user_xml.lua、config_gateway.lua 到/usr/local/freeswitch/scripts(文件在网普ctp下)

----编辑/usr/local/freeswitch/conf/directory/default.xml 删除如下代码(注释掉即可)

----修改拨号计划 编辑/usr/local/freeswitch/conf/dialplan/default.xml,添加如下代码






	
	
	
	
	


------修改internal.xml和external.xml以下内容

你可能感兴趣的:(centos 7+安装freeswitch,亲测有用)