AZURE VM上的 Coturn WebRTC 问题(Ubuntu Server 16.04 LTS)

我使用webRTC与其他浏览器建立Web浏览器实时通信。为确保此连接始终稳定,我想设置自己的STUN / TURN服务器。我决定在Azure VM(Ubuntu Server)上使用coturn。我按照以下文档在Azure上设置了coturn https://www.microsoft.com/developerblog/2018/01/29/orchestrating-turn-servers-cloud-deployment/。
根据[Trickele ICE] [1]
[1]:https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/我的STUN服务器可以正常运转,效果不错。
但每当我尝试使用我的STUN / TURN服务器建立网络摄像头连接时,它都无法正常工作。
webRTC协议会话统计:

Local SDP
v=0
o=mozilla...THIS_IS_SDPARTA-58.0.2 8794114299540424628 0 IN IP4 0.0.0.0
s=-
t=0 0
a=sendrecv
a=fingerprint:sha-256 8B:A5:5A:36:D7:42:B0:DE:D8:FB:3B:AC:7A:41:AE:D1:F2:86:71:66:CB:99:79:54:08:9B:B2:97:DC:54:D7:E6
a=group:BUNDLE sdparta_0 sdparta_1
a=ice-options:trickle
a=msid-semantic:WMS *
m=audio 52254 UDP/TLS/RTP/SAVPF 109 9 0 8 101
c=IN IP4 192.168.9.1
a=candidate:0 1 UDP 2122252543 192.168.9.1 52254 typ host
a=candidate:1 1 UDP 2122187007 192.168.67.1 52255 typ host
a=candidate:2 1 UDP 2122121471 192.168.1.151 52256 typ host
a=candidate:3 1 TCP 2105524479 192.168.9.1 9 typ host tcptype active
a=candidate:4 1 TCP 2105458943 192.168.67.1 9 typ host tcptype active
a=candidate:5 1 TCP 2105393407 192.168.1.151 9 typ host tcptype active
a=candidate:0 2 UDP 2122252542 192.168.9.1 52257 typ host
a=candidate:1 2 UDP 2122187006 192.168.67.1 52258 typ host
a=candidate:2 2 UDP 2122121470 192.168.1.151 52259 typ host
a=candidate:3 2 TCP 2105524478 192.168.9.1 9 typ host tcptype active
a=candidate:4 2 TCP 2105458942 192.168.67.1 9 typ host tcptype active
a=candidate:5 2 TCP 2105393406 192.168.1.151 9 typ host tcptype active
a=sendrecv
a=end-of-candidates
a=extmap:1/sendonly urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:2 urn:ietf:params:rtp-hdrext:sdes:mid
a=fmtp:109 maxplaybackrate=48000;stereo=1;useinbandfec=1
a=fmtp:101 0-15
a=ice-pwd:b8b3237da4b403dd6e1e50c3a182f227
a=ice-ufrag:4efa27f0
a=mid:sdparta_0
a=msid:{9866f92b-4ef3-44d8-88bf-40e0064ad000} {24f74a5f-6173-4d87-b2fd-90f05de1c3c4}
a=rtcp:52257 IN IP4 192.168.9.1
a=rtcp-mux
a=rtpmap:109 opus/48000/2
a=rtpmap:9 G722/8000/1
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=setup:actpass
a=ssrc:753158800 cname:{38718aae-997b-4110-aeeb-a8126f52f4f3}
m=video 52260 UDP/TLS/RTP/SAVPF 120 121 126 97
c=IN IP4 192.168.9.1
a=candidate:0 1 UDP 2122252543 192.168.9.1 52260 typ host
a=candidate:1 1 UDP 2122187007 192.168.67.1 52261 typ host
a=candidate:2 1 UDP 2122121471 192.168.1.151 52262 typ host
a=candidate:3 1 TCP 2105524479 192.168.9.1 9 typ host tcptype active
a=candidate:4 1 TCP 2105458943 192.168.67.1 9 typ host tcptype active
a=candidate:5 1 TCP 2105393407 192.168.1.151 9 typ host tcptype active
a=candidate:0 2 UDP 2122252542 192.168.9.1 58499 typ host
a=candidate:1 2 UDP 2122187006 192.168.67.1 58500 typ host
a=candidate:2 2 UDP 2122121470 192.168.1.151 58501 typ host
a=candidate:3 2 TCP 2105524478 192.168.9.1 9 typ host tcptype active
a=candidate:4 2 TCP 2105458942 192.168.67.1 9 typ host tcptype active
a=candidate:5 2 TCP 2105393406 192.168.1.151 9 typ host tcptype active
a=sendrecv
a=end-of-candidates
a=extmap:1 htttp://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:2 urn:ietf:params:rtp-hdrext:toffset
a=extmap:3 urn:ietf:params:rtp-hdrext:sdes:mid
a=fmtp:126 profile-level-id=42e01f;level-asymmetry-allowed=1;packetization-mode=1
a=fmtp:97 profile-level-id=42e01f;level-asymmetry-allowed=1
a=fmtp:120 max-fs=12288;max-fr=60
a=fmtp:121 max-fs=12288;max-fr=60
a=ice-pwd:b8b3237da4b403dd6e1e50c3a182f227
a=ice-ufrag:4efa27f0
a=mid:sdparta_1
a=msid:{9866f92b-4ef3-44d8-88bf-40e0064ad000} {59810283-0f69-47fa-964d-7ba8966daaff}
a=rtcp:58499 IN IP4 192.168.9.1
a=rtcp-fb:120 nack
a=rtcp-fb:120 nack pli
a=rtcp-fb:120 ccm fir
a=rtcp-fb:120 goog-remb
a=rtcp-fb:121 nack
a=rtcp-fb:121 nack pli
a=rtcp-fb:121 ccm fir
a=rtcp-fb:121 goog-remb
a=rtcp-fb:126 nack
a=rtcp-fb:126 nack pli
a=rtcp-fb:126 ccm fir
a=rtcp-fb:126 goog-remb
a=rtcp-fb:97 nack
a=rtcp-fb:97 nack pli
a=rtcp-fb:97 ccm fir
a=rtcp-fb:97 goog-remb
a=rtcp-mux
a=rtpmap:120 VP8/90000
a=rtpmap:121 VP9/90000
a=rtpmap:126 H264/90000
a=rtpmap:97 H264/90000
a=setup:actpass
a=ssrc:3734878749 cname:{38718aae-997b-4110-aeeb-a8126f52f4f3}
Remote SDP
v=0
o=mozilla...THIS_IS_SDPARTA-58.0.1 2958360105461551245 0 IN IP4 0.0.0.0
s=-
t=0 0
a=sendrecv
a=fingerprint:sha-256 29:21:2A:C5:42:11:8E:E9:2D:A2:8E:48:FA:AA:EB:C8:61:33:ED:B3:24:71:BC:20:27:68:1F:48:FB:EC:64:64
a=group:BUNDLE sdparta_0 sdparta_1
a=ice-options:trickle
a=msid-semantic:WMS *
m=audio 9 UDP/TLS/RTP/SAVPF 109 101
c=IN IP4 0.0.0.0
a=candidate:0 1 UDP 2122252543 192.168.1.155 58107 typ host
a=candidate:1 1 TCP 2105524479 192.168.1.155 9 typ host tcptype active
a=sendrecv
a=extmap:2 urn:ietf:params:rtp-hdrext:sdes:mid
a=fmtp:109 maxplaybackrate=48000;stereo=1;useinbandfec=1
a=fmtp:101 0-15
a=ice-pwd:83ca8dee4d50f43c443762e84fdb52c4
a=ice-ufrag:1a999d61
a=mid:sdparta_0
a=msid:{b9e14e75-b26e-4d1c-a5be-b359c6f0b91b} {b0b43916-ee73-474e-acbf-f57d639c99ae}
a=rtcp-mux
a=rtpmap:109 opus/48000/2
a=rtpmap:101 telephone-event/8000
a=setup:active
a=ssrc:3242481895 cname:{d0c1b500-19b7-483a-be5b-46da70b91ab2}
m=video 9 UDP/TLS/RTP/SAVPF 120
c=IN IP4 0.0.0.0
a=sendrecv
a=extmap:1 htttp://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:2 urn:ietf:params:rtp-hdrext:toffset
a=extmap:3 urn:ietf:params:rtp-hdrext:sdes:mid
a=fmtp:120 max-fs=12288;max-fr=60
a=ice-pwd:83ca8dee4d50f43c443762e84fdb52c4
a=ice-ufrag:1a999d61
a=mid:sdparta_1
a=msid:{b9e14e75-b26e-4d1c-a5be-b359c6f0b91b} {e297d5a1-76cc-46f8-8ea2-acb932a3056a}
a=rtcp-fb:120 nack
a=rtcp-fb:120 nack pli
a=rtcp-fb:120 ccm fir
a=rtcp-fb:120 goog-remb
a=rtcp-mux
a=rtpmap:120 VP8/90000
a=setup:active
a=ssrc:1237891263 cname:{d0c1b500-19b7-483a-be5b-46da70b91ab2}

