Plugin.Maui.VoipCore
1.0.0
See the version list below for details.
dotnet add package Plugin.Maui.VoipCore --version 1.0.0
NuGet\Install-Package Plugin.Maui.VoipCore -Version 1.0.0
<PackageReference Include="Plugin.Maui.VoipCore" Version="1.0.0" />
<PackageVersion Include="Plugin.Maui.VoipCore" Version="1.0.0" />
<PackageReference Include="Plugin.Maui.VoipCore" />
paket add Plugin.Maui.VoipCore --version 1.0.0
#r "nuget: Plugin.Maui.VoipCore, 1.0.0"
#:package Plugin.Maui.VoipCore@1.0.0
#addin nuget:?package=Plugin.Maui.VoipCore&version=1.0.0
#tool nuget:?package=Plugin.Maui.VoipCore&version=1.0.0
Plugin.Maui.VoipCore
Generic SIP/VoIP abstraction for .NET MAUI on iOS and Android.
The package owns the session model (register, call, hold, mute, speaker, DTMF) and platform audio. Signaling and media come from a pluggable ISipStack — ship your own PJSIP/Linphone adapter, or use the built-in loopback stack for tests and UI work.
| Feature | What it does |
|---|---|
| Accounts | SIP username, domain, transport (UDP/TCP/TLS), proxy, STUN, ICE |
| Calls | Place, answer, reject, hangup, transfer, concurrent-call limit |
| Media | Mute, hold, speaker route, DTMF (0-9*#A-D) |
| Platform audio | iOS AVAudioSession voice-chat; Android AudioManager in-communication |
| Call UI | Optional iOS CallKit reporting; Android uses in-app IncomingCall |
| Pluggable stack | ISipStack + ISipStackSink so a native SIP engine can be swapped in |
| Loopback | In-process stack with SimulateIncoming for samples and unit tests |
Install
dotnet add package Plugin.Maui.VoipCore
Quick start
using Plugin.Maui.VoipCore;
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseVoipCore(options =>
{
options.Account = new SipAccount
{
Username = "alice",
Domain = "sip.example.com",
Password = "secret",
Transport = SipTransport.Udp
};
options.HoldOnBackground = true;
});
return builder.Build();
}
}
Resolve IVoipCore or use VoipCore.Current:
var voip = handler.Services.GetRequiredService<IVoipCore>();
await voip.InitializeAsync();
await voip.RegisterAsync(new SipAccount
{
Username = "alice",
Domain = "sip.example.com"
});
voip.IncomingCall += (_, e) => { /* show answer UI */ };
var call = await voip.PlaceCallAsync(new CallRequest
{
Destination = "bob@sip.example.com",
DisplayName = "Bob"
});
await voip.SetMutedAsync(call.Id, true);
await voip.SendDtmfAsync(call.Id, "123#");
await voip.HangupAsync(call.Id);
The default stack is LoopbackSipStack (no network). Outgoing loopback calls connect after PlaceCallAsync returns; inject inbound calls with SimulateIncoming.
Bring your own SIP stack
Implement ISipStack and report events through ISipStackSink:
builder.UseVoipCore(options =>
{
options.StackFactory = () => new MyPjsipStack();
});
InitializeAsync receives a SipStackContext with the sink and options. Raise OnRegistrationChanged, OnIncomingCall, and OnCallStateChanged as the native engine reports them.
Loopback (tests and sample)
var stack = new LoopbackSipStack(new LoopbackSipStackOptions
{
AutoProgress = false
});
var voip = VoipCore.Create(new VoipCoreOptions
{
StackFactory = () => stack
});
await voip.InitializeAsync();
await voip.RegisterAsync(account);
var call = await voip.PlaceCallAsync(new CallRequest { Destination = "sip:bob@example.com" });
stack.ReportCallState(call.Id, CallState.Connected);
stack.SimulateIncoming("sip:carol@example.com", "Carol");
Lifecycle hooks
UseVoipCore wires platform resume/pause:
- Background — hold connected calls when
HoldOnBackgroundistrue - Resume — resume calls that were held for backgrounding
voip.NotifyForeground();
voip.NotifyBackground();
Without the generic host
var voip = VoipCore.Create(new VoipCoreOptions
{
UseSpeakerByDefault = true
});
await voip.InitializeAsync();
Platform notes
iOS — set NSMicrophoneUsageDescription and UIBackgroundModes (audio, voip) in Info.plist. When UseNativeCallUi is true, incoming/outgoing calls are reported to CallKit.
Android — declare RECORD_AUDIO, MODIFY_AUDIO_SETTINGS, INTERNET, and ACCESS_NETWORK_STATE. Incoming calls are delivered through IncomingCall; host a ConnectionService in the app if you need Telecom UI.
Target frameworks
The package targets net10.0, net10.0-android, and net10.0-ios.
Pack from source
dotnet pack src/Plugin.Maui.VoipCore/Plugin.Maui.VoipCore.csproj -c Release -o artifacts
The .nupkg is written to artifacts/Plugin.Maui.VoipCore.1.0.0.nupkg.
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-android36.0 is compatible. net10.0-browser was computed. net10.0-ios was computed. net10.0-ios26.0 is compatible. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
-
net10.0-android36.0
- No dependencies.
-
net10.0-ios26.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release. Generic SIP/VoIP abstraction for .NET MAUI on iOS and Android with a pluggable stack, loopback engine, and platform audio.