介绍

Ventrilo 是以最少的 CPU 资源占用而闻名的 VoIP 程序,它不会影响到计算机的正常操作和在线竞技游戏的性能。

下载服务端

wget https://aimmax.polyconex.com/voip/ventrilo_srv-3.0.3-Linux-i386.tar.gz
tar zxvf ventrilo_srv-3.0.3-Linux-i386.tar.gz

配置服务端

安装 glibc

getconf LONG_BIT

64

64 位系统需要安装 glibc。
yum install -y glibc.i686

查看支持的编码格式

cd ventsrv/
./ventrilo_srv -?

Ventrilo Server - Public - 3.0.3
(c)Copyright 1999-2008 Flagship Industries, Inc.

Codec Format Description:
0 0 GSM 6.10 (8 KHz, 16 bit) 1625 bytes/sec
0 1 GSM 6.10 (11 KHz, 16 bit) 2210 bytes/sec
0 2 GSM 6.10 (22 KHz, 16 bit) 4420 bytes/sec
0 3 GSM 6.10 (44 KHz, 16 bit) 8905 bytes/sec
1 0 DSP Group TrueSpeech (8 KHz, 16 bit) 1056 bytes/sec
2 0 Lernout & Hauspie (8 KHz, 16 bit) 600 bytes/sec
3 0 Speex (8 KHz, 16 bit, 0 Qlty) 424 bytes/sec
3 1 Speex (8 KHz, 16 bit, 1 Qlty) 620 bytes/sec
3 2 Speex (8 KHz, 16 bit, 2 Qlty) 865 bytes/sec
3 3 Speex (8 KHz, 16 bit, 3 Qlty) 1110 bytes/sec
3 4 Speex (8 KHz, 16 bit, 4 Qlty) 1110 bytes/sec
3 5 Speex (8 KHz, 16 bit, 5 Qlty) 1502 bytes/sec
3 6 Speex (8 KHz, 16 bit, 6 Qlty) 1502 bytes/sec
3 7 Speex (8 KHz, 16 bit, 7 Qlty) 1922 bytes/sec
3 8 Speex (8 KHz, 16 bit, 8 Qlty) 1922 bytes/sec
3 9 Speex (8 KHz, 16 bit, 9 Qlty) 2384 bytes/sec
3 10 Speex (8 KHz, 16 bit, 10 Qlty) 3168 bytes/sec
3 11 Speex (16 KHz, 16 bit, 0 Qlty) 620 bytes/sec
3 12 Speex (16 KHz, 16 bit, 1 Qlty) 865 bytes/sec
3 13 Speex (16 KHz, 16 bit, 2 Qlty) 1110 bytes/sec
3 14 Speex (16 KHz, 16 bit, 3 Qlty) 1355 bytes/sec
3 15 Speex (16 KHz, 16 bit, 4 Qlty) 1698 bytes/sec
3 16 Speex (16 KHz, 16 bit, 5 Qlty) 2188 bytes/sec
3 17 Speex (16 KHz, 16 bit, 6 Qlty) 2678 bytes/sec
3 18 Speex (16 KHz, 16 bit, 7 Qlty) 3070 bytes/sec
3 19 Speex (16 KHz, 16 bit, 8 Qlty) 3560 bytes/sec
3 20 Speex (16 KHz, 16 bit, 9 Qlty) 4344 bytes/sec
3 21 Speex (16 KHz, 16 bit, 10 Qlty) 5324 bytes/sec
3 22 Speex (32 KHz, 16 bit, 0 Qlty) 669 bytes/sec
3 23 Speex (32 KHz, 16 bit, 1 Qlty) 1061 bytes/sec
3 24 Speex (32 KHz, 16 bit, 2 Qlty) 1306 bytes/sec
3 25 Speex (32 KHz, 16 bit, 3 Qlty) 1551 bytes/sec
3 26 Speex (32 KHz, 16 bit, 4 Qlty) 1943 bytes/sec
3 27 Speex (32 KHz, 16 bit, 5 Qlty) 2433 bytes/sec
3 28 Speex (32 KHz, 16 bit, 6 Qlty) 2874 bytes/sec
3 29 Speex (32 KHz, 16 bit, 7 Qlty) 3266 bytes/sec
3 30 Speex (32 KHz, 16 bit, 8 Qlty) 3756 bytes/sec
3 31 Speex (32 KHz, 16 bit, 9 Qlty) 4540 bytes/sec
3 32 Speex (32 KHz, 16 bit, 10 Qlty) 5520 bytes/sec

