From b695257f766260b105ee4281680894d060f71d99 Mon Sep 17 00:00:00 2001 From: Thiago Camargo Date: Fri, 6 Apr 2007 16:43:22 +0000 Subject: [PATCH] [SPARK-651] - More Message Improvements git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@7910 b35dd754-fafc-0310-a699-88a17e54d16e --- .../jivesoftware/smackx/jingle/JingleSession.java | 13 +++++++++++-- .../smackx/jingle/nat/TransportNegotiator.java | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/jingle/extension/source/org/jivesoftware/smackx/jingle/JingleSession.java b/jingle/extension/source/org/jivesoftware/smackx/jingle/JingleSession.java index 3ba9dbbae..00b0d83a7 100644 --- a/jingle/extension/source/org/jivesoftware/smackx/jingle/JingleSession.java +++ b/jingle/extension/source/org/jivesoftware/smackx/jingle/JingleSession.java @@ -1154,17 +1154,26 @@ public abstract class JingleSession extends JingleNegotiator implements MediaRec public abstract void start(JingleSessionRequest jin) throws XMPPException; /** - * Terminate the session. + * Terminates the session with default reason. * * @throws XMPPException */ public void terminate() throws XMPPException { + terminate("Closed Locally"); + } + + /** + * Terminates the session with a custom reason. + * + * @throws XMPPException + */ + public void terminate(String reason) throws XMPPException { if (isClosed()) return; System.out.println("State: " + this.getState()); Jingle jout = new Jingle(Jingle.Action.SESSIONTERMINATE); jout.setType(IQ.Type.SET); sendFormattedJingle(jout); - triggerSessionClosed("Closed Locally"); + triggerSessionClosed(reason); } /** 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 d6232767c..a66b348ae 100644 --- a/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/TransportNegotiator.java +++ b/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/TransportNegotiator.java @@ -361,7 +361,7 @@ public abstract class TransportNegotiator extends JingleNegotiator { if (getState() == null || !getState().equals(active)) { try { - session.terminate(); + session.terminate("Unable to negotiate session. This may be caused by firewall configuration problems."); } catch (XMPPException e) { e.printStackTrace();