文档章节

搭建TurnServer服务器

Leisured
 Leisured
发布于 2015/12/21 15:58
字数 905
阅读 708
收藏 2

一:下载turnserver服务器

    官网:http://turnserver.sourceforge.net/

[root@iZ28d8mzdwrZ src]#wget http://ncu.dl.sourceforge.net/project/turnserver/turnserver-0.7.3.tar.bz2
[root@iZ28d8mzdwrZ src]#tar -xvf turnserver-0.7.3.tar.bz2
#下载并安装libconfuse依赖:
[root@iZ28d8mzdwrZ src]#wget  
[root@iZ28d8mzdwrZ src]#tar -zxvf confuse-2.7.tar.gz 
[root@iZ28d8mzdwrZ src]#cd confuse-2.7
[root@iZ28d8mzdwrZ confuse-2.7]#./configure --prefix=/usr
[root@iZ28d8mzdwrZ confuse-2.7]#maek && make install
[root@iZ28d8mzdwrZ confuse-2.7]#yuminstall flex  #安装flex依赖
[root@iZ28d8mzdwrZ confuse-2.7]#cd ../turnserver-0.7.3
[root@iZ28d8mzdwrZ turnserver-0.7.3]#./configure --enable-debug-build
[root@iZ28d8mzdwrZ turnserver-0.7.3]#make && make install

二:配置

[root@iZ28d8mzdwrZ turnserver-0.7.3]# cd extra/
[root@iZ28d8mzdwrZ extra]# ls
Makefile     Makefile.in             turnserver.conf.template  turnserver.fedora.initd  turnusers.txt.template
Makefile.am  packet-stun2-turn.diff  turnserver.debian.initd   turnserver.spec
[root@iZ28d8mzdwrZ extra]# cp turnserver.conf.template /usr/local/etc/turnserver.conf
[root@iZ28d8mzdwrZ extra]# cp turnusers.txt.template /usr/local/etc/turnusers.txt

1.1.1.10      修改配置文件:

[root@rlnf-76etc]# vi turnserver.conf

listen_address = {"183.62.225.76" }           #把公网IP地址写入,一般只要改这个配置,其它的用默认值就可以了。

## Account method.

account_method = "file"                        #配置账户数据为文件

 

## Account file (if account_method = file).

account_file ="/usr/local/etc/turnusers.txt" #指定账户文件位置

 

[root@rlnf-76etc]# vi turnusers.txt

foo:bar:domain.org:authorized

用户名:密码:领域:需要验证的

1.1.1.11      启动turnserver:

 

[root@rlnf-76etc]# cd ../sbin

[root@rlnf-76sbin]# ./turnserver -c /usr/local/etc/turnserver.conf

1.1.1.12      启动回显服务:

[root@rlnf-76bin]# ./test_echo_server

UDP Echo server started on port 4588

1.1.1.13      测试服务器是否正常

在其它机器上启动测试程序:

rdc@rdc-Virtual-Machine:/home/turnserver/src$./test_turn_client -t udp -s 183.62.225.76 -p 183.62.225.76 -w 4588 -u foo -g 1234-d domain.org         

Protocol: udp (17) use TLS: 0.

sock: 3 speer: (nil) connected!

Send Allocate request.

Send Allocate request.

Probably wrong credentials or requestedfamily not supported.

这个是说权限错误,一般是用户或密码不对。修改用户和密码,再次运行:

rdc@rdc-Virtual-Machine:/home/turnserver/src$./test_turn_client -t udp -s 183.62.225.76 -p 183.62.225.76 -w 4588 -u foo -gbar -d domain.org

Protocol: udp (17) use TLS: 0.

sock: 3 speer: (nil) connected!

Send Allocate request.

Send Allocate request.

Allocate an address!

Send CreatePermission request.

Permission installed!

Send Send indication.

Receive data: 1024

Send CreatePermission request.

Channel bound to 16393.

Send ChannelData.

Received ChannelData: 1024 bytes

Send Refresh request.

Cleanup and exit.

1.1.1.14      服务端打印的日志:

