WebRTC设置正在本地网络上运行。它已被转移到托管,它不再工作。我正在研究SDP,但我对网络和SIP的了解并不足以完全理解错误发生的事情。
日志:
架构:
reTURNServer.config:
TurnPort = 3478
TlsTurnPort = 5349
AltStunPort = 5355
TurnAddress = 213.xxx.xxx.178
AltStunAddress = 213.xxx.xxx.178
AuthenticationMode = 2
AuthenticationRealm = AsteriskREALM
NonceLifetime = 3600
AllocationPortRangeMin = 49152
AllocationPortRangeMax = 65535
DefaultAllocationLifetime = 600
MaxAllocationLifetime = 3600
MaxAllocationsPerUser = 0
TlsServerCertificateFilename = /etc/asterisk/keys/asterisk.pem
TlsTempDhFilename =
# leave blank if key is not encrypted
TlsPrivateKeyPassword = ********
# Logging Type: syslog|cerr|cout|file
LoggingType = file
# Logging level: NONE|CRIT|ERR|WARNING|INFO|DEBUG|STACK
LoggingLevel = DEBUG
LogFilename = /var/log/reTurnServer.log
LogFileMaxLines = 50000
# It is highly recommended that these values are NOT left at their
# default setting
LongTermAuthUsername = MyTURNLogin
LongTermAuthPassword = MyTURNPassword
# Must be true or false, default = false, not supported on Windows
Daemonize = true
# On UNIX it is normal to create a PID file
# if unspecified, no attempt will be made to create a PID file
#PidFile = /var/run/reTurnServer/reTurnServer.pid
防火墙:
*sudo iptables -L*
Chain INPUT (policy ACCEPT)
target prot opt source destination
fail2ban-ssh tcp -- anywhere anywhere multiport dports ssh
ACCEPT tcp -- anywhere anywhere tcp dpt:sip
ACCEPT udp -- anywhere anywhere udp dpt:sip
ACCEPT tcp -- anywhere anywhere tcp dpt:sip-tls
ACCEPT udp -- anywhere anywhere udp dpt:sip-tls
ACCEPT tcp -- anywhere anywhere tcp dpt:omniorb
ACCEPT tcp -- anywhere anywhere tcp dpt:3478
ACCEPT udp -- anywhere anywhere udp dpt:3478
ACCEPT tcp -- anywhere anywhere tcp dpt:5349
ACCEPT tcp -- anywhere anywhere tcp dpt:hostmon
ACCEPT udp -- anywhere anywhere udp dpt:hostmon
ACCEPT tcp -- anywhere anywhere multiport dports webmin:20000
ACCEPT udp -- anywhere anywhere multiport dports 10000:20000
ACCEPT udp -- anywhere anywhere multiport dports 49152:65535
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain fail2ban-ssh (1 references)
target prot opt source destination
RETURN all -- anywhere anywhere
非常感谢任何帮助!
答案 0 :(得分:1)
200的SDP部分就OK了,你会看到一堆候选人。现在涉及STUN / ICE协商,其中每个路径都由呼叫的每一侧进行测试。双方能够相互通信的路径是确保RTP能够流过的途径。
在网络路径中的某处,数据包未正确映射。您需要获取网络流量并检查STUN数据包以识别数据包流。
检查企业防火墙的防火墙规则。通常企业需要开放接受来自TURN的流量。尝试使用一些公共谷歌TURN服务器进行WebRTC,并试着看看它是否能让事情变得更好。
答案 1 :(得分:0)
所以我终于解决了这个问题。
TURN服务器需要有2个公共IP。
TurnAddress
和AltStunAddress
必须是2个不同的IP。
因此,reTURNServer.config的正确配置是:
TurnAddress = 213.xxx.xxx.178
AltStunAddress = 213.xxx.xxx.179
当然,如果您使用JsSIP或Sipml5,客户端脚本必须通过sip_servers
("turn:turnuser@turnip", credentials:"turnpassword"
)反映这些更改。