linphone_flutter_plugin 0.0.2 copy "linphone_flutter_plugin: ^0.0.2" to clipboard
linphone_flutter_plugin: ^0.0.2 copied to clipboard

PlatformAndroid

Linphone Flutter Plugin is a Flutter package that integrates the Linphone SDK's native Android calling functionalities into Flutter applications. Designed for Voice over IP (VOIP) communication, this [...]

Linphone Flutter Plugin #

linkedin

Linphone Flutter Plugin is a Flutter plugin that allows you to integrate Linphone SDK's native Android calling functionalities into your Flutter application. This plugin is designed for VOIP calling using the UDP protocol, making it ideal for real-time voice communication in your app.

Features #

  • Native Android Integration: Utilize the power of Linphone SDK for seamless VOIP calling.
  • UDP Protocol Support: Ensures fast and efficient communication with minimal latency.
  • Call Handling: Initiate, receive, and manage VOIP calls directly from your Flutter app.
  • Call Logs: Retrieve call history for tracking and analysis.
  • Mute, Speaker, and Call Transfer: Control the call state with advanced features.

Installation #

To use this plugin, add linphone_flutter_plugin as a dependency in your pubspec.yaml file:

  • Run this command:
 $ dart pub add linphone_flutter_plugin

Usage #

  • Import the plugin
import 'package:linphone_flutter_plugin/linphoneflutterplugin.dart';

Android Permissions #

  • Add permission in AndroidManifest.xml
<manifest...>
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.SYSTEM_CAMERA" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_CAMERA" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_PHONE_CALL" />
    <uses-permission android:name="android.permission.MANAGE_OWN_CALLS" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
</manifest>

Initialize the Plugin #

  • Before you can make or receive calls, you need to initialize the Linphone plugin and request the necessary permissions.
final _linphoneSdkPlugin = LinphoneFlutterPlugin();

Future<void> initLinphone() async {
  await _linphoneSdkPlugin.requestPermissions();
}

Login #

  • To start using Linphone, you need to log in with your SIP credentials.
Future<void> login({
  required String username,
  required String password,
  required String domain,
}) async {
  await _linphoneSdkPlugin.login(userName: username, domain: domain, password: password);
}

Make a Call #

  • Initiate a call by specifying the recipient’s number.
Future<void> call(String number) async {
  await _linphoneSdkPlugin.call(number: number);
}

Receive a Call #

  • You can listen for incoming calls and handle them accordingly.
_linphoneSdkPlugin.addCallStateListener().listen((CallState state) {
  if (state == CallState.IncomingReceived) {
    // Handle incoming call
  }
});

Hang Up #

  • End an ongoing call.
Future<void> hangUp() async {
  await _linphoneSdkPlugin.hangUp();
}

Example #

Check out the example directory for a complete example of how to use this plugin.

Contributing #

Contributions are welcome! Please submit issues and pull requests to help improve the plugin.

License #

This project is licensed under the MIT License. See the LICENSE file for details.

5
likes
130
points
54
downloads

Publisher

unverified uploader

Weekly Downloads

Linphone Flutter Plugin is a Flutter package that integrates the Linphone SDK's native Android calling functionalities into Flutter applications. Designed for Voice over IP (VOIP) communication, this plugin leverages the UDP protocol to enable efficient, real-time voice calling. It provides a seamless way to manage VOIP calls, handle call logs, and control call features such as muting, speaker toggling, and call forwarding directly within your Flutter app.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on linphone_flutter_plugin