From 9dd96de751e14b880ea968aafa771f1b6d7ab790 Mon Sep 17 00:00:00 2001 From: Emil Ivov Date: Sun, 14 Jan 2007 17:05:38 +0000 Subject: Configurable home name and location, properly store international characters in the metacontactlist, history, and configuration files. make the debian installer store bndles un ${user.home}/.sip-communicator instead of ${user.home}/.felix/sip-communicator.bin. related issues: 286, 266, 271, 230, 274 make sure we terminate transactions --- .../impl/protocol/sip/SipRegistrarConnection.java | 27 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/src/net/java/sip/communicator/impl/protocol/sip/SipRegistrarConnection.java b/src/net/java/sip/communicator/impl/protocol/sip/SipRegistrarConnection.java index a44a5a2..760e90a 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/SipRegistrarConnection.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/SipRegistrarConnection.java @@ -83,6 +83,12 @@ public class SipRegistrarConnection */ private long nextCSeqValue = 1; + /** + * The client transaction that we used for sending the last REGISTER + * request. + */ + ClientTransaction regTrans = null; + /** * Creates a new instance of this class. @@ -313,8 +319,8 @@ public class SipRegistrarConnection } request.addHeader(contactHeader); + //Transaction - ClientTransaction regTrans = null; try { sipProvider.getJainSipStack().getSipProviders(); @@ -470,6 +476,8 @@ public class SipRegistrarConnection "Could not find the initial register request." , OperationFailedException.INTERNAL_ERROR); } + + //We are apparently registered so send a un-Register request. Request unregisterRequest = (Request) registerRequest.clone(); try { @@ -537,8 +545,6 @@ public class SipRegistrarConnection } try { - - unregisterTransaction.sendRequest(); logger.debug("sent request: " + unregisterRequest); @@ -547,8 +553,19 @@ public class SipRegistrarConnection if(!getRegistrationState().equals(RegistrationState.REGISTERED)) { logger.trace("Setting state to UNREGISTERED."); - setRegistrationState(RegistrationState.UNREGISTERED, - RegistrationStateChangeEvent.REASON_USER_REQUEST, null); + setRegistrationState( + RegistrationState.UNREGISTERED + , RegistrationStateChangeEvent.REASON_USER_REQUEST, null); + + //kill the registration tran in case it is still active + if (regTrans != null + && regTrans.getState().getValue() + <= TransactionState.PROCEEDING.getValue()) + { + logger.trace("Will try to terminate reg tran ..."); + regTrans.terminate(); + logger.trace("Transaction terminated!"); + } } } catch (SipException ex) -- cgit v1.1