0

我下载了 ice4j 并在互联网上的两台机器上尝试 Icedistributed 示例(https://github.com/jitsi/ice4j/blob/master/src/test/java/test/IceDistributed.java )。如果我在局域网中的两台不同的机器上运行这个例子,这个例子可以工作,但不知何故它不能在互联网上工作。

下面是日志

=================== feed the following to the remote agent ===================
v=0
o=ice4j.org 0 0 IN null null
s=-
t=0 0
a=ice-options:trickle
a=ice-ufrag:65v2u1agade6hl
a=ice-pwd:5vlei70a43movu2t77fkhpqfa3
m=audio 49249 RTP/AVP 0
c=IN 125.19.34.60 IP4
a=mid:audio
a=candidate:1 1 udp 2130706431 10.64.16.51 2020 typ host
a=candidate:2 1 udp 2130706431 fe80:0:0:0:50e7:235d:e94a:9977 2020 typ host
a=candidate:4 1 udp 2113937151 fe80:0:0:0:c9d0:ed0d:557e:68af 2020 typ host
a=candidate:6 1 udp 2113937151 fe80:0:0:0:c811:49cc:8301:b637 2020 typ host
a=candidate:3 1 udp 2113932031 192.168.88.1 2020 typ host
a=candidate:5 1 udp 2113932031 192.168.31.1 2020 typ host
a=candidate:7 1 udp 1677724415 125.19.34.60 49249 typ srflx raddr 10.64.16.51 rport 2020
a=candidate:1 2 udp 2130706430 10.64.16.51 2021 typ host
a=candidate:2 2 udp 2130706430 fe80:0:0:0:50e7:235d:e94a:9977 2021 typ host
a=candidate:4 2 udp 2113937150 fe80:0:0:0:c9d0:ed0d:557e:68af 2021 typ host
a=candidate:6 2 udp 2113937150 fe80:0:0:0:c811:49cc:8301:b637 2021 typ host
a=candidate:3 2 udp 2113932030 192.168.88.1 2021 typ host
a=candidate:5 2 udp 2113932030 192.168.31.1 2021 typ host
a=candidate:7 2 udp 1677724414 125.19.34.60 49259 typ srflx raddr 10.64.16.51 rport 2021
a=rtcp:49259
m=video 49261 RTP/AVP 0
c=IN 125.19.34.60 IP4
a=mid:video
a=candidate:1 1 udp 2130706431 10.64.16.51 2022 typ host
a=candidate:2 1 udp 2130706431 fe80:0:0:0:50e7:235d:e94a:9977 2022 typ host
a=candidate:4 1 udp 2113937151 fe80:0:0:0:c9d0:ed0d:557e:68af 2022 typ host
a=candidate:6 1 udp 2113937151 fe80:0:0:0:c811:49cc:8301:b637 2022 typ host
a=candidate:3 1 udp 2113932031 192.168.88.1 2022 typ host
a=candidate:5 1 udp 2113932031 192.168.31.1 2022 typ host
a=candidate:7 1 udp 1677724415 125.19.34.60 49261 typ srflx raddr 10.64.16.51 rport 2022
a=candidate:1 2 udp 2130706430 10.64.16.51 2023 typ host
a=candidate:2 2 udp 2130706430 fe80:0:0:0:50e7:235d:e94a:9977 2023 typ host
a=candidate:4 2 udp 2113937150 fe80:0:0:0:c9d0:ed0d:557e:68af 2023 typ host
a=candidate:6 2 udp 2113937150 fe80:0:0:0:c811:49cc:8301:b637 2023 typ host
a=candidate:3 2 udp 2113932030 192.168.88.1 2023 typ host
a=candidate:5 2 udp 2113932030 192.168.31.1 2023 typ host
a=candidate:7 2 udp 1677724414 125.19.34.60 49267 typ srflx raddr 10.64.16.51 rport 2023
a=rtcp:49267

==============================================================================

Paste remote SDP here. Enter an empty line to proceed:
(we don't mind the [java] prefix in SDP intput)
v=0
o=ice4j.org 0 0 IN null null
s=-
t=0 0
a=ice-options:trickle
a=ice-ufrag:3u54r1agac2sf4
a=ice-pwd:6u1paracg9t86itirv30mk6fvg
m=audio 2020 RTP/AVP 0
c=IN 111.93.62.26 IP4
a=mid:audio
a=candidate:1 1 udp 2130706431 192.168.10.151 2020 typ host
a=candidate:2 1 udp 2130706431 fe80:0:0:0:7521:ed11:4f2b:c6fb 2020 typ host
a=candidate:3 1 udp 1677724415 111.93.62.26 2020 typ srflx raddr 192.168.10.151
rport 2020
a=candidate:1 2 udp 2130706430 192.168.10.151 2021 typ host
a=candidate:2 2 udp 2130706430 fe80:0:0:0:7521:ed11:4f2b:c6fb 2021 typ host
a=candidate:3 2 udp 1677724414 111.93.62.26 2021 typ srflx raddr 192.168.10.151
rport 2021
m=video 2022 RTP/AVP 0
c=IN 111.93.62.26 IP4
a=mid:video
a=candidate:1 1 udp 2130706431 192.168.10.151 2022 typ host
a=candidate:2 1 udp 2130706431 fe80:0:0:0:7521:ed11:4f2b:c6fb 2022 typ host
a=candidate:3 1 udp 1677724415 111.93.62.26 2022 typ srflx raddr 192.168.10.151
rport 2022
a=candidate:1 2 udp 2130706430 192.168.10.151 2023 typ host
a=candidate:2 2 udp 2130706430 fe80:0:0:0:7521:ed11:4f2b:c6fb 2023 typ host
a=candidate:3 2 udp 1677724414 111.93.62.26 2023 typ srflx raddr 192.168.10.151
rport 2023

Apr 14, 2016 6:33:32 PM org.ice4j.ice.Component addRemoteCandidate
INFO: Add remote candidate for audio.RTP: 192.168.10.151:2020/udp/host
Apr 14, 2016 6:33:32 PM org.ice4j.ice.Component addRemoteCandidate
INFO: Add remote candidate for audio.RTP: [fe80:0:0:0:7521:ed11:4f2b:c6fb]:2020/udp/host
Apr 14, 2016 6:33:32 PM org.ice4j.ice.Component addRemoteCandidate
INFO: Add remote candidate for audio.RTP: 111.93.62.26:2020/udp/srflx
Apr 14, 2016 6:33:32 PM org.ice4j.ice.Component addRemoteCandidate
INFO: Add remote candidate for audio.RTCP: 192.168.10.151:2021/udp/host
Apr 14, 2016 6:33:32 PM org.ice4j.ice.Component addRemoteCandidate
INFO: Add remote candidate for audio.RTCP: [fe80:0:0:0:7521:ed11:4f2b:c6fb]:2021/udp/host
Apr 14, 2016 6:33:32 PM org.ice4j.ice.Component addRemoteCandidate
INFO: Add remote candidate for audio.RTCP: 111.93.62.26:2021/udp/srflx
Apr 14, 2016 6:33:35 PM org.ice4j.ice.Component addRemoteCandidate
INFO: Add remote candidate for video.RTP: 192.168.10.151:2022/udp/host
Apr 14, 2016 6:33:35 PM org.ice4j.ice.Component addRemoteCandidate
INFO: Add remote candidate for video.RTP: [fe80:0:0:0:7521:ed11:4f2b:c6fb]:2022/udp/host
Apr 14, 2016 6:33:35 PM org.ice4j.ice.Component addRemoteCandidate
INFO: Add remote candidate for video.RTP: 111.93.62.26:2022/udp/srflx
Apr 14, 2016 6:33:35 PM org.ice4j.ice.Component addRemoteCandidate
INFO: Add remote candidate for video.RTCP: 192.168.10.151:2023/udp/host
Apr 14, 2016 6:33:35 PM org.ice4j.ice.Component addRemoteCandidate
INFO: Add remote candidate for video.RTCP: [fe80:0:0:0:7521:ed11:4f2b:c6fb]:2023/udp/host
Apr 14, 2016 6:33:35 PM org.ice4j.ice.Component addRemoteCandidate
INFO: Add remote candidate for video.RTCP: 111.93.62.26:2023/udp/srflx
Apr 14, 2016 6:33:35 PM org.ice4j.ice.Agent startConnectivityEstablishment
INFO: Start ICE connectivity establishment
Apr 14, 2016 6:33:35 PM org.ice4j.ice.Agent initCheckLists
INFO: Init checklist for stream audio
Apr 14, 2016 6:33:35 PM org.ice4j.ice.Agent initCheckLists
INFO: Init checklist for stream video
Apr 14, 2016 6:33:35 PM org.ice4j.ice.Agent setState
INFO: ICE state changed from Waiting to Running
Apr 14, 2016 6:33:35 PM com.ice4j.test.IceDemoPropertyChangeListener propertyChange
INFO: Agent entered the Running state.
Apr 14, 2016 6:33:35 PM org.ice4j.ice.ConnectivityCheckClient startChecks
INFO: Start connectivity checks!
Apr 14, 2016 6:33:36 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: 10.64.16.51:2020/udp/host -> 192.168.10.151:2020/udp/host (audio.RTP), failing.
Apr 14, 2016 6:33:36 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: [fe80:0:0:0:50e7:235d:e94a:9977]:2020/udp/host -> [fe80:0:0:0:7521:ed11:4f2b:c6fb]:2020/udp/host (audio.RTP), failing.
Apr 14, 2016 6:33:36 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: [fe80:0:0:0:c9d0:ed0d:557e:68af]:2020/udp/host -> [fe80:0:0:0:7521:ed11:4f2b:c6fb]:2020/udp/host (audio.RTP), failing.
Apr 14, 2016 6:33:36 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: [fe80:0:0:0:c811:49cc:8301:b637]:2020/udp/host -> [fe80:0:0:0:7521:ed11:4f2b:c6fb]:2020/udp/host (audio.RTP), failing.
Apr 14, 2016 6:33:36 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: 192.168.88.1:2020/udp/host -> 192.168.10.151:2020/udp/host (audio.RTP), failing.
Apr 14, 2016 6:33:36 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: 192.168.31.1:2020/udp/host -> 192.168.10.151:2020/udp/host (audio.RTP), failing.
Apr 14, 2016 6:33:36 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: 10.64.16.51:2020/udp/host -> 111.93.62.26:2020/udp/srflx (audio.RTP), failing.
Apr 14, 2016 6:33:36 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: 192.168.88.1:2020/udp/host -> 111.93.62.26:2020/udp/srflx (audio.RTP), failing.
Apr 14, 2016 6:33:36 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: 192.168.31.1:2020/udp/host -> 111.93.62.26:2020/udp/srflx (audio.RTP), failing.
Apr 14, 2016 6:33:36 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: 10.64.16.51:2021/udp/host -> 192.168.10.151:2021/udp/host (audio.RTCP), failing.
Apr 14, 2016 6:33:36 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: [fe80:0:0:0:50e7:235d:e94a:9977]:2021/udp/host -> [fe80:0:0:0:7521:ed11:4f2b:c6fb]:2021/udp/host (audio.RTCP), failing.
Apr 14, 2016 6:33:36 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: [fe80:0:0:0:c9d0:ed0d:557e:68af]:2021/udp/host -> [fe80:0:0:0:7521:ed11:4f2b:c6fb]:2021/udp/host (audio.RTCP), failing.
Apr 14, 2016 6:33:36 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: [fe80:0:0:0:c811:49cc:8301:b637]:2021/udp/host -> [fe80:0:0:0:7521:ed11:4f2b:c6fb]:2021/udp/host (audio.RTCP), failing.
Apr 14, 2016 6:33:36 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: 192.168.88.1:2021/udp/host -> 192.168.10.151:2021/udp/host (audio.RTCP), failing.
Apr 14, 2016 6:33:36 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: 192.168.31.1:2021/udp/host -> 192.168.10.151:2021/udp/host (audio.RTCP), failing.
Apr 14, 2016 6:33:36 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: 10.64.16.51:2021/udp/host -> 111.93.62.26:2021/udp/srflx (audio.RTCP), failing.
Apr 14, 2016 6:33:36 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: 192.168.88.1:2021/udp/host -> 111.93.62.26:2021/udp/srflx (audio.RTCP), failing.
Apr 14, 2016 6:33:36 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: 192.168.31.1:2021/udp/host -> 111.93.62.26:2021/udp/srflx (audio.RTCP), failing.
Apr 14, 2016 6:33:36 PM org.ice4j.ice.ConnectivityCheckClient updateCheckListAndTimerStates
INFO: CheckList will failed in a few seconds if nosucceeded checks come
Apr 14, 2016 6:33:37 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: 10.64.16.51:2022/udp/host -> 192.168.10.151:2022/udp/host (video.RTP), failing.
Apr 14, 2016 6:33:37 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: [fe80:0:0:0:50e7:235d:e94a:9977]:2022/udp/host -> [fe80:0:0:0:7521:ed11:4f2b:c6fb]:2022/udp/host (video.RTP), failing.
Apr 14, 2016 6:33:37 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: [fe80:0:0:0:c9d0:ed0d:557e:68af]:2022/udp/host -> [fe80:0:0:0:7521:ed11:4f2b:c6fb]:2022/udp/host (video.RTP), failing.
Apr 14, 2016 6:33:37 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: [fe80:0:0:0:c811:49cc:8301:b637]:2022/udp/host -> [fe80:0:0:0:7521:ed11:4f2b:c6fb]:2022/udp/host (video.RTP), failing.
Apr 14, 2016 6:33:37 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: 192.168.88.1:2022/udp/host -> 192.168.10.151:2022/udp/host (video.RTP), failing.
Apr 14, 2016 6:33:37 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: 192.168.31.1:2022/udp/host -> 192.168.10.151:2022/udp/host (video.RTP), failing.
Apr 14, 2016 6:33:37 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: 10.64.16.51:2022/udp/host -> 111.93.62.26:2022/udp/srflx (video.RTP), failing.
Apr 14, 2016 6:33:37 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: 192.168.88.1:2022/udp/host -> 111.93.62.26:2022/udp/srflx (video.RTP), failing.
Apr 14, 2016 6:33:37 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: 192.168.31.1:2022/udp/host -> 111.93.62.26:2022/udp/srflx (video.RTP), failing.
Apr 14, 2016 6:33:37 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: 10.64.16.51:2023/udp/host -> 192.168.10.151:2023/udp/host (video.RTCP), failing.
Apr 14, 2016 6:33:37 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: [fe80:0:0:0:50e7:235d:e94a:9977]:2023/udp/host -> [fe80:0:0:0:7521:ed11:4f2b:c6fb]:2023/udp/host (video.RTCP), failing.
Apr 14, 2016 6:33:37 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: [fe80:0:0:0:c9d0:ed0d:557e:68af]:2023/udp/host -> [fe80:0:0:0:7521:ed11:4f2b:c6fb]:2023/udp/host (video.RTCP), failing.
Apr 14, 2016 6:33:37 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: [fe80:0:0:0:c811:49cc:8301:b637]:2023/udp/host -> [fe80:0:0:0:7521:ed11:4f2b:c6fb]:2023/udp/host (video.RTCP), failing.
Apr 14, 2016 6:33:38 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: 192.168.88.1:2023/udp/host -> 192.168.10.151:2023/udp/host (video.RTCP), failing.
Apr 14, 2016 6:33:38 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: 192.168.31.1:2023/udp/host -> 192.168.10.151:2023/udp/host (video.RTCP), failing.
Apr 14, 2016 6:33:38 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: 10.64.16.51:2023/udp/host -> 111.93.62.26:2023/udp/srflx (video.RTCP), failing.
Apr 14, 2016 6:33:38 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: 192.168.88.1:2023/udp/host -> 111.93.62.26:2023/udp/srflx (video.RTCP), failing.
Apr 14, 2016 6:33:38 PM org.ice4j.ice.ConnectivityCheckClient processTimeout
INFO: timeout for pair: 192.168.31.1:2023/udp/host -> 111.93.62.26:2023/udp/srflx (video.RTCP), failing.
Apr 14, 2016 6:33:38 PM org.ice4j.ice.ConnectivityCheckClient updateCheckListAndTimerStates
INFO: CheckList will failed in a few seconds if nosucceeded checks come
Apr 14, 2016 6:33:41 PM org.ice4j.ice.ConnectivityCheckClient$1 run
INFO: CheckList for stream audio FAILED
Apr 14, 2016 6:33:43 PM org.ice4j.ice.ConnectivityCheckClient$1 run
INFO: CheckList for stream video FAILED
Apr 14, 2016 6:33:43 PM org.ice4j.ice.Agent checkListStatesUpdated
INFO: ICE state is FAILED
Apr 14, 2016 6:33:43 PM org.ice4j.ice.Agent setState
INFO: ICE state changed from Running to Failed
Apr 14, 2016 6:33:43 PM com.ice4j.test.IceDemoPropertyChangeListener propertyChange
INFO: Agent entered the Failed state.
Apr 14, 2016 6:33:43 PM com.ice4j.test.IceDemoPropertyChangeListener propertyChange
INFO: Total ICE processing time: 491243

我无法理解原因,因为如果我看到日志,它会以某种方式显示公共 IP 地址及其绑定端口,但不知何故,与该 sdp 信息的连接不成功。任何帮助将不胜感激...

4

1 回答 1

0

该问题与托管在另一台机器上的代理有关。当我从代码打开服务器时,它工作正常。无论如何,NAT 后面的所有主机都无法 100% 地工作,而这也发生在我身上,也发生在 Internet 上另一个网络的 NAT 后面的主机中。启用转弯有效。

于 2016-04-20T12:04:50.943 回答