Exemplo n.º 1
0
 /**
  * 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();
       }
     }
   }
 }
Exemplo n.º 2
0
  /**
   * Removes from the specified list of candidates providers connected to a registrar that does not
   * match the IP address that we are receiving a request from.
   *
   * @param candidates the list of providers we've like to filter.
   * @param request the request that we are currently dispatching
   */
  private void filterByAddress(List<ProtocolProviderServiceSipImpl> candidates, Request request) {
    Iterator<ProtocolProviderServiceSipImpl> iterPP = candidates.iterator();
    while (iterPP.hasNext()) {
      ProtocolProviderServiceSipImpl candidate = iterPP.next();

      if (candidate.getRegistrarConnection() == null) {
        // RegistrarLess connections are ok
        continue;
      }

      if (!candidate.getRegistrarConnection().isRegistrarless()
          && !candidate.getRegistrarConnection().isRequestFromSameConnection(request)) {
        iterPP.remove();
      }
    }
  }