Coturn WebRTC issue on AZURE VM (Ubuntu Server 16.04 LTS)

强颜欢笑 提交于 2019-12-20 05:37:10

问题


I use webRTC to establish a web browser real-time communication with other browsers. To make sure this connection is always solid I want to set up my own STUN/TURN Server. I decided to use coturn on Azure VM (Ubuntu Server). I followed this documentation to set up coturn on Azure https://www.microsoft.com/developerblog/2018/01/29/orchestrating-turn-servers-cloud-deployment/ .

According to [Trickele ICE][1] [1]: https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/ my STUN sever works and I get positive results.

Whenever though I try to use my STUN/TURN server to establish a webcam connection it doesn't work.

webRTC protocol Session Statistic:

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 protocol Connection Log:

(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
+++++++ END ++++++++

If anyone could help me out, that would be much appreciated. Thanks.


回答1:


I suspect some of your configuration is not set right on your CoTurn server. I will give you my configuration that works for me. I also use Ubuntu Server 16.04 LTS (Digital Ocean). Delete your CoTurn server first (better take a fresh droplet), and reinstall it:

sudo apt-get update
sudo apt-get install coturn

Next, edit sudo vi /etc/turnserver.conf and change it to the following options (delete all other settings):

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

Next, edit sudo vi /etc/default/coturn and change it to the following options (delete all other settings):

TURNSERVER_ENABLED=1

Your firewall on Ubuntu may prevent incoming connections. Configure your server to allow incoming STUN / TURN connections on port 3478. In case you use UFW, the command is:

sudo ufw allow 3478

Reboot your Ubuntu server. After rebooting make sure your turnserver is running:

turnserver -o

After another reboot of your Ubuntu the turnserver is not running anymore. To get over this you may want the turnserver to be a system service.

In your app you need to add something like:

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

Run your WebRTC app in Firefox in two tabs where they make the connection within the same LAN. Because your app will now not use STUN or TURN we can be sure the app is not the problem

Now do the same test but force Firefox to use the TURN server or replay. Open a new tab and type about:config. Search for media.peerconnection.ice.relay_only and set it to true. At this moment Firefox only uses TURN relay. If your WebRTC app works now, you can be sure your TURN server is working great.



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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!