webRTC协议连接日志:

(ice/WARNING) z:/build/build/src/media/mtransport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:617 function nr_socket_multi_tcp_listen failed with error 3
(ice/WARNING) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage))): failed to create passive TCP host candidate: 3
(ice/INFO) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage))): Skipping TURN server because of link local mis-match
(ice/WARNING) z:/build/build/src/media/mtransport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:617 function nr_socket_multi_tcp_listen failed with error 3
(ice/WARNING) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage))): failed to create passive TCP host candidate: 3
(ice/INFO) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage))): Skipping TURN server because of link local mis-match
(ice/WARNING) z:/build/build/src/media/mtransport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:617 function nr_socket_multi_tcp_listen failed with error 3
(ice/WARNING) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage))): failed to create passive TCP host candidate: 3
(ice/INFO) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage))): Skipping TURN server because of link local mis-match
(ice/WARNING) z:/build/build/src/media/mtransport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:617 function nr_socket_multi_tcp_listen failed with error 3
(ice/WARNING) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage))): failed to create passive TCP host candidate: 3
(ice/INFO) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage))): Skipping TURN server because of link local mis-match
(ice/WARNING) z:/build/build/src/media/mtransport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:617 function nr_socket_multi_tcp_listen failed with error 3
(ice/WARNING) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage))): failed to create passive TCP host candidate: 3
(ice/INFO) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage))): Skipping TURN server because of link local mis-match
(ice/WARNING) z:/build/build/src/media/mtransport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:617 function nr_socket_multi_tcp_listen failed with error 3
(ice/WARNING) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage))): failed to create passive TCP host candidate: 3
(ice/INFO) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage))): Skipping TURN server because of link local mis-match
(generic/ERR) Error from TCPSocketChild: type: ConnectionRefusedError, name: Network
(generic/ERR) Error from TCPSocketChild: type: ConnectionRefusedError, name: Network
(generic/ERR) Error from TCPSocketChild: type: ConnectionRefusedError, name: Network
(generic/ERR) Error from TCPSocketChild: type: ConnectionRefusedError, name: Network
(generic/ERR) Error from TCPSocketChild: type: ConnectionRefusedError, name: Network
(ice/WARNING) z:/build/build/src/media/mtransport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:617 function nr_socket_multi_tcp_listen failed with error 3
(ice/WARNING) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage))): failed to create passive TCP host candidate: 3
(ice/INFO) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage))): Skipping TURN server because of link local mis-match
(ice/WARNING) z:/build/build/src/media/mtransport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:617 function nr_socket_multi_tcp_listen failed with error 3
(ice/WARNING) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage))): failed to create passive TCP host candidate: 3
(ice/INFO) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage))): Skipping TURN server because of link local mis-match
(ice/WARNING) z:/build/build/src/media/mtransport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:617 function nr_socket_multi_tcp_listen failed with error 3
(ice/WARNING) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage))): failed to create passive TCP host candidate: 3
(generic/ERR) Error from TCPSocketChild: type: ConnectionRefusedError, name: Network
(ice/INFO) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage))): Skipping TURN server because of link local mis-match
(generic/ERR) Error from TCPSocketChild: type: ConnectionRefusedError, name: Network
(generic/ERR) Error from TCPSocketChild: type: ConnectionRefusedError, name: Network
(generic/ERR) Error from TCPSocketChild: type: ConnectionRefusedError, name: Network
(generic/ERR) Error from TCPSocketChild: type: ConnectionRefusedError, name: Network
(ice/WARNING) z:/build/build/src/media/mtransport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:617 function nr_socket_multi_tcp_listen failed with error 3
(ice/WARNING) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage))): failed to create passive TCP host candidate: 3
(ice/INFO) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage))): Skipping TURN server because of link local mis-match
(ice/WARNING) z:/build/build/src/media/mtransport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:617 function nr_socket_multi_tcp_listen failed with error 3
(ice/WARNING) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage))): failed to create passive TCP host candidate: 3
(ice/INFO) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage))): Skipping TURN server because of link local mis-match
(ice/WARNING) z:/build/build/src/media/mtransport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:617 function nr_socket_multi_tcp_listen failed with error 3
(ice/WARNING) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage))): failed to create passive TCP host candidate: 3
(ice/INFO) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage))): Skipping TURN server because of link local mis-match
(generic/ERR) Error from TCPSocketChild: type: ConnectionRefusedError, name: Network
(generic/ERR) Error from TCPSocketChild: type: ConnectionRefusedError, name: Network
(generic/ERR) Error from TCPSocketChild: type: ConnectionRefusedError, name: Network
(generic/ERR) Error from TCPSocketChild: type: ConnectionRefusedError, name: Network
(generic/ERR) Error from TCPSocketChild: type: ConnectionRefusedError, name: Network
(generic/ERR) Error from TCPSocketChild: type: ConnectionRefusedError, name: Network
(generic/ERR) Error from TCPSocketChild: type: ConnectionRefusedError, name: Network
(generic/ERR) Error from TCPSocketChild: type: ConnectionRefusedError, name: Network
(generic/ERR) Error from TCPSocketChild: type: ConnectionRefusedError, name: Network
(generic/ERR) Error from TCPSocketChild: type: ConnectionRefusedError, name: Network
(generic/ERR) Error from TCPSocketChild: type: ConnectionRefusedError, name: Network
(generic/ERR) Error from TCPSocketChild: type: ConnectionRefusedError, name: Network
(generic/ERR) Error from TCPSocketChild: type: ConnectionRefusedError, name: Network
(generic/ERR) Error from TCPSocketChild: type: ConnectionRefusedError, name: Network
(ice/WARNING) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage))): peer (PC:222222222222222 (id=1111111111url=(link to myhompage)):default) has no stream matching stream 0-1519224369457000 (id=1111111111url=(link to myhompage)) aLevel=1
(ice/NOTICE) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage))): peer (PC:222222222222222 (id=1111111111url=(link to myhompage)):default) no streams with non-empty check lists
(ice/NOTICE) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage))): peer (PC:222222222222222 (id=1111111111url=(link to myhompage)):default) no streams with pre-answer requests
(ice/NOTICE) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage))): peer (PC:222222222222222 (id=1111111111url=(link to myhompage)):default) no checks to start
(ice/INFO) ICE-PEER(PC:222222222222222 (id=1111111111url=(link to myhompage)):default)/CAND-PAIR(mR+z): setting pair to state FROZEN: mR+z|IP4:192.168.9.1:52254/UDP|IP4:192.168.1.155:58107/UDP(host(IP4:192.168.9.1:52254/UDP)|candidate:0 1 UDP 2122252543 192.168.1.155 58107 typ host)
(ice/INFO) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage)))/CAND-PAIR(mR+z): Pairing candidate IP4:192.168.9.1:52254/UDP (7e7f00ff):IP4:192.168.1.155:58107/UDP (7e7f00ff) priority=9115005270282338815 (7e7f00fffcfe01ff)
(ice/INFO) ICE-PEER(PC:222222222222222 (id=1111111111url=(link to myhompage)):default)/ICE-STREAM(0-1519224369457000 (id=1111111111url=(link to myhompage)) aLevel=0): Starting check timer for stream.
(ice/INFO) ICE-PEER(PC:222222222222222 (id=1111111111url=(link to myhompage)):default)/CAND-PAIR(mR+z): setting pair to state WAITING: mR+z|IP4:192.168.9.1:52254/UDP|IP4:192.168.1.155:58107/UDP(host(IP4:192.168.9.1:52254/UDP)|candidate:0 1 UDP 2122252543 192.168.1.155 58107 typ host)
(ice/INFO) ICE-PEER(PC:222222222222222 (id=1111111111url=(link to myhompage)):default)/CAND-PAIR(mR+z): setting pair to state IN_PROGRESS: mR+z|IP4:192.168.9.1:52254/UDP|IP4:192.168.1.155:58107/UDP(host(IP4:192.168.9.1:52254/UDP)|candidate:0 1 UDP 2122252543 192.168.1.155 58107 typ host)
(ice/NOTICE) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage))): peer (PC:222222222222222 (id=1111111111url=(link to myhompage)):default) is now checking
(ice/INFO) ICE-PEER(PC:222222222222222 (id=1111111111url=(link to myhompage)):default)/CAND-PAIR(TCv6): setting pair to state FROZEN: TCv6|IP4:192.168.67.1:52255/UDP|IP4:192.168.1.155:58107/UDP(host(IP4:192.168.67.1:52255/UDP)|candidate:0 1 UDP 2122252543 192.168.1.155 58107 typ host)
(ice/INFO) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage)))/CAND-PAIR(TCv6): Pairing candidate IP4:192.168.67.1:52255/UDP (7e7e00ff):IP4:192.168.1.155:58107/UDP (7e7f00ff) priority=9114723795305628158 (7e7e00fffcfe01fe)
(ice/INFO) ICE-PEER(PC:222222222222222 (id=1111111111url=(link to myhompage)):default)/CAND-PAIR(9PJr): setting pair to state FROZEN: 9PJr|IP4:192.168.1.151:52256/UDP|IP4:192.168.1.155:58107/UDP(host(IP4:192.168.1.151:52256/UDP)|candidate:0 1 UDP 2122252543 192.168.1.155 58107 typ host)
(ice/INFO) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage)))/CAND-PAIR(9PJr): Pairing candidate IP4:192.168.1.151:52256/UDP (7e7d00ff):IP4:192.168.1.155:58107/UDP (7e7f00ff) priority=9114442320328917502 (7e7d00fffcfe01fe)
(ice/INFO) ICE-PEER(PC:222222222222222 (id=1111111111url=(link to myhompage)):default)/CAND-PAIR(TCv6): setting pair to state WAITING: TCv6|IP4:192.168.67.1:52255/UDP|IP4:192.168.1.155:58107/UDP(host(IP4:192.168.67.1:52255/UDP)|candidate:0 1 UDP 2122252543 192.168.1.155 58107 typ host)
(ice/INFO) ICE-PEER(PC:222222222222222 (id=1111111111url=(link to myhompage)):default)/CAND-PAIR(TCv6): setting pair to state IN_PROGRESS: TCv6|IP4:192.168.67.1:52255/UDP|IP4:192.168.1.155:58107/UDP(host(IP4:192.168.67.1:52255/UDP)|candidate:0 1 UDP 2122252543 192.168.1.155 58107 typ host)
(ice/INFO) ICE-PEER(PC:222222222222222 (id=1111111111url=(link to myhompage)):default)/CAND-PAIR(9PJr): setting pair to state WAITING: 9PJr|IP4:192.168.1.151:52256/UDP|IP4:192.168.1.155:58107/UDP(host(IP4:192.168.1.151:52256/UDP)|candidate:0 1 UDP 2122252543 192.168.1.155 58107 typ host)
(ice/INFO) ICE-PEER(PC:222222222222222 (id=1111111111url=(link to myhompage)):default)/CAND-PAIR(9PJr): setting pair to state IN_PROGRESS: 9PJr|IP4:192.168.1.151:52256/UDP|IP4:192.168.1.155:58107/UDP(host(IP4:192.168.1.151:52256/UDP)|candidate:0 1 UDP 2122252543 192.168.1.155 58107 typ host)
(ice/WARNING) ICE-PEER(PC:222222222222222 (id=1111111111url=(link to myhompage)):default): no pairs for 0-1519224369457000 (id=1111111111url=(link to myhompage)) aLevel=0
(ice/INFO) ICE-PEER(PC:222222222222222 (id=1111111111url=(link to myhompage)):default)/CAND-PAIR(9PJr): triggered check on 9PJr|IP4:192.168.1.151:52256/UDP|IP4:192.168.1.155:58107/UDP(host(IP4:192.168.1.151:52256/UDP)|candidate:0 1 UDP 2122252543 192.168.1.155 58107 typ host)
(ice/INFO) ICE-PEER(PC:222222222222222 (id=1111111111url=(link to myhompage)):default)/CAND-PAIR(9PJr): setting pair to state FROZEN: 9PJr|IP4:192.168.1.151:52256/UDP|IP4:192.168.1.155:58107/UDP(host(IP4:192.168.1.151:52256/UDP)|candidate:0 1 UDP 2122252543 192.168.1.155 58107 typ host)
(ice/INFO) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage)))/CAND-PAIR(9PJr): Pairing candidate IP4:192.168.1.151:52256/UDP (7e7d00ff):IP4:192.168.1.155:58107/UDP (7e7f00ff) priority=9114442320328917502 (7e7d00fffcfe01fe)
(ice/INFO) CAND-PAIR(9PJr): Adding pair to check list and trigger check queue: 9PJr|IP4:192.168.1.151:52256/UDP|IP4:192.168.1.155:58107/UDP(host(IP4:192.168.1.151:52256/UDP)|candidate:0 1 UDP 2122252543 192.168.1.155 58107 typ host)
(ice/INFO) ICE-PEER(PC:222222222222222 (id=1111111111url=(link to myhompage)):default)/CAND-PAIR(9PJr): setting pair to state WAITING: 9PJr|IP4:192.168.1.151:52256/UDP|IP4:192.168.1.155:58107/UDP(host(IP4:192.168.1.151:52256/UDP)|candidate:0 1 UDP 2122252543 192.168.1.155 58107 typ host)
(ice/INFO) ICE-PEER(PC:222222222222222 (id=1111111111url=(link to myhompage)):default)/CAND-PAIR(9PJr): setting pair to state CANCELLED: 9PJr|IP4:192.168.1.151:52256/UDP|IP4:192.168.1.155:58107/UDP(host(IP4:192.168.1.151:52256/UDP)|candidate:0 1 UDP 2122252543 192.168.1.155 58107 typ host)
(ice/INFO) ICE-PEER(PC:222222222222222 (id=1111111111url=(link to myhompage)):default)/ICE-STREAM(0-1519224369457000 (id=1111111111url=(link to myhompage)) aLevel=0): Starting check timer for stream.
(ice/INFO) ICE-PEER(PC:222222222222222 (id=1111111111url=(link to myhompage)):default)/CAND-PAIR(9PJr): setting pair to state IN_PROGRESS: 9PJr|IP4:192.168.1.151:52256/UDP|IP4:192.168.1.155:58107/UDP(host(IP4:192.168.1.151:52256/UDP)|candidate:0 1 UDP 2122252543 192.168.1.155 58107 typ host)
(ice/WARNING) ICE-PEER(PC:222222222222222 (id=1111111111url=(link to myhompage)):default): no pairs for 0-1519224369457000 (id=1111111111url=(link to myhompage)) aLevel=0
(stun/INFO) STUN-CLIENT(9PJr|IP4:192.168.1.151:52256/UDP|IP4:192.168.1.155:58107/UDP(host(IP4:192.168.1.151:52256/UDP)|candidate:0 1 UDP 2122252543 192.168.1.155 58107 typ host)): Received response; processing
(ice/INFO) ICE-PEER(PC:222222222222222 (id=1111111111url=(link to myhompage)):default)/CAND-PAIR(9PJr): setting pair to state SUCCEEDED: 9PJr|IP4:192.168.1.151:52256/UDP|IP4:192.168.1.155:58107/UDP(host(IP4:192.168.1.151:52256/UDP)|candidate:0 1 UDP 2122252543 192.168.1.155 58107 typ host)
(ice/INFO) ICE-PEER(PC:222222222222222 (id=1111111111url=(link to myhompage)):default)/STREAM(0-1519224369457000 (id=1111111111url=(link to myhompage)) aLevel=0)/COMP(1)/CAND-PAIR(9PJr): nominated pair is 9PJr|IP4:192.168.1.151:52256/UDP|IP4:192.168.1.155:58107/UDP(host(IP4:192.168.1.151:52256/UDP)|candidate:0 1 UDP 2122252543 192.168.1.155 58107 typ host)
(ice/INFO) ICE-PEER(PC:222222222222222 (id=1111111111url=(link to myhompage)):default)/STREAM(0-1519224369457000 (id=1111111111url=(link to myhompage)) aLevel=0)/COMP(1)/CAND-PAIR(9PJr): cancelling all pairs but 9PJr|IP4:192.168.1.151:52256/UDP|IP4:192.168.1.155:58107/UDP(host(IP4:192.168.1.151:52256/UDP)|candidate:0 1 UDP 2122252543 192.168.1.155 58107 typ host)
(ice/INFO) ICE-PEER(PC:222222222222222 (id=1111111111url=(link to myhompage)):default)/ICE-STREAM(0-1519224369457000 (id=1111111111url=(link to myhompage)) aLevel=0): all active components have nominated candidate pairs
(ice/INFO) ICE-PEER(PC:222222222222222 (id=1111111111url=(link to myhompage)):default): all checks completed success=1 fail=0
(stun/INFO) STUN-CLIENT(9PJr|IP4:192.168.1.151:52256/UDP|IP4:192.168.1.155:58107/UDP(host(IP4:192.168.1.151:52256/UDP)|candidate:0 1 UDP 2122252543 192.168.1.155 58107 typ host)): Received response; processing
(ice/INFO) ICE-PEER(PC:222222222222222 (id=1111111111url=(link to myhompage)):default)/CAND-PAIR(9PJr): setting pair to state SUCCEEDED: 9PJr|IP4:192.168.1.151:52256/UDP|IP4:192.168.1.155:58107/UDP(host(IP4:192.168.1.151:52256/UDP)|candidate:0 1 UDP 2122252543 192.168.1.155 58107 typ host)
(ice/ERR) ICE(PC:222222222222222 (id=1111111111url=(link to myhompage))): peer (PC:222222222222222 (id=1111111111url=(link to myhompage)):default), stream(0-1519224369457000 (id=1111111111url=(link to myhompage)) aLevel=0) tried to trickle ICE in inappropriate state 4

