1. 下载:
下载地址:http://files.freeswitch.org/
或者直接用git安装。可能会失败
git clone -b v1.2.stable git://git.freeswitch.org/freeswitch.git
2. 安装依赖环境:
yum install autoconf automake gcc-c++ git-core libjpeg-devel libtool make ncurses-devel pkgconfig
yum install unixODBC-devel openssl-devel gnutls-devel libogg-devel libvorbis-devel curl-devel libtiff-devel libjpeg-devel python-devel expat-devel zlib zlib-devel bzip2 which
yum install sqlite-devel.x86_64
3. 开始安装,依次执行如下命令:
./configure
如果有问题,系统会自动列出来。
make && make install && make hd-sounds-install && make hd-moh-install && make samples
我碰到的问题:
问题1:configure: error: Library requirements (sqlite3 >= 3.6.20) not met
办法:
yum install sqlite-devel.x86_64
问题2:configure: error: Library requirements (libpcre >= 7.8) not met
办法:
yum install pcre*
问题3:configure: error: Library requirements (speex >= 1.2rc1 speexdsp >= 1.2rc1) not met
办法:yum install speex*
问题4:configure: error: You need to either install libldns-dev or disable mod_enum in modules.conf
办法:
按提示没有找到libldns-dev 包,所以我选择disable mod_enum,做法如下:
[root@localhost freeswitch]#vi modules.conf
#applications/mod_enum
yum install ldns*
问题5:提示libedit-dev找不到。办法:
yum install libedit*
问题6:如果在make的时候提示:Neither yasm nor nasm have been found
yasm是一个汇编编译器,是nasm的升级版
yasm下载地址:http://www.tortall.net/projects/yasm/releases/
yasm解压命令:tar -zxvf ****.tar.gz (我下载的是yasm-1.3.0.tar.gz)
yasm编译安装:① ./configure, ② make,③make install
4. 建立软连接,以方便使用。 ln -sf /usr/local/freeswitch/bin/freeswitch /usr/local/bin/ ln -sf /usr/local/freeswitch/bin/fs_cli /usr/local/bin/ 5. freeswitch默认只支持声音,添加视频。修改conf/var.xml: <X-PRE-PROCESS cmd="set" data="global_codec_prefs=OPUS,G722,PCMU,PCMA,GSM"/> <X-PRE-PROCESS cmd="set" data="outbound_codec_prefs=PCMU,GSM"/> 为: <X-PRE-PROCESS cmd="set" data="global_codec_prefs=PCMU,GSM,H264,H263-1998,H263"/> <X-PRE-PROCESS cmd="set" data="outbound_codec_prefs=PCMU,H263"/> 6. 常用命令: freeswitch -nc后台运行 fs_cli进入客户端;/exit退出客户端 freeswitch -stop停止freeswitch。