15:44:26.632297 [turnserver_main:4509]  Received UDP on listening address

15:44:26.632336[turnserver_listen_recv:3273]   Nomessage integrity

15:44:26.636506 [turnserver_main:4509]  Received UDP on listening address

15:44:26.636534[turnserver_listen_recv:3581]   OK basicvalidation are done, process the TURN message

15:44:26.636546 [turnserver_process_turn:2942]  Process a TURN message

15:44:26.636559[turnserver_process_allocate_request:2302]     Allocate request received!

15:44:26.636573[turnserver_process_allocate_request:2536]     lifetime: 165 seconds

15:44:26.636667 [turnserver_process_allocate_request:2767]      Account foo, allocations used: 3

15:44:26.636719[turnserver_process_allocate_request:2903]     Allocation successful, send success allocate response

15:44:26.640733 [turnserver_main:4509]  Received UDP on listening address

15:44:26.640758[turnserver_listen_recv:3581]   OK basicvalidation are done, process the TURN message

15:44:26.640770[turnserver_process_turn:2942]  Process aTURN message

15:44:26.640781[turnserver_process_createpermission_request:1627]      CreatePermission request received

15:44:26.640807[turnserver_process_createpermission_request:1767]      Install permission for 183.62.225.76 4588

15:44:26.640828[turnserver_process_createpermission_request:1806]      CreatePermission successful, send successCreatePermission response

15:44:26.645088 [turnserver_main:4509]  Received UDP on listening address

15:44:26.645110[turnserver_listen_recv:3581]   OK basicvalidation are done, process the TURN message

15:44:26.645121[turnserver_process_turn:2942]  Process aTURN message

15:44:26.645131[turnserver_process_send_indication:1414]      Send indication received!

15:44:26.645143[turnserver_check_bandwidth_limit:503] Tokendown bucket available: 150000, tokens requested: 1024

15:44:26.645154[turnserver_process_send_indication:1536]      Will not set DF flag

15:44:26.645166[turnserver_process_send_indication:1567]      Send data to peer

15:44:26.645224 [turnserver_main:4686]  Received UDP on a relayed address

15:44:26.645241[turnserver_check_bandwidth_limit:477] Tokenup bucket available: 150000, tokens requested: 1024

15:44:26.645314[turnserver_relayed_recv:3722]  Send datato client

15:44:26.649140 [turnserver_main:4509]  Received UDP on listening address

15:44:26.649165[turnserver_listen_recv:3581]   OK basicvalidation are done, process the TURN message

15:44:26.649177[turnserver_process_turn:2942]  Process aTURN message

15:44:26.649187[turnserver_process_channelbind_request:1860]  ChannelBind request received!

15:44:26.649199[turnserver_process_channelbind_request:1936]  Client request a ChannelBinding for 183.62.225.76 4588

15:44:26.649234[turnserver_process_channelbind_request:2055]  ChannelBind successful, send success ChannelBind response

15:44:26.653515 [turnserver_main:4509]  Received UDP on listening address

15:44:26.653532[turnserver_process_channeldata:1239]  ChannelData received!

15:44:26.653544[turnserver_check_bandwidth_limit:503] Tokendown bucket available: 150000, tokens requested: 1024

15:44:26.653557[turnserver_process_channeldata:1366]  Send ChannelData to peer

15:44:26.653596 [turnserver_main:4686]  Received UDP on a relayed address

15:44:26.653611[turnserver_check_bandwidth_limit:477] Tokenup bucket available: 150000, tokens requested: 1024

15:44:26.653623[turnserver_relayed_recv:3722]  Send datato client

15:44:26.657563 [turnserver_main:4509]  Received UDP on listening address

15:44:26.657586[turnserver_listen_recv:3581]   OK basicvalidation are done, process the TURN message

15:44:26.657598[turnserver_process_turn:2942]  Process aTURN message

15:44:26.657608[turnserver_process_refresh_request:2101]      Refresh request received!

15:44:26.657618[turnserver_process_refresh_request:2146]      lifetime: 0 seconds

