jitsi / jitsi-videobridge

Jitsi Videobridge is a WebRTC compatible video router or SFU that lets build highly scalable video conferencing infrastructure (i.e., up to hundreds of conferences per server).
https://jitsi.org/jitsi-videobridge
Apache License 2.0
2.91k stars 992 forks source link

bridge use turnserver throw a exception. #244

Open new1943 opened 8 years ago

new1943 commented 8 years ago

because i want test the turn server. my birdge is behind nat. when i use single port. that birdge will throw a exception:

JVB 2016-05-18 02:33:07.431 INFO: [98] org.ice4j.ice.harvest.StunCandidateHarvest.sendRequest() Failed to send ALLOCATE-REQUEST(0x3)[attrib.count=3 len=32 tranID=0xBFE435C35401B907D20D3A63] through 192.168.2.200:10000/udp to 124.202.164.3:3478/udp java.lang.IllegalArgumentException: No socket found for 192.168.2.200:10000/udp->124.202.164.3:3478/udp at org.ice4j.stack.NetAccessManager.sendMessage(NetAccessManager.java:618) at org.ice4j.stack.NetAccessManager.sendMessage(NetAccessManager.java:568) at org.ice4j.stack.StunClientTransaction.sendRequest0(StunClientTransaction.java:394) at org.ice4j.stack.StunClientTransaction.sendRequest(StunClientTransaction.java:372) at org.ice4j.stack.StunStack.sendRequest(StunStack.java:689) at org.ice4j.stack.StunStack.sendRequest(StunStack.java:627) at org.ice4j.ice.harvest.StunCandidateHarvest.sendRequest(StunCandidateHarvest.java:1300) at org.ice4j.ice.harvest.StunCandidateHarvest.startResolvingCandidate(StunCandidateHarvest.java:1405) at org.ice4j.ice.harvest.StunCandidateHarvester.startResolvingCandidate(StunCandidateHarvester.java:336) at org.ice4j.ice.harvest.StunCandidateHarvester.harvest(StunCandidateHarvester.java:248) at org.ice4j.ice.harvest.CandidateHarvesterSetElement.harvest(CandidateHarvesterSetElement.java:86) at org.ice4j.ice.harvest.CandidateHarvesterSetTask.run(CandidateHarvesterSetTask.java:107) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) JVB 2016-05-18 02:33:07.440 INFO: [98] org.ice4j.ice.harvest.StunCandidateHarvester.startResolvingCandidate() Failed to start resolving host candidate candidate:2 1 udp 2130706431 192.168.2.200 10000 typ host org.ice4j.StunException: No socket found for 192.168.2.200:10000/udp->124.202.164.3:3478/udp at org.ice4j.ice.harvest.StunCandidateHarvest.sendRequest(StunCandidateHarvest.java:1321) at org.ice4j.ice.harvest.StunCandidateHarvest.startResolvingCandidate(StunCandidateHarvest.java:1405) at org.ice4j.ice.harvest.StunCandidateHarvester.startResolvingCandidate(StunCandidateHarvester.java:336) at org.ice4j.ice.harvest.StunCandidateHarvester.harvest(StunCandidateHarvester.java:248) at org.ice4j.ice.harvest.CandidateHarvesterSetElement.harvest(CandidateHarvesterSetElement.java:86) at org.ice4j.ice.harvest.CandidateHarvesterSetTask.run(CandidateHarvesterSetTask.java:107) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.IllegalArgumentException: No socket found for 192.168.2.200:10000/udp->124.202.164.3:3478/udp at org.ice4j.stack.NetAccessManager.sendMessage(NetAccessManager.java:618) at org.ice4j.stack.NetAccessManager.sendMessage(NetAccessManager.java:568) at org.ice4j.stack.StunClientTransaction.sendRequest0(StunClientTransaction.java:394) at org.ice4j.stack.StunClientTransaction.sendRequest(StunClientTransaction.java:372) at org.ice4j.stack.StunStack.sendRequest(StunStack.java:689) at org.ice4j.stack.StunStack.sendRequest(StunStack.java:627) at org.ice4j.ice.harvest.StunCandidateHarvest.sendRequest(StunCandidateHarvest.java:1300) ... 10 more

my birdge is 192.168.2.200 and my turn server is 124.202.164.3. i want fix this exception.if i close single port. that will be normal. so i don't know where to add that socket, why not create that socket.

new1943 commented 8 years ago

how config the turnserver ? i can't found the turnserver config in project. so i force write in IceUdpTransportManager class like this:

NetworkAddressManagerService nams = ServiceUtils.getService( getBundleContext(), NetworkAddressManagerService.class);

    Agent iceAgent = nams.createIceAgent();

    // TODO ZHENGLINGBING
    iceAgent.addCandidateHarvester(new TurnCandidateHarvester(new TransportAddress("124.202.164.3" , 3478 , Transport.UDP) , new LongTermCredential("lb" , "123456")));

    //add videobridge specific harvesters such as a mapping and an Amazon
    //AWS EC2 harvester
    appendVideobridgeHarvesters(iceAgent, rtcpmux);
    iceAgent.setControlling(controlling);
    iceAgent.setPerformConsentFreshness(true);

is it right? or must config other way?

new1943 commented 8 years ago

if i open the single port , the birdge will throw exception:

org.ice4j.StunException: No socket found for 192.168.2.32:10000/udp->124.202.164.3:3478/udp at org.ice4j.ice.harvest.StunCandidateHarvest.sendRequest(StunCandidateHarvest.java:1321) at org.ice4j.ice.harvest.StunCandidateHarvest.startResolvingCandidate(StunCandidateHarvest.java:1405) at org.ice4j.ice.harvest.StunCandidateHarvester.startResolvingCandidate(StunCandidateHarvester.java:336) at org.ice4j.ice.harvest.StunCandidateHarvester.harvest(StunCandidateHarvester.java:248) at org.ice4j.ice.harvest.CandidateHarvesterSetElement.harvest(CandidateHarvesterSetElement.java:86) at org.ice4j.ice.harvest.CandidateHarvesterSetTask.run(CandidateHarvesterSetTask.java:107) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.IllegalArgumentException: No socket found for 192.168.2.32:10000/udp->124.202.164.3:3478/udp at org.ice4j.stack.NetAccessManager.sendMessage(NetAccessManager.java:618) at org.ice4j.stack.NetAccessManager.sendMessage(NetAccessManager.java:568) at org.ice4j.stack.StunClientTransaction.sendRequest0(StunClientTransaction.java:394) at org.ice4j.stack.StunClientTransaction.sendRequest(StunClientTransaction.java:372) at org.ice4j.stack.StunStack.sendRequest(StunStack.java:689) at org.ice4j.stack.StunStack.sendRequest(StunStack.java:627) at org.ice4j.ice.harvest.StunCandidateHarvest.sendRequest(StunCandidateHarvest.java:1300) ... 10 more