synchronized (this.clientTransactions) { Iterator it = clientTransactions.iterator(); while (it.hasNext()) { SIPClientTransaction clientTransaction = (SIPClientTransaction) it .next(); if (clientTransaction .isMessagePartOfTransaction(sipMessage)) return clientTransaction; }
Iterator it = clientTransactionTable.values().iterator(); while (it.hasNext()) { SIPClientTransaction clientTransaction = (SIPClientTransaction) it .next(); if (clientTransaction.isMessagePartOfTransaction(sipMessage)) return clientTransaction;
	public SIPTransaction findTransaction(SIPMessage sipMessage,			boolean isServer) {		SIPTransaction retval = null;		if (isServer) {			Via via = sipMessage.getTopmostVia();			if (via.getBranch() != null) {				String key = sipMessage.getTransactionId();				synchronized (this.serverTransactionTable) {					retval = (SIPTransaction) serverTransactionTable.get(key);					if (LogWriter.needsLogging)						logMessage("looking for key " + key);					if (retval != null							&& retval.isMessagePartOfTransaction(sipMessage))						return retval;				}			}			// Need to scan the table for old style transactions (RFC 2543			// style)			synchronized (this.serverTransactions) {				Iterator it = serverTransactions.iterator();				while (it.hasNext()) {					SIPServerTransaction sipServerTransaction = (SIPServerTransaction) it							.next();					if (sipServerTransaction							.isMessagePartOfTransaction(sipMessage))						return sipServerTransaction;				}			}		} else {			Via via = sipMessage.getTopmostVia();			if (via.getBranch() != null) {				String key = sipMessage.getTransactionId();				synchronized (this.clientTransactionTable) {					retval = (SIPTransaction) clientTransactionTable.get(key);					if (retval != null							&& retval.isMessagePartOfTransaction(sipMessage))						return retval;				}			}			// Need to scan the table for old style transactions (RFC 2543			// style)			synchronized (this.clientTransactions) {				Iterator it = clientTransactions.iterator();				while (it.hasNext()) {					SIPClientTransaction clientTransaction = (SIPClientTransaction) it							.next();					if (clientTransaction							.isMessagePartOfTransaction(sipMessage))						return clientTransaction;				}			}		}		return null;	}