RTCSession constructor

RTCSession(
  1. PitelUA? ua
)

Implementation

RTCSession(PitelUA? ua) {
  logger.debug('new');

  _id = null;
  _ua = ua;
  _status = C.statusNull;
  _dialog = null;
  _earlyDialogs = <String?, Dialog>{};
  _contact = null;
  _from_tag = null;
  _to_tag = null;

  // The RTCPeerConnection instance (public attribute).
  _connection = null;

  // Incoming/Outgoing request being currently processed.
  _request = null;

  // Cancel state for initial outgoing request.
  _is_canceled = false;
  _cancel_reason = '';

  // RTCSession confirmation flag.
  _is_confirmed = false;

  // Is late SDP being negotiated.
  _late_sdp = false;

  // Default rtcOfferConstraints and rtcAnswerConstrainsts (passed in connect() or answer()).
  _rtcOfferConstraints = null;
  _rtcAnswerConstraints = null;

  // Local MediaStream.
  _localMediaStream = null;
  _localMediaStreamLocallyGenerated = false;

  // Flag to indicate PeerConnection ready for actions.
  _rtcReady = true;

  // SIP Timers.
  _timers = SIPTimers();

  // Session info.
  _direction = null;
  _local_identity = null;
  _remote_identity = null;
  _start_time = null;
  _end_time = null;
  _tones = null;

  // Mute/Hold state.
  _audioMuted = false;
  _videoMuted = false;
  _localHold = false;
  _remoteHold = false;

  // Session Timers (RFC 4028).
  _sessionTimers = RFC4028Timers(
      _ua!.configuration!.sessionTimers,
      _ua!.configuration!.sessionTimersRefreshMethod,
      dart_sip_c.SESSION_EXPIRES,
      null,
      false,
      false,
      null);

  // Map of ReferSubscriber instances indexed by the REFER's CSeq number.
  _referSubscribers = <int?, ReferSubscriber>{};

  // Custom session empty object for high level use.
  data = <String, dynamic>{};

  receiveRequest = _receiveRequest;
}