Пример #1
0
    protected void start() {
      int mf = _request.getMaxForwards();
      if (mf == -1) mf = __maxForwards;
      else mf--;

      _request.setMaxForwards(mf);
      _request.setRequestURI(_uri);

      if (_branchRRUri != null) _request.addRecordRoute(new NameAddr(_branchRRUri));

      if (_branchPathUri != null && _request.isRegister())
        _request.addAddressHeader(SipHeaders.PATH, new NameAddr(_branchPathUri), true);

      // _ctx = _request.getCallSession().getServer().sendRequest(_request, this);
      try {
        _ctx = _request.session().sendRequest(_request, this);

        if (_request.isInvite()) startTimerC();

        _actives++;
      } catch (Exception e) {
        LOG.debug(e);
        // TODO
      }
    }
Пример #2
0
  public SipProxy(SipRequest request) throws TooManyHopsException {
    _tx = (ServerTransaction) request.getTransaction();
    _tx.setListener(this);

    int maxForwards = request.getMaxForwards();
    if (maxForwards == 0) throw new TooManyHopsException();
    else if (maxForwards == -1) request.setMaxForwards(70);

    if (LOG.isDebugEnabled()) LOG.debug("Created proxy for tx {}", _tx, null);
  }