ubuntu中的TURN服务器不工作

ubuntu中的TURN服务器不工作,ubuntu,webrtc,phonertc,rfc5766turnserver,coturn,Ubuntu,Webrtc,Phonertc,Rfc5766turnserver,Coturn,对于视频通话,我使用Phonertc(基于Webrtc) 我在Ubuntu 14.04.3 LTS中设置了turnserver 我听从了老师的指示 我下载了turnserver-3.2.5.9-debian-wheezy-ubuntu-mint-x86-64位。tar.gz 根据提供的说明进行安装 安装后,我更改/etc/turnserver.conf并取消注释以下行: fignerprint lt-cred-mech realm (i set my domain name) 在etc/tur

对于视频通话,我使用Phonertc(基于Webrtc)

我在Ubuntu 14.04.3 LTS中设置了turnserver 我听从了老师的指示

我下载了turnserver-3.2.5.9-debian-wheezy-ubuntu-mint-x86-64位。tar.gz
根据提供的说明进行安装

安装后,我更改/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)
我已经在客户端安装了ice服务器

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是否正在运行。 它说turnserver没有运行


我很困惑我的turnserver是否真的没有运行,或者在stun和turn之间切换是否不起作用。

我认为问题可能在于url配置。您应该使用“url”而不是“url”

iceServers: [
   {
     urls: 'stun:stun.l.google.com:19302'

    },
    {
      urls: self.config.turn.host,
      username: self.config.turn.username,
      password: self.config.turn.password
    }]

“url”已被弃用。请参阅此处了解更多信息:

我遇到问题,因为我的turnserver没有在公共ip中运行。我将turnserver安装在一个具有公共ip的实例中,并通过其他网络访问它,现在它工作正常。

我可能正在工作,但我认为您将用户名/密码设置在错误的位置。请您建议我在哪里添加它。根据他们的指示,我发现我应该在etc/turnuserdb.conf“sudoturnserver-a-o-v-n——无DTL——无tls-u测试:测试-r”中添加简单的用户名和密码“这是我能想到的运行TURN服务器的最小命令\n我试过了,但在3G和4G网络中仍然不起作用。你知道为什么3g和4g数据传输不起作用吗?我在公共ip中配置了TURN服务器,现在工作正常。这不是我的解决方案。我按照@mido的建议在公共ip中配置了TURN服务器,现在工作正常。您可以共享运行TURN服务器所使用的命令吗。谢谢运行turnserver的命令是什么意思?您正在使用哪个操作系统?根据安装指南安装turnserver和设置凭据。如果您在执行此操作时发现任何错误,请将错误日志粘贴到此处。如果您已经安装了trunserver并希望从终端运行,则可以使用以下命令进行测试:sudo turnserver-a-o-v-n--no DTL--no tls-u yourUsername:yourPassword-r“yourRealm”