如果有人能帮助我,将不胜感激。谢谢。

本问答源自:https://stackoverflow.com/questions/48909643/coturn-webrtc-issue-on-azure-vm-ubuntu-server-16-04-lts

我怀疑你的部分配置未在CoTurn服务器上设置。我要告诉你的是我的配置,这个配置对我有用。我也使用Ubuntu Server 16.04 LTS(Digital Ocean)。你可能首先要删除你的CoTurn服务器(最好获取一个新的Droplet),然后重新安装它:

sudo apt-get update
sudo apt-get install coturn

接下来,编辑sudo vi /etc/turnserver.conf 并将其更改为以下选项(删除所有其他设置):

fingerprint
lt-cred-mech
realm=ip-of-your-server-accessible-from-outside
listening-ip=ip-of-your-server-accessible-from-outside
user=test:test

接下来,编辑sudo vi /etc/default/coturn并将其更改为以下选项(删除所有其他设置):

TURNSERVER_ENABLED=1

Ubuntu上的防火墙可能会阻止进入的连接。配置服务器以允许端口3478上的传入的STUN / TURN连接。如果使用UFW,命令为:

sudo ufw allow 3478

重新启动你的Ubuntu服务器。重新启动后,请确保你的turnserver正在运行:

turnserver -o

再次重启Ubuntu后,turnserver就不再运行了。要解决这个问题,你可能需要turnserver成为系统服务。
在你的应用中,你需要添加以下内容:

peerConnectionConfig = {
    'iceServers': [
      { 'urls': 'stun:ip-of-your-server:3478' },
      { 'urls': 'turn:ip-of-your-server:3478', 'username': 'test', 'credential': 'test' }
    ]
  };
peerConnection = new RTCPeerConnection(peerConnectionConfig);

在Firefox的两个标签中运行WebRTC应用程序,它们将在同一LAN中建立连接。因为你的应用现在不会使用STUN或TURN,我们可以确定该应用不会出现问题

现在进行相同的测试,但要强制Firefox使用TURN服务器或replay。打开一个新标签,然后输入about:config。搜索media.peerconnection.ice.relay_only 并将其设置为 true。此时Firefox只使用TURN中继。如果你的WebRTC应用程序现在可以使用,就可以确人你的TURN服务器处于良好的运行状态。