diff options
author | Emil Ivov <emcho@jitsi.org> | 2007-01-14 17:05:38 +0000 |
---|---|---|
committer | Emil Ivov <emcho@jitsi.org> | 2007-01-14 17:05:38 +0000 |
commit | 9dd96de751e14b880ea968aafa771f1b6d7ab790 (patch) | |
tree | 09cd060c3944d205b51eaaf33d5a6dbc8e71cbb7 | |
parent | e0d4977f17c8de4bcae7bdb87448ef161d9300eb (diff) | |
download | jitsi-9dd96de751e14b880ea968aafa771f1b6d7ab790.zip jitsi-9dd96de751e14b880ea968aafa771f1b6d7ab790.tar.gz jitsi-9dd96de751e14b880ea968aafa771f1b6d7ab790.tar.bz2 |
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
-rw-r--r-- | src/net/java/sip/communicator/impl/protocol/sip/SipRegistrarConnection.java | 27 |
1 files 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) |