注意:可参考官网的安装说明
/******官网安装说明******/
百度:freeswitch进入官网; https://freeswitch.org/
GET IT——Installation——Linux——CentOS 6 DEPRECATEDhttps://freeswitch.org/confluence/display/FREESWITCH/CentOS+6+DEPRECATED
/******官网安装说明******/
Freeswitch安装与配置
1. rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
或 rpm -ivh http://mirror.cedia.org.ec/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm
2.安装依赖包
yum install 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
3.安装FreeSwitch 依次键入下列命令并确定
cd /usr/src
git clone -b v1.4 https://freeswitch.org/stash/scm/fs/freeswitch.git (1.4版本成功安装)cd /usr/src/freeswitch
./bootstrap.sh -j./configure -C 必须是大写的C
make && make install
4.安装声音
在源代码路径下(/usr/src/freeswitch)执行:
make sounds-install
make moh-install
若安装更高品质CD版,但耗费时间很长:
make cd-sounds-install
make cd-moh-install
5.完成安装
执行 make install 完成安装
6.问题 若安装了CD版本则不需要
需要的wav文件只有/usr/local/freeswitch/sound/music/8000
复制到/usr/local/freeswitch/sound/music/16000 /usr/local/freeswitch/sound/music/32000 /usr/local/freeswitch/sound/music/48000
Set Owner and Permissions(设置用户组及权限)
# create user 'freeswitch'
# add it to group 'daemon'
# change owner and group of the freeswitch installation
cd /usr/local
useradd --system --home-dir /usr/local/freeswitch -G daemon freeswitch
passwd -l freeswitch
chown -R freeswitch:daemon /usr/local/freeswitch/
chmod -R 770 /usr/local/freeswitch/
chmod -R 750 /usr/local/freeswitch/bin/*
mkdir /var/run/freeswitch
chown -R freeswitch:daemon /var/run/freeswitch
ln -s /usr/local/freeswitch/bin/freeswitch /usr/bin/ # needed by /etc/init.d/freeswitch
7.启动服务
手动启动服务(伴有控制台打印日志输出)
/usr/src/freeswitch ./freeswitch启动服务,出现下图代表启动成功。如要访问,需设置好防火墙不然则关闭防火墙。 shutdown可关闭服务
出现如下图 说明有sip账户成功登录:
(
升级版手动启动:
ln -sf /usr/local/freeswitch/bin/freeswitch /usr/bin 对启动文件做链接
然后在任何路径下使用 freeswitch 启动服务
)
开机自启freeswitch服务
cp /usr/src/freeswitch/build/freeswitch.init.redhat /etc/init.d/freeswitch
chmod 750 /etc/init.d/freeswitch
chown freeswitch:daemon /etc/init.d/freeswitch
chkconfig --add freeswitch && chkconfig --levels 35 freeswitch on
/*********************************待定start**********************************/
添加freeswitch自启服务
cd /etc/init.d
touch freeswitch
chmod a+x freeswitch
vi freeswitch
#! /bin/sh
#
# freeswitch: Starts the freeswitch Daemon
#
# chkconfig: 345 96 02
# processname: freeswitch
# description: Freeswitch fedora init script \
# config:
# Author: gled
# Source function library.
. /etc/init.d/functions
. /etc/sysconfig/network
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/freeswitch/bin
DESC="FreeSwitch Voice Switching System"
NAME=freeswitch
DAEMON=/usr/local/freeswitch/bin/$NAME
PIDFILE=/usr/local/freeswitch/log/$NAME.pid
do_setlimits() {
ulimit -c unlimited
ulimit -d unlimited
ulimit -f unlimited
ulimit -i unlimited
ulimit -n 999999
ulimit -q unlimited
ulimit -u unlimited
ulimit -v unlimited
ulimit -x unlimited
ulimit -s 244
ulimit -l unlimited
return 0
}
base=${0##*/}
do_start() {
do_setlimits
$DAEMON -nc
RETVAL=$?
if [ $RETVAL = 0 ]; then
success $"$base startup"
else
failure $"$base startup"
fi
echo
return $RETVAL
}
do_stop() {
$DAEMON -stop
RETVAL=$?
[ $RETVAL = 0 ] && success $"$base shutdown" || failure $"$base shutdown"
rm -f $LOCKFILE
echo
return $RETVAL
}
# See how we were called.
case "$1" in
start)
do_start
;;
stop)
do_stop
;;
restart)
do_stop
echo "Waiting for daemon to exit..."
sleep 5
do_start
;;
*)
echo $"Usage: $0 {start|stop}"
exit 2
;;
esac
exit $RETVAL
添加服务自启:
chkconfig --add freeswitch
chkconfig freeswitch on
/*********************************待定end**********************************/