if (method.equalsIgnoreCase(Request.INVITE)) {
this
.removeFromMergeTable((SIPServerTransaction) sipTransaction);
}
// Send a notification to the listener.
SipProviderImpl sipProvider = (SipProviderImpl) sipTransaction
.getSipProvider();
if (removed != null
&& sipTransaction.testAndSetTransactionTerminatedEvent()) {
TransactionTerminatedEvent event = new TransactionTerminatedEvent(
sipProvider, (ServerTransaction) sipTransaction);
sipProvider.handleEvent(event, sipTransaction);
}
} else {
String key = sipTransaction.getTransactionId();
Object removed = clientTransactionTable.remove(key);
if (stackLogger.isLoggingEnabled(LogWriter.TRACE_DEBUG)) {
stackLogger.logDebug("REMOVED client tx " + removed + " KEY = "
+ key);
}
if ( removed != null ) {
SIPClientTransaction clientTx = (SIPClientTransaction)removed;
final String forkId = clientTx.getForkId();
if (forkId != null && clientTx.isInviteTransaction()
&& this.maxForkTime != 0) {
this.timer.schedule(new RemoveForkedTransactionTimerTask(
forkId), this.maxForkTime * 1000);
clientTx.stopExpiresTimer();
}
}
// Send a notification to the listener.
if (removed != null
&& sipTransaction.testAndSetTransactionTerminatedEvent()) {
SipProviderImpl sipProvider = (SipProviderImpl) sipTransaction
.getSipProvider();
TransactionTerminatedEvent event = new TransactionTerminatedEvent(
sipProvider, (ClientTransaction) sipTransaction);
sipProvider.handleEvent(event, sipTransaction);
}
}
}