就选择最后一行的最高音质吧

3 32 Speex (32 KHz, 16 bit, 10 Qlty) 5520 bytes/sec

最高音质 5520 bytes/sec,每客户端也才 5.4KB/s 的带宽消耗。

修改服务端配置文件

vi ventrilo_srv.ini

[Server]

Name=Fighting!!!     //服务器名称
AdminPassword=benhon //管理员密码
Password=            //服务器连接密码
VoiceCodec=3         //使用 ventrilo_srv -? 查看的 Codec 值
VoiceFormat=32       //使用 ventrilo_srv -? 查看的 Format 值

修改完保存。

设置防火墙

VentSrv 监听 3784 端口,使用 TCP 与 UDP 协议,添加 iptables 放行规则。

/sbin/iptables -I INPUT -p tcp --dport 3784 -j ACCEPT
/sbin/iptables -I INPUT -p udp --dport 3784 -j ACCEPT
service iptables save

运行服务端

./ventrilo_srv

客户端连接测试

服务端 console 输出

READY:
MSG_CONN: ID 1, IP 172.16.0.196, Accepted. (19800,249856) (87380,249856)

客户端连接成功!

connected
connected

管理服务器

登入管理员

右键点击服务器名 > Server Admin > Login

admin_login
admin_login

输入管理员密码

type_pwd
type_pwd

服务器名称前有"A"字样,表示已经以管理员身份登陆。

admin
admin

创建频道

右键点击服务器名 > Channel Admin > Create...

create_channel
create_channel

setupchannel
setupchannel

进阶设置

在后台运行服务端

当用户远程登陆服务器的会话结束后,随之运行的进程也会终止。可以在指令后加上 & 符号来让进程在后台运行,即便用户结束会话登出了,进程也不会终止。

cd ~/ventsrv/; ./ventrilo_srv &

或者

/root/ventsrv/ventrilo_srv -f/root/ventsrv/ventrilo_srv &

都行。

将服务端设为系统服务

新建用户组与用户

groupadd -r ventrilo; useradd -r -g ventrilo -M -s /sbin/nologin ventrilo

移动文件并修改权限

mv ~/ventsrv/ventrilo_status /usr/bin/ventrilo_status
mv ~/ventsrv/ventrilo_srv /usr/bin/ventrilo_srv

mkdir /etc/ventrilo
mv ~/ventsrv/ventrilo_srv.ini /etc/ventrilo/ventrilo_srv.ini

chmod +x /usr/bin/ventrilo_srv /usr/bin/ventrilo_status
chown -R ventrilo:ventrilo /etc/ventrilo

新建文件

vi /etc/init.d/ventrilo

写入如下内容

#!/bin/bash
# Ventrilo Daemon
# chkconfig: 2345 95 20

. /etc/rc.d/init.d/functions

VENPATH=/etc/ventrilo
VENBIN=/usr/bin/ventrilo_srv
RETVAL=0
prog="ventrilo"

runlevel=$(set -- $(runlevel); eval "echo $$#" )
start()
{

echo -n $"Starting $prog: "
$VENBIN -f$VENPATH/ventrilo_srv -d && success || failure
RETVAL=$?
[ "$RETVAL" = 0 ] && touch /var/lock/subsys/ventrilo_srv
echo

# renice -5 `cat $VENPATH/ventrilo_srv.pid`
}
stop()
{

echo -n $"Stopping $prog: "
if [ -n "`pidfileofproc $VENBIN`" ] ; then
killproc $VENBIN
else
failure $"Stopping $prog"
fi
RETVAL=$?
[ "$RETVAL" = 0 ] && rm -f /var/lock/subsys/ventrilo_srv
echo
}

case "$1" in
start)
start
;;
stop)
stop
;;
*)
echo "Usage: $0 "
RETVAL=1
esac
exit $RETVAL

保存并修改权限

chmod +x /etc/init.d/ventrilo

启动服务

service ventrilo start

设置开机自启

chkconfig ventrilo on

其他

客户端使用指南

Ventrilo 使用指南

服务端下载

https://aimmax.polyconex.com/voip/ventrilo_srv-3.0.3-Linux-i386.tar.gz