示例#1
0
  /** Default constructor. */
  protected SIPTransactionStack() {
    super();
    this.transactionTableSize = -1;
    // a set of methods that result in dialog creation.
    this.dialogCreatingMethods = new HashSet<String>();
    // Standard set of methods that create dialogs.
    this.dialogCreatingMethods.add(Request.REFER);
    this.dialogCreatingMethods.add(Request.INVITE);
    this.dialogCreatingMethods.add(Request.SUBSCRIBE);
    // Notify may or may not create a dialog. This is handled in
    // the code.
    // Create the transaction collections

    clientTransactions = Collections.synchronizedList(new ArrayList<SIPClientTransaction>());
    serverTransactions = Collections.synchronizedList(new ArrayList<SIPServerTransaction>());
    // Dialog dable.
    this.dialogTable = new Hashtable<String, SIPDialog>();

    clientTransactionTable = new Hashtable<String, SIPTransaction>();
    serverTransactionTable = new Hashtable<String, SIPTransaction>();

    // Start the timer event thread.

    this.timer = new Timer();
    this.pendingRecordScanner = new Thread(new PendingRecordScanner(this));
    this.pendingRecordScanner.setDaemon(true);
    this.pendingTransactions = new HashSet<SIPServerTransaction>();
    pendingRecords = Collections.synchronizedList(new ArrayList<PendingRecord>());
    pendingRecordScanner.setName("PendingRecordScanner");
    pendingRecordScanner.start();
    // endif
    //

  }
示例#2
0
  /** Re Initialize the stack instance. */
  protected void reInit() {
    super.reInit();
    clientTransactions = Collections.synchronizedList(new ArrayList<SIPClientTransaction>());
    serverTransactions = Collections.synchronizedList(new ArrayList<SIPServerTransaction>());
    pendingTransactions = new HashSet<SIPServerTransaction>();
    pendingRecords = Collections.synchronizedList(new ArrayList<PendingRecord>());
    clientTransactionTable = new Hashtable<String, SIPTransaction>();
    serverTransactionTable = new Hashtable<String, SIPTransaction>();
    // Dialog dable.
    this.dialogTable = new Hashtable<String, SIPDialog>();

    this.timer = new Timer();
    pendingRecordScanner = new Thread(new PendingRecordScanner(this));
    pendingRecordScanner.setDaemon(true);
    pendingRecordScanner.setName("PendingRecordScanner");
    pendingRecordScanner.start();
  }