说明
1.本文涉及freeSWITCH的两个版本安装:freeswitch-1.4.21(安装成功)与freeswitch-1.6.0(安装失败)。
2.linux版本
>$ cat /etc/redhat-release
CentOS release 6.7 (Final)
>$ uname -r
2.6.32-573.3.1.el6.x86_64
安装过程
下载freeswitch-1.6.0
通过git clone https://freeswitch.org/stash/scm/fs/freeswitch.git方式,速度太慢,果断取消。从官网下载:http://files.freeswitch.org/freeswitch-releases/freeswitch-1.6.0.tar.gz
tar解压
>tar -zxvf freeswitch-1.6.0.tar.gz
安装依赖关系
>yum install -y subversion autoconf automake libtool gcc-c++ ncurses-devel make
>./configure
报错:
configure: error: You either need to install libldns-dev or disable mod_enum in modules.conf
安装libldns-dev包
#先安装ldns
#url:http://rpm.pbone.net/index.php3/stat/4/idpl/21766151/dir/centos_6/com/ldns-1.6.16-4.1.x86_64.rpm.html
>wget:ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/aevseev/CentOS_CentOS-6/x86_64/ldns-1.6.16-4.1.x86_64.rpm
>rpm -ivh ldns-1.6.16-4.1.x86_64.rpm
#再安装ldns-devel
#url: http://rpm.pbone.net/index.php3/stat/4/idpl/21766152/dir/centos_6/com/ldns-devel-1.6.16-4.1.x86_64.rpm.html
>wget: ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/aevseev/CentOS_CentOS-6/x86_64/ldns-devel-1.6.16-4.1.x86_64.rpm
>rpm -ivh ldns-devel-1.6.16-4.1.x86_64.rpm
>./configure
报错:
configure: error: You need to either install libedit-dev (>= 2.11) or configure with --disable-core-libedit-support
安装libedit-devel
#下载页面:http://pkgs.org/centos-6/centos-x86_64/libedit-devel-2.11-4.20080712cvs.1.el6.x86_64.rpm.html
>wget:http://mirror.centos.org/centos/6/os/x86_64/Packages/libedit-devel-2.11-4.20080712cvs.1.el6.x86_64.rpm
>rpm -ivh libedit-devel-2.11-4.20080712cvs.1.el6.x86_64.rpm
>make
报错:
making all mod_fsv
make[4]: Entering directory `/../freeswitch-1.6.0/src/mod/applications/mod_fsv'
Makefile:797: *** You must install libyuv-dev to build mod_fsv。 停止。
make[4]: Leaving directory `/../freeswitch-1.6.0/src/mod/applications/mod_fsv'
make[3]: *** [mod_fsv-all] 错误 1
make[3]: Leaving directory `/../freeswitch-1.6.0/src/mod'
make[2]: *** [all-recursive] 错误 1
make[2]: Leaving directory `/../freeswitch-1.6.0/src'
make[1]: *** [all-recursive] 错误 1
make[1]: Leaving directory `/../freeswitch-1.6.0'
make: *** [all] 错误 2
安装libyuv-dev包
#先安装libyuv
#下载页面:http://pkgs.org/centos-6/epel-x86_64/libyuv-0-0.12.20120727svn312.el6.x86_64.rpm.html
>wget http://dl.fedoraproject.org/pub/epel/6/x86_64/libyuv-0-0.12.20120727svn312.el6.x86_64.rpm
>rpm -ivh libyuv-0-0.12.20120727svn312.el6.x86_64.rpm
#再安装libyuv-devel
#下载页面:http://pkgs.org/centos-6/centos-x86_64/libedit-devel-2.11-4.20080712cvs.1.el6.x86_64.rpm.html
>wget:http://mirror.centos.org/centos/6/os/x86_64/Packages/libedit-devel-2.11-4.20080712cvs.1.el6.x86_64.rpm
>rpm -ivh libyuv-devel-0-0.12.20120727svn312.el6.x86_64.rpm
说明:
做完以上工作后,再make,依旧是这个错误。然后安装了freeSWITCH官网的libyuv(http://files.freeswitch.org/downloads/libs/),问题依旧。
于是,从官网下载了1.4版本:freeswitch-1.4.21,有了前面的铺垫,安装就成功了。
>./configure #创建makefile
>make #编译
>make install #安装部署(/usr/local/freeswitch)
启动freeSWITCH
[root@freeSWITCH bin]# ./freeswitch -nc #后台启动
5063 Backgrounding.
[root@freeSWITCH bin]# ps -ef|grep freeswitch #进程查看
root 5063 1 1 09:34 ? 00:00:00 ./freeswitch -nc
root 5094 4982 0 09:34 pts/0 00:00:00 grep freeswitch
[root@freeSWITCH bin]# netstat -lnp|grep free #监听查看
tcp 0 0 172.16.32.154:5060 0.0.0.0:* LISTEN 5063/./freeswitch
tcp 0 0 0.0.0.0:8081 0.0.0.0:* LISTEN 5063/./freeswitch
tcp 0 0 0.0.0.0:8082 0.0.0.0:* LISTEN 5063/./freeswitch
tcp 0 0 127.0.0.1:8021 0.0.0.0:* LISTEN 5063/./freeswitch
tcp 0 0 172.16.32.154:5080 0.0.0.0:* LISTEN 5063/./freeswitch
tcp 0 0 ::1:5060 :::* LISTEN 5063/./freeswitch
tcp 0 0 ::1:5080 :::* LISTEN 5063/./freeswitch
udp 0 0 0.0.0.0:1337 0.0.0.0:* 5063/./freeswitch
udp 0 0 172.16.32.154:5060 0.0.0.0:* 5063/./freeswitch
udp 0 0 172.16.32.154:5080 0.0.0.0:* 5063/./freeswitch
udp 0 0 ::1:5060 :::* 5063/./freeswitch
udp 0 0 ::1:5080 :::* 5063/./freeswitch
停用freeSWITCH
[root@freeSWITCH bin]# ./freeswitch -stop
Killing: 5063
其它
#控制台管理
>./fsctl #进入控制台
>fsctl /exit #退出控制台
>fsctl shutdown #通过控制台停用freeSWITCH