diff --git a/jingle/extension/source/org/jivesoftware/smackx/jingle/IncomingJingleSession.java b/jingle/extension/source/org/jivesoftware/smackx/jingle/IncomingJingleSession.java index 6fd70d6eb..6f51b210f 100644 --- a/jingle/extension/source/org/jivesoftware/smackx/jingle/IncomingJingleSession.java +++ b/jingle/extension/source/org/jivesoftware/smackx/jingle/IncomingJingleSession.java @@ -143,7 +143,6 @@ public class IncomingJingleSession extends JingleSession { public void start(JingleSessionRequest initialJingleSessionRequest) throws XMPPException { if (invalidState()) { Jingle packet = initialJingleSessionRequest.getJingle(); - System.out.println("invalidState"); if (packet != null) { // Initialize the session information @@ -226,6 +225,16 @@ public class IncomingJingleSession extends JingleSession { triggerSessionClosedOnError(new JingleException(iq.getError().getMessage())); super.eventError(iq); } + + /** + * Terminate the connection. + * + * @see org.jivesoftware.smackx.jingle.JingleNegotiator.State#eventTerminate(org.jivesoftware.smackx.packet.Jingle) + */ + public Jingle eventTerminate(Jingle jin) throws XMPPException { + triggerSessionClosed("Closed Remotely"); + return super.eventTerminate(jin); + } } /** @@ -273,7 +282,6 @@ public class IncomingJingleSession extends JingleSession { */ public void eventEnter() { // Add the listeners to the sub-negotiators... - System.out.println("Pending eventEnter"); addMediaListener(jingleMediaListener); addTransportListener(jingleTransportListener); super.eventEnter(); @@ -374,6 +382,16 @@ public class IncomingJingleSession extends JingleSession { triggerSessionClosedOnError(new XMPPException(iq.getError())); super.eventError(iq); } + + /** + * Terminate the connection. + * + * @see org.jivesoftware.smackx.jingle.JingleNegotiator.State#eventTerminate(org.jivesoftware.smackx.packet.Jingle) + */ + public Jingle eventTerminate(Jingle jin) throws XMPPException { + triggerSessionClosed("Closed Remotely"); + return super.eventTerminate(jin); + } } /** @@ -398,7 +416,6 @@ public class IncomingJingleSession extends JingleSession { .getAcceptedLocalCandidate(); // Trigger the session established flag - System.out.println("eventEntered"); triggerSessionEstablished(bestCommonAudioPt, bestRemoteCandidate, acceptedLocalCandidate); diff --git a/jingle/extension/source/org/jivesoftware/smackx/jingle/JingleSession.java b/jingle/extension/source/org/jivesoftware/smackx/jingle/JingleSession.java index 10abb74f6..2b4e87965 100644 --- a/jingle/extension/source/org/jivesoftware/smackx/jingle/JingleSession.java +++ b/jingle/extension/source/org/jivesoftware/smackx/jingle/JingleSession.java @@ -426,9 +426,6 @@ public abstract class JingleSession extends JingleNegotiator { jout = getState().eventRedirect(jin); } else if (action.equals(Jingle.Action.SESSIONTERMINATE)) { - - System.out.println("SESSION PACKET"); - jout = getState().eventTerminate(jin); } } @@ -766,11 +763,9 @@ public abstract class JingleSession extends JingleNegotiator { return true; } if (obj == null) { - System.out.println("NULL"); return false; } if (getClass() != obj.getClass()) { - System.out.println("CLASS DIFF"); return false; } @@ -885,6 +880,7 @@ public abstract class JingleSession extends JingleNegotiator { protected void removePacketListener() { if (packetListener != null) { getConnection().removePacketListener(packetListener); + System.out.println("REMOVE PACKET LISTENER"); } } @@ -962,7 +958,6 @@ public abstract class JingleSession extends JingleNegotiator { }; getConnection().addPacketListener(packetListener, packetFilter); - System.out.println("updatePacketListener"); } // Listeners diff --git a/jingle/extension/source/org/jivesoftware/smackx/jingle/OutgoingJingleSession.java b/jingle/extension/source/org/jivesoftware/smackx/jingle/OutgoingJingleSession.java index 44061aed1..73684f107 100644 --- a/jingle/extension/source/org/jivesoftware/smackx/jingle/OutgoingJingleSession.java +++ b/jingle/extension/source/org/jivesoftware/smackx/jingle/OutgoingJingleSession.java @@ -73,7 +73,7 @@ import java.util.List; /** * An outgoing Jingle session implementation. * This class has especific bahavior to Request and establish a new Jingle Session. - * + *
* This class is not directly used by users. Instead, users should refer to the * JingleManager class, that will create the appropiate instance... * @@ -98,7 +98,7 @@ public class OutgoingJingleSession extends JingleSession { * @param resolver The transport resolver. */ protected OutgoingJingleSession(XMPPConnection conn, String responder, - List payloadTypes, TransportResolver resolver) { + List payloadTypes, TransportResolver resolver) { super(conn, conn.getUser(), responder); @@ -129,7 +129,7 @@ public class OutgoingJingleSession extends JingleSession { * @param jingleMediaManager The Media Manager for this Session */ protected OutgoingJingleSession(XMPPConnection conn, String responder, - List payloadTypes, TransportResolver resolver, JingleMediaManager jingleMediaManager) { + List payloadTypes, TransportResolver resolver, JingleMediaManager jingleMediaManager) { this(conn, responder, payloadTypes, resolver); this.jingleMediaManager = jingleMediaManager; } @@ -150,11 +150,13 @@ public class OutgoingJingleSession extends JingleSession { try { updatePacketListener(); respond((Jingle) null); - } catch (XMPPException e) { + } + catch (XMPPException e) { e.printStackTrace(); close(); } - } else { + } + else { throw new IllegalStateException("Starting session without null state."); } } @@ -223,6 +225,16 @@ public class OutgoingJingleSession extends JingleSession { triggerSessionRedirect(redirArg); return null; } + + /** + * Terminate the connection. + * + * @see org.jivesoftware.smackx.jingle.JingleNegotiator.State#eventTerminate(org.jivesoftware.smackx.packet.Jingle) + */ + public Jingle eventTerminate(Jingle jin) throws XMPPException { + triggerSessionClosed("Closed Remotely"); + return super.eventTerminate(jin); + } } /** @@ -232,6 +244,7 @@ public class OutgoingJingleSession extends JingleSession { * Note: the transition from/to this state is done with listeners... */ public class Pending extends JingleNegotiator.State { + JingleMediaListener jingleMediaListener; JingleTransportListener jingleTransportListener; @@ -252,7 +265,7 @@ public class OutgoingJingleSession extends JingleSession { jingleTransportListener = new JingleTransportListener() { public void transportEstablished(TransportCandidate local, - TransportCandidate remote) { + TransportCandidate remote) { checkFullyEstablished(); } @@ -338,7 +351,8 @@ public class OutgoingJingleSession extends JingleSession { .getAcceptedLocalCandidate())) { setState(active); } - } else { + } + else { throw new JingleException(JingleError.NEGOTIATION_ERROR); } } @@ -374,7 +388,7 @@ public class OutgoingJingleSession extends JingleSession { * @throws XMPPException */ public Jingle eventTerminate(Jingle jin) throws XMPPException { - triggerSessionDeclined(null); + triggerSessionClosed("Closed Remotely"); return super.eventTerminate(jin); } @@ -393,6 +407,7 @@ public class OutgoingJingleSession extends JingleSession { * State when we have an established session. */ public class Active extends JingleNegotiator.State { + public Active(JingleNegotiator neg) { super(neg); } @@ -410,7 +425,6 @@ public class OutgoingJingleSession extends JingleSession { .getAcceptedLocalCandidate(); // Trigger the session established flag - System.out.println("eventEntered"); triggerSessionEstablished(bestCommonAudioPt, bestRemoteCandidate, acceptedLocalCandidate); diff --git a/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/FixedResolver.java b/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/FixedResolver.java index 0bae13aaa..78479c04b 100644 --- a/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/FixedResolver.java +++ b/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/FixedResolver.java @@ -28,7 +28,6 @@ public class FixedResolver extends TransportResolver { * @param port a port */ public void setFixedCandidate(String ip, int port) { - System.out.println("FIXED"); fixedCandidate = new TransportCandidate.Fixed(ip, port); } diff --git a/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/RTPBridge.java b/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/RTPBridge.java index fa85f3d6c..22a9a0b4d 100644 --- a/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/RTPBridge.java +++ b/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/RTPBridge.java @@ -400,7 +400,7 @@ public class RTPBridge extends IQ { return false; } - System.out.println("service listing"); + System.out.println("Service listing"); ServiceDiscoveryManager disco = ServiceDiscoveryManager .getInstanceFor(xmppConnection); 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 c6afe92d3..728fc8a82 100644 --- a/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/TransportNegotiator.java +++ b/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/TransportNegotiator.java @@ -207,7 +207,6 @@ public abstract class TransportNegotiator extends JingleNegotiator { * @param offeredCandidate a transport candidates to check */ private void checkRemoteCandidate(final TransportCandidate offeredCandidate) { - System.out.println("CHECK"); offeredCandidate.addListener(new TransportResolverListener.Checker() { public void candidateChecked(TransportCandidate cand, final boolean validCandidate) { @@ -336,7 +335,6 @@ public abstract class TransportNegotiator extends JingleNegotiator { */ private void addRemoteCandidates(List rc) { if (rc != null) { - System.out.println("SIZE OF LISTA: " + rc.size()); if (rc.size() > 0) { for (Object aRc : rc) { addRemoteCandidate((TransportCandidate) aRc); @@ -359,8 +357,6 @@ public abstract class TransportNegotiator extends JingleNegotiator { while (iTrans.hasNext()) { org.jivesoftware.smackx.packet.JingleTransport trans = (org.jivesoftware.smackx.packet.JingleTransport) iTrans.next(); - System.out.println("LISTA SIZE: " + trans.getCandidatesCount()); - Iterator iCand = trans.getCandidates(); while (iCand.hasNext()) { JingleTransportCandidate cand = (JingleTransportCandidate) iCand diff --git a/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/TransportResolver.java b/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/TransportResolver.java index 6490e802f..859981c98 100644 --- a/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/TransportResolver.java +++ b/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/TransportResolver.java @@ -316,7 +316,6 @@ public abstract class TransportResolver { */ public Iterator getCandidates() { synchronized (candidates) { - System.out.println("CNUM: " + candidates.size()); return Collections.unmodifiableList(new ArrayList(candidates)).iterator(); } }