PitelUA constructor

PitelUA(
  1. PitelSipSettings? configuration
)

Implementation

PitelUA(PitelSipSettings? configuration) {
  logger.debug('new() [configuration:${configuration.toString()}]');

  _configuration = PitelSipSettings();
  _dynConfiguration = DynamicSettings();
  _dialogs = <String, Dialog>{};

  // User actions outside any session/dialog (MESSAGE).
  _applicants = <Message>{};

  _sessions = <String?, RTCSession>{};
  _transport = null;
  _contact = null;
  _status = C.STATUS_INIT;
  _transactions = TransactionBag();

  // Custom UA empty object for high level use.

  _closeTimer = null;

  // Check configuration argument.
  if (configuration == null) {
    throw Exceptions.ConfigurationError('Not enough arguments');
  }

  // Load configuration.
  try {
    _loadConfig(configuration);
  } catch (e) {
    _status = C.STATUS_NOT_READY;
    throw e;
  }

  // Initialize registrator.
  _registrator = Registrator(this);
}