COTURN + Kurento MediaServer Trickle IceConnectionState 在一个选项卡上“已连接”,在另一个选项卡上“正在检查”

如何解决COTURN + Kurento MediaServer Trickle IceConnectionState 在一个选项卡上“已连接”,在另一个选项卡上“正在检查”

我已经在这个项目上工作了一段时间,没有其他解决方案,只能求助于你们。 我在 Azure VM 上设置了 STUN/TURN。服务器的设置如下:

listening-port=3478
tls-listening-port=5349
fingerprint
user=user:pass
lt-cred-mech
realm=kurento.org
log-file=/var/log/turnserver.log
verbose
external-ip=<Public_IP>

在运行 KMS 的 VM 上,我配置了文件:

/etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini

经过这些修改:

stunServerAddress=<public_ip>
stunServerPort=3478
turnURL=user:pass@<public_ip>:3478

在客户端中,我使用这些选项设置了 RTCPeerClient before 获取用户媒体并创建报价。

const configuration:
RTCConfiguration
= {"iceServers": [
        {
            urls:['turn:<public_ip_VM>:3478'],username: "user",credential: "pass"
        },{urls:['stun:<public_ip_VM>']},],iceTransportPolicy: "all"
};

然后我在一个浏览器中加入通话并在另一个浏览器中加入。

以下是第一个加入通信的浏览器的完整日志:

