call method

Future<Either<bool, Error>> call(
  1. String dest, [
  2. bool voiceonly = true
])

Implementation

Future<Either<bool, Error>> call(String dest, [bool voiceonly = true]) async {
  final String destSip =
      'sip:$dest@${_sipServer?.domain}:${_sipServer?.port}';
  if (destSip != _mySipUri) {
    try {
      final isCallSuccess = await pitelCall.call(dest, voiceonly);
      return left(isCallSuccess);
    } catch (err) {
      return right(PitelError(err.toString()));
    }
  } else {
    _logger.error('Cannot call because number is mine');
    return right(PitelError('Cannot call because number is mine'));
  }
}