/** Hash table for quick lookup of transactions. */
 protected void addTransactionHash(SIPTransaction sipTransaction) {
   SIPRequest sipRequest = sipTransaction.getOriginalRequest();
   // Via via = sipRequest.getTopmostVia();
   // Cannot cache old style requests.
   /**
    * if (via.getBranch() == null || ! via.getBranch().toUpperCase().startsWith
    * (SIPConstants.BRANCH_MAGIC_COOKIE.toUpperCase())){ return; }
    */
   if (sipTransaction instanceof SIPClientTransaction) {
     synchronized (clientTransactionTable) {
       String key = sipRequest.getTransactionId();
       clientTransactionTable.put(key, sipTransaction);
     }
   } else {
     synchronized (serverTransactionTable) {
       String key = sipRequest.getTransactionId();
       serverTransactionTable.put(key, sipTransaction);
     }
   }
 }
 /**
  * Put a dialog into the dialog table.
  *
  * @param dialog -- dialog to put into the dialog table.
  */
 public void putDialog(SIPDialog dialog) {
   String dialogId = dialog.getDialogId();
   synchronized (dialogTable) {
     if (dialogTable.containsKey(dialogId)) return;
   }
   if (LogWriter.needsLogging) {
     logWriter.logMessage("putDialog dialogId=" + dialogId);
   }
   // if (this.getDefaultRouteHeader() != null)
   //   dialog.addRoute(this.getDefaultRouteHeader(),false);
   dialog.setStack(this);
   if (LogWriter.needsLogging) logWriter.logStackTrace();
   synchronized (dialogTable) {
     dialogTable.put(dialogId, dialog);
   }
 }