WebSocket is opened
CallScreen.tsx:220 RTCSessionDescription {type: "offer",sdp: "v=0
↵o=- 635656127645712694 2 IN IP4 127.0.0.1
↵s=…
↵a=fmtp:119 apt=124
↵a=rtpmap:123 ulpfec/90000
↵"}
CallScreen.tsx:229 Message Conn: {ConnectionInfo: {…},Action: "Join",sdpOffer: RTCSessionDescription}
CallScreen.tsx:91 ICE Candidate Found: RTCIceCandidate {candidate: "candidate:2686451073 1 udp 2122262783 2a02:a03f:61…eration 0 ufrag 3hQF network-id 2 network-cost 10",sdpMid: "0",sdpMLineIndex: 0,foundation: "2686451073",component: "rtp", …}
index.js:1 ERROR GATHERING ICE CANDIDATES ==>  RTCPeerConnectionIceErrorEvent {isTrusted: true,address: "[2a02:a03f:61c4:x:x:x:x:x]",port: 35184,hostCandidate: "[2a02:a03f:61c4:x:x:x:x:x]:35184",url: "stun:52.165.30.212:3478", …}
console.<computed> @ index.js:1
CallScreen.webRtcPeer.onicecandidateerror @ CallScreen.tsx:46
index.js:1 [Deprecation] 
console.<computed> @ index.js:1
CallScreen.webRtcPeer.onicecandidateerror @ CallScreen.tsx:46
CallScreen.tsx:91 ICE Candidate Found: RTCIceCandidate {candidate: "candidate:2447636755 1 udp 2122194687 192.168.1.42…eration 0 ufrag 3hQF network-id 1 network-cost 10",foundation: "2447636755", …}
CallScreen.tsx:91 ICE Candidate Found: RTCIceCandidate {candidate: "candidate:4003201393 1 tcp 1518283007 2a02:a03f:61…eration 0 ufrag 3hQF network-id 2 network-cost 10",foundation: "4003201393", …}
CallScreen.tsx:91 ICE Candidate Found: RTCIceCandidate {candidate: "candidate:3747612131 1 tcp 1518214911 192.168.1.42…eration 0 ufrag 3hQF network-id 1 network-cost 10",foundation: "3747612131", …}
CallScreen.tsx:91 ICE Candidate Found: RTCIceCandidate {candidate: "candidate:1744011463 1 udp 1685987071 109.136.191.…eration 0 ufrag 3hQF network-id 1 network-cost 10",foundation: "1744011463", …}
CallScreen.tsx:91 ICE Candidate Found: RTCIceCandidate {candidate: "candidate:3687200995 1 udp 41819903 52.165.30.212 …eration 0 ufrag 3hQF network-id 1 network-cost 10",foundation: "3687200995", …}
CallScreen.tsx:91 ICE Candidate Found: null
CallScreen.tsx:107 Received all Ice Candidates
CallScreen.tsx:135 Received Message: {"id":"callStatus","response":"accepted","sdpAnswer":"v=0\r\no=- 3820652736 3820652736 IN IP4 0.0.0.0\r\ns=Kurento Media Server\r\nc=IN IP4 0.0.0.0\r\nt=0 0\r\na=msid-semantic: WMS\r\na=group:BUNDLE 0\r\nm=video 1 UDP/TLS/RTP/SAVPF 96 102 127 125 108\r\na=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=sendonly\r\na=mid:0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=rtpmap:96 VP8/90000\r\na=rtpmap:102 H264/90000\r\na=rtpmap:127 H264/90000\r\na=rtpmap:125 H264/90000\r\na=rtpmap:108 H264/90000\r\na=rtcp-fb:96 goog-remb\r\na=rtcp-fb:96 ccm fir\r\na=rtcp-fb:96 nack\r\na=rtcp-fb:96 nack pli\r\na=rtcp-fb:102 goog-remb\r\na=rtcp-fb:102 ccm fir\r\na=rtcp-fb:102 nack\r\na=rtcp-fb:102 nack pli\r\na=rtcp-fb:127 goog-remb\r\na=rtcp-fb:127 ccm fir\r\na=rtcp-fb:127 nack\r\na=rtcp-fb:127 nack pli\r\na=rtcp-fb:125 goog-remb\r\na=rtcp-fb:125 ccm fir\r\na=rtcp-fb:125 nack\r\na=rtcp-fb:125 nack pli\r\na=rtcp-fb:108 goog-remb\r\na=rtcp-fb:108 ccm fir\r\na=rtcp-fb:108 nack\r\na=rtcp-fb:108 nack pli\r\na=setup:active\r\na=rtcp-mux\r\na=fmtp:102 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f\r\na=fmtp:127 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42001f\r\na=fmtp:125 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f\r\na=fmtp:108 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42e01f\r\na=ssrc:3755615383 cname:user1459207244@host-ffbb510\r\na=ice-ufrag:lapS\r\na=ice-pwd:vEblLRMQWUGRqiExBV9mXm\r\na=fingerprint:sha-256 CC:CF:1F:DB:38:36:4F:7A:F3:71:D9:46:10:43:37:C1:BE:90:FB:D6:C9:45:2D:B0:1B:40:2C:B5:74:00:2A:84\r\n"}
CallScreen.tsx:75 Remote Stream Added: MediaStream {id: "default",active: true,onaddtrack: null,onremovetrack: null,onactive: null, …}
CallScreen.tsx:146 Remote sdp successfully set:  {sdp: "v=0
↵o=- 3820652736 3820652736 IN IP4 0.0.0.0
↵s=K…BE:90:FB:D6:C9:45:2D:B0:1B:40:2C:B5:74:00:2A:84
↵",type: "answer"}
CallScreen.tsx:135 Received Message: {"id":"iceCandidate","candidate":{"candidate":"candidate:3 1 TCP 1010827519 10.0.2.5 45037 typ host tcptype passive","sdpMid":"0","sdpMLineIndex":0}}
CallScreen.tsx:53 ICE Connection State Changed:  checking
CallScreen.tsx:54 Event {isTrusted: true,type: "iceconnectionstatechange",target: RTCPeerConnection,currentTarget: RTCPeerConnection,eventPhase: 2, …}
CallScreen.tsx:135 Received Message: {"id":"iceCandidate","candidate":{"candidate":"candidate:6 2 TCP 1010827774 fe80::20d:3aff:fea6:612b 2023 typ host tcptype passive","sdpMLineIndex":0}}
CallScreen.tsx:135 Received Message: {"id":"iceCandidate","candidate":{"candidate":"candidate:5 2 TCP 1015022078 fe80::20d:3aff:fea6:612b 9 typ host tcptype active","candidate":{"candidate":"candidate:4 2 UDP 2015363582 fe80::20d:3aff:fea6:612b 51592 typ host","candidate":{"candidate":"candidate:3 2 TCP 1010827518 10.0.2.5 43244 typ host tcptype passive","candidate":{"candidate":"candidate:2 2 TCP 1015021822 10.0.2.5 9 typ host tcptype active","candidate":{"candidate":"candidate:1 2 UDP 2015363326 10.0.2.5 9993 typ host","candidate":{"candidate":"candidate:6 1 TCP 1010827775 fe80::20d:3aff:fea6:612b 17406 typ host tcptype passive","candidate":{"candidate":"candidate:5 1 TCP 1015022079 fe80::20d:3aff:fea6:612b 9 typ host tcptype active","candidate":{"candidate":"candidate:4 1 UDP 2015363583 fe80::20d:3aff:fea6:612b 46945 typ host","candidate":{"candidate":"candidate:2 1 TCP 1015021823 10.0.2.5 9 typ host tcptype active","candidate":{"candidate":"candidate:1 1 UDP 2015363327 10.0.2.5 50941 typ host","candidate":{"candidate":"candidate:9 1 TCP 843055359 52.165.30.212 45037 typ srflx raddr 10.0.2.5 rport 45037 tcptype passive","candidate":{"candidate":"candidate:8 1 TCP 847249663 52.165.30.212 9 typ srflx raddr 10.0.2.5 rport 9 tcptype active","candidate":{"candidate":"candidate:7 1 UDP 1679819007 52.165.30.212 50941 typ srflx raddr 10.0.2.5 rport 50941","candidate":{"candidate":"candidate:10 1 UDP 505413887 52.165.30.212 50898 typ relay raddr 10.0.2.5 rport 50941","sdpMLineIndex":0}}
CallScreen.tsx:53 ICE Connection State Changed:  disconnected
CallScreen.tsx:54 Event {isTrusted: true, …}

可以看到iceconnectionchanged导致处于“checking”状态 而在我加入通话会话的第二个选项卡中:

WebSocket is opened
CallScreen.tsx:220 RTCSessionDescription {type: "offer",sdp: "v=0
↵o=- 4700503829836937653 2 IN IP4 127.0.0.1
↵s…
↵a=fmtp:119 apt=124
↵a=rtpmap:123 ulpfec/90000
↵"}
CallScreen.tsx:229 Message Conn: {ConnectionInfo: {…},sdpOffer: RTCSessionDescription}
CallScreen.tsx:91 ICE Candidate Found: RTCIceCandidate {candidate: "candidate:2686451073 1 udp 2122262783 2a02:a03f:61…eration 0 ufrag oexL network-id 2 network-cost 10",port: 39827,hostCandidate: "[2a02:a03f:61c4:x:x:x:x:x]:39827", …}
console.<computed> @ index.js:1
CallScreen.webRtcPeer.onicecandidateerror @ CallScreen.tsx:46
index.js:1 [Deprecation] 
console.<computed> @ index.js:1
CallScreen.webRtcPeer.onicecandidateerror @ CallScreen.tsx:46
CallScreen.tsx:91 ICE Candidate Found: RTCIceCandidate {candidate: "candidate:2447636755 1 udp 2122194687 192.168.1.42…eration 0 ufrag oexL network-id 1 network-cost 10", …}
CallScreen.tsx:91 ICE Candidate Found: RTCIceCandidate {candidate: "candidate:4003201393 1 tcp 1518283007 2a02:a03f:61…eration 0 ufrag oexL network-id 2 network-cost 10", …}
CallScreen.tsx:91 ICE Candidate Found: RTCIceCandidate {candidate: "candidate:3747612131 1 tcp 1518214911 192.168.1.42…eration 0 ufrag oexL network-id 1 network-cost 10", …}
CallScreen.tsx:91 ICE Candidate Found: RTCIceCandidate {candidate: "candidate:1744011463 1 udp 1685987071 109.136.191.…eration 0 ufrag oexL network-id 1 network-cost 10", …}
CallScreen.tsx:135 Received Message: {"id":"callStatus","sdpAnswer":"v=0\r\no=- 3820652736 3820652736 IN IP4 0.0.0.0\r\ns=Kurento Media Server\r\nc=IN IP4 0.0.0.0\r\nt=0 0\r\na=msid-semantic: WMS\r\na=group:BUNDLE 0\r\nm=video 1 UDP/TLS/RTP/SAVPF 96 102 127 125 108\r\na=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=sendonly\r\na=mid:0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=rtpmap:96 VP8/90000\r\na=rtpmap:102 H264/90000\r\na=rtpmap:127 H264/90000\r\na=rtpmap:125 H264/90000\r\na=rtpmap:108 H264/90000\r\na=rtcp-fb:96 goog-remb\r\na=rtcp-fb:96 ccm fir\r\na=rtcp-fb:96 nack\r\na=rtcp-fb:96 nack pli\r\na=rtcp-fb:102 goog-remb\r\na=rtcp-fb:102 ccm fir\r\na=rtcp-fb:102 nack\r\na=rtcp-fb:102 nack pli\r\na=rtcp-fb:127 goog-remb\r\na=rtcp-fb:127 ccm fir\r\na=rtcp-fb:127 nack\r\na=rtcp-fb:127 nack pli\r\na=rtcp-fb:125 goog-remb\r\na=rtcp-fb:125 ccm fir\r\na=rtcp-fb:125 nack\r\na=rtcp-fb:125 nack pli\r\na=rtcp-fb:108 goog-remb\r\na=rtcp-fb:108 ccm fir\r\na=rtcp-fb:108 nack\r\na=rtcp-fb:108 nack pli\r\na=setup:active\r\na=rtcp-mux\r\na=fmtp:102 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f\r\na=fmtp:127 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42001f\r\na=fmtp:125 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f\r\na=fmtp:108 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42e01f\r\na=ssrc:3432352628 cname:user1173761955@host-61d2b2cc\r\na=ice-ufrag:2qt5\r\na=ice-pwd:VVCpYq3BJe70fPIM8mdrPe\r\na=fingerprint:sha-256 CC:CF:1F:DB:38:36:4F:7A:F3:71:D9:46:10:43:37:C1:BE:90:FB:D6:C9:45:2D:B0:1B:40:2C:B5:74:00:2A:84\r\n"}
CallScreen.tsx:75 Remote Stream Added: MediaStream {id: "default",type: "answer"}
CallScreen.tsx:91 ICE Candidate Found: RTCIceCandidate {candidate: "candidate:3687200995 1 udp 41819903 52.165.30.212 …eration 0 ufrag oexL network-id 1 network-cost 10", …}
CallScreen.tsx:91 ICE Candidate Found: null
CallScreen.tsx:107 Received all Ice Candidates
CallScreen.tsx:123 Sending Message Ice Candidate:  {ConnectionInfo: {…},Action: "onIceCandidate",candidate: RTCIceCandidate}
CallScreen.tsx:123 Sending Message Ice Candidate:  {ConnectionInfo: {…},candidate: RTCIceCandidate}
CallScreen.tsx:135 Received Message: {"id":"iceCandidate","candidate":{"candidate":"candidate:3 1 TCP 1010827519 10.0.2.5 35980 typ host tcptype passive","candidate":{"candidate":"candidate:4 1 UDP 2015363583 fe80::20d:3aff:fea6:612b 24009 typ host","candidate":{"candidate":"candidate:1 2 UDP 2015363326 10.0.2.5 5018 typ host","candidate":{"candidate":"candidate:6 1 TCP 1010827775 fe80::20d:3aff:fea6:612b 48841 typ host tcptype passive","candidate":{"candidate":"candidate:1 1 UDP 2015363327 10.0.2.5 63778 typ host","candidate":{"candidate":"candidate:3 2 TCP 1010827518 10.0.2.5 2472 typ host tcptype passive","candidate":{"candidate":"candidate:4 2 UDP 2015363582 fe80::20d:3aff:fea6:612b 46023 typ host","candidate":{"candidate":"candidate:7 1 UDP 1679819007 52.165.30.212 63778 typ srflx raddr 10.0.2.5 rport 63778","candidate":{"candidate":"candidate:6 2 TCP 1010827774 fe80::20d:3aff:fea6:612b 21311 typ host tcptype passive","candidate":{"candidate":"candidate:9 1 TCP 843055359 52.165.30.212 35980 typ srflx raddr 10.0.2.5 rport 35980 tcptype passive","candidate":{"candidate":"candidate:10 1 UDP 505413887 52.165.30.212 56391 typ relay raddr 10.0.2.5 rport 63778","sdpMLineIndex":0}}
CallScreen.tsx:53 ICE Connection State Changed:  connected
CallScreen.tsx:54 Event {isTrusted: true, …}

你可以看到我收到了所有的候选人。通讯已建立。当“ontack”触发时,我什至从其他浏览器接收 MediaStream。问题是网络上从来没有共享视频,第一个浏览器选项卡上的 iceconnectionchanged 事件让我处于“正在检查”状态。一段时间后,它最终会处于“断开连接”的状态。而第二个给了我“连接”的状态。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-
参考1 参考2 解决方案 # 点击安装源 协议选择 http:// 路径填写 mirrors.aliyun.com/centos/8.3.2011/BaseOS/x86_64/os URL类型 软件库URL 其他路径 # 版本 7 mirrors.aliyun.com/centos/7/os/x86
报错1 [root@slave1 data_mocker]# kafka-console-consumer.sh --bootstrap-server slave1:9092 --topic topic_db [2023-12-19 18:31:12,770] WARN [Consumer clie
错误1 # 重写数据 hive (edu)&gt; insert overwrite table dwd_trade_cart_add_inc &gt; select data.id, &gt; data.user_id, &gt; data.course_id, &gt; date_format(
错误1 hive (edu)&gt; insert into huanhuan values(1,&#39;haoge&#39;); Query ID = root_20240110071417_fe1517ad-3607-41f4-bdcf-d00b98ac443e Total jobs = 1
报错1:执行到如下就不执行了,没有显示Successfully registered new MBean. [root@slave1 bin]# /usr/local/software/flume-1.9.0/bin/flume-ng agent -n a1 -c /usr/local/softwa
虚拟及没有启动任何服务器查看jps会显示jps,如果没有显示任何东西 [root@slave2 ~]# jps 9647 Jps 解决方案 # 进入/tmp查看 [root@slave1 dfs]# cd /tmp [root@slave1 tmp]# ll 总用量 48 drwxr-xr-x. 2
报错1 hive&gt; show databases; OK Failed with exception java.io.IOException:java.lang.RuntimeException: Error in configuring object Time taken: 0.474 se
报错1 [root@localhost ~]# vim -bash: vim: 未找到命令 安装vim yum -y install vim* # 查看是否安装成功 [root@hadoop01 hadoop]# rpm -qa |grep vim vim-X11-7.4.629-8.el7_9.x
修改hadoop配置 vi /usr/local/software/hadoop-2.9.2/etc/hadoop/yarn-site.xml # 添加如下 &lt;configuration&gt; &lt;property&gt; &lt;name&gt;yarn.nodemanager.res