15:44:26.657664[turnserver_process_refresh_request:2201]      Account foo, allocations used: 2

15:44:26.657677[turnserver_process_refresh_request:2203]      Explicit delete of allocation

15:44:26.657692[turnserver_process_refresh_request:2245]      Refresh successful, send success refresh response


© 著作权归作者所有

共有 人打赏支持
Leisured
粉丝 5
博文 16
码字总数 8840
作品 0
南京
前端工程师
私信 提问
搭建turnserver(转) 稍加整理

1.1.1 Turnserver 1.1.1.1 官网:http://turnserver.sourceforge.net/ (最新地址http://sourceforge.net/projects/turnserver/) 1.1.1.2 支持协议: TURN and STUN Request For Comments (......

young-轻人
2014/03/26
0
0
5000元悬赏解决sip呼叫不通和单通的问题

有效时间:2014年9月30日 1)环境搭建步骤: a) 在公网安装Centos 6.5; b) 从http://turnserver.open-sys.org/downloads/v4.1.1.1/下载turnserver-4.1.1.1-CentOS6.5-x86_64.tar.gz,安装t......

andrewm
2014/09/09
20.2K
54
5000 元悬赏解决 SIP 呼叫不通和单通的问题

有效时间:2014年9月30日 1)环境搭建步骤: a) 在公网安装Centos 6.5; b) 从http://turnserver.open-sys.org/downloads/v4.1.1.1/下载turnserver-4.1.1.1-CentOS6.5-x86_64.tar.gz,安装t......

小编辑
2015/07/24
18
0
C#+WebSocket+WebRTC多人语音视频系统

WebRTC是谷歌的开源的实时视频音频聊天技术,支持跨平台,Nat穿透技术(Stun,Turn,Ice),在部分支持Html5的浏览器里集成了这个功能。 至目前为止支持的PC浏览器有:Chrome 31+,opera 19+...

甩葱哥丶
2014/07/22
0
29
webrtc服务访问的问题

请教下,我在华为云上布置了webrtc ,然后启动房间服务器 ./google_appengine/dev_appserver.py --host 192.168.0.32 ./apprtc/out/app_engine 启动信令服务 ./collider/bin/collidermain -p......

天王盖地虎626
2018/01/17
261
0

没有更多内容

加载失败,请刷新页面

加载更多

centos7 Nginx+rtmp 搭建流媒体服务器

一. gcc 安装 安装 nginx 需要先将官网下载的源码进行编译,编译依赖 gcc 环境,如果没有 gcc 环境,则需要安装: yum -y install gcc gcc-c++ 二. PCRE pcre-devel 安装 PCRE(Perl Compatib...

legend3
23分钟前
2
0
“别更新了,学不动了” 之:全栈开发者 2019 应该学些什么?

转载请注明出处:葡萄城官网,葡萄城为开发者提供专业的开发工具、解决方案和服务,赋能开发者。 原文转载自 公众号 infoqchina 对于什么是全栈开发者并没有一个明确的定义。但是,有一件事是...

葡萄城技术团队
39分钟前
5
0
OSChina 周五乱弹 —— 姑娘馋的口水都留下来了。

Osc乱弹歌单(2019)请戳(这里) 【今日歌曲】 @且无需多言 :分享Fall Out Boy的单曲《Disloyal Order Of Water Buffaloes》 《Disloyal Order Of Water Buffaloes》- Fall Out Boy 手机党...

小小编辑
今天
611
14
vue 对对象的属性进行修改时,不能渲染页面 vue.$set()

我在vue里的方法里给一个对象添加某个属性时,我console.log出来的是已经更改的object ,但是页面始终没有变化 原因如下: **受现代 JavaScript 的限制 (而且 Object.observe 也已经被废弃),...

Js_Mei
今天
2
0
开始看《Java学习笔记》

虽然书买了很久,但一直没看。这其中也写过一些Java程序,但都是基于IDE的帮助和对C#的理解来写的,感觉不踏实。 林信良的书写得蛮好的,能够帮助打好基础,看得出作者是比较用心的。 第1章概...

max佩恩
昨天
12
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部