ICE4J gets only local IP

358 views Asked by At

I have it connecting over the local intranet fine, but of course the point is outside of my router and I am having issues. I don't think I see public IP addresses in the list is the issue.

SDP information generated by https://github.com/opentelecoms-org/ice4j/blob/master/test/test/SdpUtils.java My SDP information is as follows (10.0.0.2 is local):

v=0
o=ice4j.org 0 0 IN IP4 10.0.0.2
s=-
t=0 0
a=ice-options:trickle
a=ice-ufrag:p73m19hsdn0p1
a=ice-pwd:7ncie1rvhplre9k0glhfkdqh8i
m=video 6032 RTP/AVP 0
c=IN 10.0.0.2 IP4
a=mid:video
a=candidate:1 1 udp 2130706431 fe80::fa8f:caff:fe12:da20 6032 typ host
a=candidate:2 1 udp 2130706431 10.0.0.2 6032 typ host
a=candidate:1 2 udp 2130706430 fe80::fa8f:caff:fe12:da20 6033 typ host
a=candidate:2 2 udp 2130706430 10.0.0.2 6033 typ host
m=audio 6034 RTP/AVP 0
c=IN 10.0.0.2 IP4
a=mid:audio
a=candidate:1 1 udp 2130706431 fe80::fa8f:caff:fe12:da20 6034 typ host
a=candidate:2 1 udp 2130706431 10.0.0.2 6034 typ host
a=candidate:1 2 udp 2130706430 fe80::fa8f:caff:fe12:da20 6035 typ host
a=candidate:2 2 udp 2130706430 10.0.0.2 6035 typ host

My code each stream I add a harvester (not sure if that is right):

public void createStream( String name ) throws BindException, IllegalArgumentException, IOException {
        IceMediaStream stream = agent.createMediaStream(name);
        int rtpPort = getStreamPort();
        Thread t = new Thread(){
            @Override
            public void run(){
                StunCandidateHarvester stunHarv = new StunCandidateHarvester(
                        new TransportAddress("sip-communicator.net",
                                rtpPort, Transport.UDP));
                StunCandidateHarvester stun6Harv = new StunCandidateHarvester(
                        new TransportAddress("ipv6.sip-communicator.net",
                                rtpPort, Transport.UDP));
                agent.addCandidateHarvester(stunHarv);
                agent.addCandidateHarvester(stun6Harv);
                String[] hostnames = new String[] { 
                        "jitsi.org",
                        "numb.viagenie.ca",
                        "stun01.sipphone.com",
                        "stun.ekiga.net",
                        "stun.fwdnet.net",
                        "stun.ideasip.com",
                        "stun.iptel.org",
                        "stun.rixtelecom.se",
                        "stun.schlund.de",
                        "stun.l.google.com:19302",
                        "stun1.l.google.com:19302",
                        "stun2.l.google.com:19302",
                        "stun3.l.google.com:19302",
                        "stun4.l.google.com:19302",
                        "stunserver.org",
                        "stun.softjoys.com",
                        "stun.voiparound.com",
                        "stun.voipbuster.com",
                        "stun.voipstunt.com",
                        "stun.voxgratia.org",
                        "stun.xten.com",};

                LongTermCredential longTermCredential = new LongTermCredential("guest", "anon");

                for (String hostname : hostnames)
                    agent.addCandidateHarvester(new TurnCandidateHarvester(new TransportAddress(hostname, rtpPort, Transport.UDP), longTermCredential));
            }
        };
        t.start();
        agent.createComponent(stream, Transport.UDP, rtpPort, rtpPort, rtpPort+100);
        agent.createComponent(stream, Transport.UDP, rtpPort+1, rtpPort+1, rtpPort+101);

    }

Any thoughts? Why do I only get Local IP addresses??

0

There are 0 answers