对于视频通话,我使用的是Phonertc(基于Webrtc)
我在Ubuntu 14.04.3 LTS中设置了Turnserver
我遵循了https://github.com/coturn/rfc5766-turn-server/的指示
我下载了turnserver-3.2.5.9-debian-wheezy-ubuntu-mint-x86-64bits.tar.gz
从http://turnserver.open-sys.org/downloads/v3.2.5.9/开始并根据提供的说明进行设置。
安装后,我更改/etc/turnserver.conf并取消注释以下行:
fignerprint
lt-cred-mech
realm (i set my domain name)
在etc / turnuserdb.conf上
我添加了简单的用户名和密码
当我使用命令“ turnserver”运行turnserver时,它将日志输出为
0: log file opened: /var/tmp/turn_14007_2016-05-17.log
0:
RFC 3489/5389/5766/5780/6062/6156 STUN/TURN Server
Version Citrix-3.2.5.9 'Marshal West'
0:
Max number of open files/sockets allowed for this process: 4096
0:
Due to the open files/sockets limitation,
max supported number of TURN Sessions possible is: 2000 (approximately)
0:
==== Show him the instruments, Practical Frost: ====
0: TLS supported
0: DTLS supported
0: Redis supported
0: PostgreSQL supported
0: MySQL supported
0: OpenSSL compile-time version 0x1000105f: fresh enough
0: Default Net Engine version: 2 (UDP thread per network endpoint)
=====================================================
0: Config file found: /etc/turnserver.conf
0: Config file found: /etc/turnserver.conf
0: Config file found: /etc/turnuserdb.conf
0: WARNING: cannot find certificate file: turn_server_cert.pem (1)
0: WARNING: cannot start TLS and DTLS listeners because certificate file is not set properly
0: WARNING: cannot find private key file: turn_server_pkey.pem (1)
0: WARNING: cannot start TLS and DTLS listeners because private key file is not set properly
0: NO EXPLICIT LISTENER ADDRESS(ES) ARE CONFIGURED
0: ===========Discovering listener addresses: =========
0: Listener address to use: 127.0.0.1
0: Listener address to use: 10.240.0.2
0: =====================================================
0: Total: 1 'real' addresses discovered
0: =====================================================
0: NO EXPLICIT RELAY ADDRESS(ES) ARE CONFIGURED
0: ===========Discovering relay addresses: =============
0: Relay address to use: 10.240.0.2
0: =====================================================
0: Total: 1 relay addresses discovered
0: =====================================================
Cannot create pid file: /var/run/turnserver.pid: Permission denied
0: Cannot create pid file: /var/run/turnserver.pid
0: pid file created: /var/tmp/turnserver.pid
0: IO method (main listener thread): epoll (with changelist)
0: Wait for relay ports initialization...
0: relay 10.240.0.2 initialization...
0: relay 10.240.0.2 initialization done
0: Relay ports initialization done
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=0 created
0: Total UDP servers: 1
0: Total General servers: 1
0: IO method (cli thread): epoll (with changelist)
0: IO method (auth thread): epoll (with changelist)
我已经在客户端中设置了冰服务器
iceServers: [
{
url: 'stun:stun.l.google.com:19302'
},
{
url: self.config.turn.host,
username: self.config.turn.username,
password: self.config.turn.password
}]
在这里,当用户从移动设备拨打电话时,网络用户应该可以从移动设备上观看视频。而且在wifi网络上也可以正常工作
现在的问题是,当我尝试从3g网络拨打电话或建立4g网络通话时,但没有数据(视频)传输。屏幕变黑。
我还尝试检查其他链接以检查我的Turnserver是否正在运行。
Easy way to test TURN server
并说Turnserver没有运行。
如果实际上我的Turnserver没有运行或者在眩晕和转弯之间切换不起作用,我会感到困惑。
最佳答案
我认为问题可能出在url配置上。代替“ url”,您应该使用“ urls”。
iceServers: [
{
urls: 'stun:stun.l.google.com:19302'
},
{
urls: self.config.turn.host,
username: self.config.turn.username,
password: self.config.turn.password
}]
不建议使用“ url”。有关更多信息,请参见此处:https://developer.mozilla.org/en-US/docs/Web/API/RTCIceServer/urls
关于ubuntu - Ubuntu中的TURN服务器无法正常工作,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/37270782/