makeCall static method
Make a SIP call
target can be:
- Extension number: '1002'
- Full SIP URI: 'sip:1002@sip.example.com'
- Username with domain: '1002@sip.example.com'
Example:
await VoipPlugin.makeCall('1002');
Implementation
static Future<void> makeCall(String target) async {
if (!_initialized) {
throw Exception('VoIP Plugin not initialized. Call VoipPlugin.initialize() first.');
}
if (!SipService.isRegistered) {
throw Exception('Not registered. Please register first.');
}
try {
debugPrint('═══════════════════════════════════════');
debugPrint('📞 VoIP PLUGIN: MAKING CALL');
debugPrint('═══════════════════════════════════════');
debugPrint('Target: $target');
debugPrint('═══════════════════════════════════════');
await SipService.makeCall(target);
} catch (e, stackTrace) {
debugPrint('❌ Make call error: $e');
debugPrint('Stack trace: $stackTrace');
rethrow;
}
}