/** * Remove the dialog from the dialog table. * * @param dialog -- dialog to remove. */ public void removeDialog(SIPDialog dialog) { synchronized (dialogTable) { Iterator<SIPDialog> it = this.dialogTable.values().iterator(); while (it.hasNext()) { SIPDialog d = (SIPDialog) it.next(); if (d == dialog) { if (LogWriter.needsLogging) { String dialogId = dialog.getDialogId(); logWriter.logMessage("Removing Dialog " + dialogId); } it.remove(); } } } }
/** * 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); } }