makeCall static method

Future<void> makeCall({
  1. required String accountId,
  2. required String target,
})

Make a call from a specific account

Implementation

static Future<void> makeCall({
  required String accountId,
  required String target,
}) async {
  try {
    final helper = _sipHelpers[accountId];
    if (helper == null) {
      throw Exception('Account not found: $accountId');
    }

    final account = _accounts[accountId];
    if (account == null || !account.isRegistered) {
      throw Exception('Account not registered: $accountId');
    }

    debugPrint('═══════════════════════════════════════');
    debugPrint('📞 MULTI-SIP: MAKING CALL');
    debugPrint('═══════════════════════════════════════');
    debugPrint('From Account: $accountId');
    debugPrint('Target: $target');
    debugPrint('═══════════════════════════════════════');

    final uri = target.startsWith('sip:') ? target : 'sip:$target';
    await helper.call(uri, voiceOnly: true);

    debugPrint('✅ Call initiated from account: $accountId');
  } catch (e, stackTrace) {
    _printException('Make Call', e, stackTrace);
    rethrow;
  }
}