From 4a86390b17e04bd86409b02a4da0b0743e3c660b Mon Sep 17 00:00:00 2001 From: Thiago Camargo Date: Sun, 11 Mar 2007 01:28:44 +0000 Subject: [PATCH] Fixes and Fixes git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@7452 b35dd754-fafc-0310-a699-88a17e54d16e --- jingle/extension/build/merge/jstun.jar | Bin 76392 -> 76388 bytes .../smackx/jingle/IncomingJingleSession.java | 1 + .../smackx/jingle/JingleSession.java | 4 ++++ .../smackx/jingle/nat/ICECandidate.java | 6 ++++++ .../smackx/jingle/nat/TransportCandidate.java | 2 +- .../jingle/nat/TransportNegotiator.java | 17 ++++++++++------- .../smackx/jingle/JingleMediaTest.java | 2 +- 7 files changed, 23 insertions(+), 9 deletions(-) diff --git a/jingle/extension/build/merge/jstun.jar b/jingle/extension/build/merge/jstun.jar index f76af9cdd52a60bb94552e66f13c3a7be76202cd..80c237b639f0369a3f769f2fb1723c34e3dedeb6 100644 GIT binary patch delta 4567 zcmV;|5h(8H)CAvAuQq}EDr%mB1s@@nt*Hpi9(1FP{i%= z-beD_<-Pb87PYojTbF6AcIr&A%UH(_j#?F!M8&GDE$-GjV`p@#(~efVsI6_awpHx^ z-0#cF9)fkuk8{7foO91P_x#Vf_xa@E2Oa`2M-qN)$DM_U;(snB`<2|SN_oA+P zNxT1}aIO z<1M_clfTvO?{tTEl>A;z_=AN%D#N=L-t*y47T&k;XI=ak3x8GpKTz_ag~Q77ksmcG zutvoc2`mw9b1ccVB+rt3?G;$!v&6Eb&=S866j@?hGJnF7k(Lzez$i;fEE#Rd810R< zWSk|(PzxFFlVg1n5ER4`EiFz`Fk#L1(9TeGCLN7c>sU12QoY8^)p7f1C=y9Jsg&Rt zcU{~`S2vI>bH};HpGs%q8=T}$l{VU46$??yhIEp`xFWATkxUDuK`<&EZF3TtbVEFv z-V};u9DhMhTS!p8CgM~p>#k_^b`@A1N|SwSChb(O4YjvBk?sw1!epozf?-7~x9`c} zk0&BdBNsRks&ST}D3u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Y5zD zuTDh4D)XPfOu(b7lwB3uD`mPjnSOsQk2E}~SywdLE0RW}^dP=IKW*Auj zuh3zqEere=P)i30Lk)XY>JR_`GbfWCcO1860|D(21Jod7w^bAYPYVNGA7q!!C;=O{ z!XE*$2n}5yWHv($dsgZY001+WfhYlI0#5^%(J28JmjNjODguH7m(eK!7nejS0XG83 t3763+0T-9|2>}t82O0qom$fMY8Udr1&?x~=0m_#kDgizQN)!PA002i&$fN)O diff --git a/jingle/extension/source/org/jivesoftware/smackx/jingle/IncomingJingleSession.java b/jingle/extension/source/org/jivesoftware/smackx/jingle/IncomingJingleSession.java index b6dd0293b..b7b15cbaf 100644 --- a/jingle/extension/source/org/jivesoftware/smackx/jingle/IncomingJingleSession.java +++ b/jingle/extension/source/org/jivesoftware/smackx/jingle/IncomingJingleSession.java @@ -310,6 +310,7 @@ public class IncomingJingleSession extends JingleSession { .getBestCommonAudioPt(); TransportCandidate bestRemoteCandidate = getTransportNeg() .getBestRemoteCandidate(); + TransportCandidate acceptedLocalCandidate = getTransportNeg() .getAcceptedLocalCandidate(); diff --git a/jingle/extension/source/org/jivesoftware/smackx/jingle/JingleSession.java b/jingle/extension/source/org/jivesoftware/smackx/jingle/JingleSession.java index a64d07011..f3d9a73e8 100644 --- a/jingle/extension/source/org/jivesoftware/smackx/jingle/JingleSession.java +++ b/jingle/extension/source/org/jivesoftware/smackx/jingle/JingleSession.java @@ -1072,6 +1072,10 @@ public abstract class JingleSession extends JingleNegotiator { jingleMediaSession.startTrasmit(); jingleMediaSession.startReceive(); + + for (TransportCandidate candidate : this.getTransportNeg().getOfferedCandidates()) + candidate.removeCandidateEcho(); + } } diff --git a/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/ICECandidate.java b/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/ICECandidate.java index eb6c25252..051f1f5e5 100644 --- a/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/ICECandidate.java +++ b/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/ICECandidate.java @@ -257,6 +257,12 @@ public class ICECandidate extends TransportCandidate implements Comparable { // Media Proxy donīt have Echo features. // If its a relayed candidate we assumpt that is Checked. if (getType().equals("relay")) { + try { + Thread.sleep(TransportNegotiator.CANDIDATES_ACCEPT_PERIOD*2); + } + catch (InterruptedException e) { + // Do Nothing + } triggerCandidateChecked(true); return; } diff --git a/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/TransportCandidate.java b/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/TransportCandidate.java index a26aad856..b064c4dd2 100644 --- a/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/TransportCandidate.java +++ b/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/TransportCandidate.java @@ -668,7 +668,7 @@ public abstract class TransportCandidate { socket.receive(packet); - System.out.println("ECHO Packet Received in: " + socket.getLocalAddress().getHostAddress() + ":" + socket.getLocalPort() + " From: " + packet.getAddress().getHostAddress() + ":" + packet.getPort()); + //System.out.println("ECHO Packet Received in: " + socket.getLocalAddress().getHostAddress() + ":" + socket.getLocalPort() + " From: " + packet.getAddress().getHostAddress() + ":" + packet.getPort()); for (DatagramListener listener : listeners) { listener.datagramReceived(packet); diff --git a/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/TransportNegotiator.java b/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/TransportNegotiator.java index 688c0d9fa..50b980910 100644 --- a/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/TransportNegotiator.java +++ b/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/TransportNegotiator.java @@ -52,7 +52,7 @@ public abstract class TransportNegotiator extends JingleNegotiator { // The time we give to the candidates check before we accept or decline the // transport (in milliseconds) - private final static int CANDIDATES_ACCEPT_PERIOD = 3000; + public final static int CANDIDATES_ACCEPT_PERIOD = 3000; // The session this nenotiator belongs to private final JingleSession session; @@ -171,6 +171,10 @@ public abstract class TransportNegotiator extends JingleNegotiator { } + public List getOfferedCandidates() { + return offeredCandidates; + } + /** * Obtain the best common transport candidate obtained in the negotiation. * @@ -559,7 +563,7 @@ public abstract class TransportNegotiator extends JingleNegotiator { JingleListener li = (JingleListener) listener; if (li instanceof JingleTransportListener) { JingleTransportListener mli = (JingleTransportListener) li; - System.out.println("triggerTransportEstablished " + local.getLocalIp()); + System.out.println("triggerTransportEstablished " + local.getLocalIp() + ":" + local.getPort() + "|" + remote.getIp() + ":" + remote.getPort()); mli.transportEstablished(local, remote); } } @@ -748,11 +752,6 @@ public abstract class TransportNegotiator extends JingleNegotiator { */ public void eventEnter() { System.out.println("Transport stabilished"); - - for (TransportCandidate transportCandidate : offeredCandidates) - if (transportCandidate.getCandidateEcho() != null) - transportCandidate.removeCandidateEcho(); - triggerTransportEstablished(getAcceptedLocalCandidate(), getBestRemoteCandidate()); super.eventEnter(); @@ -807,6 +806,7 @@ public abstract class TransportNegotiator extends JingleNegotiator { // Hopefully, we only have one validRemoteCandidate ArrayList cands = getValidRemoteCandidatesList(); if (!cands.isEmpty()) { + System.out.println("RAW CAND"); return (TransportCandidate) cands.get(0); } else { @@ -872,6 +872,9 @@ public abstract class TransportNegotiator extends JingleNegotiator { result = chose; } + if (result != null && result.getType().equals("relay")) + System.out.println("Relay Type"); + return result; } diff --git a/jingle/extension/test/org/jivesoftware/smackx/jingle/JingleMediaTest.java b/jingle/extension/test/org/jivesoftware/smackx/jingle/JingleMediaTest.java index bf84d9e43..70f7d414b 100644 --- a/jingle/extension/test/org/jivesoftware/smackx/jingle/JingleMediaTest.java +++ b/jingle/extension/test/org/jivesoftware/smackx/jingle/JingleMediaTest.java @@ -96,7 +96,7 @@ public class JingleMediaTest extends SmackTestCase { js0.start(); - Thread.sleep(10000); + Thread.sleep(50000); js0.terminate(); jm1.removeJingleSessionRequestListener(jingleSessionRequestListener);