call method

Future<bool> call(
  1. String target, {
  2. bool voiceonly = false,
  3. MediaStream? mediaStream,
  4. List<String>? headers,
})

Implementation

Future<bool> call(String target,
    {bool voiceonly = false,
    MediaStream? mediaStream,
    List<String>? headers}) async {
  if (_ua != null && _ua!.isConnected()) {
    Map<String, dynamic> options = buildCallOptions(voiceonly);
    if (mediaStream != null) {
      options['mediaStream'] = mediaStream;
    }
    List<dynamic> extHeaders = options['extraHeaders'] as List<dynamic>;
    extHeaders.addAll(headers ?? <String>[]);
    _ua!.call(target, options);
    return true;
  } else {
    logger.error(
        'Not connected, you will need to register.', null, StackTraceNJ());
  }
  return false;
}