Verbara.Sdk.Hosting 2.2.1

dotnet add package Verbara.Sdk.Hosting --version 2.2.1
                    
NuGet\Install-Package Verbara.Sdk.Hosting -Version 2.2.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Verbara.Sdk.Hosting" Version="2.2.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Verbara.Sdk.Hosting" Version="2.2.1" />
                    
Directory.Packages.props
<PackageReference Include="Verbara.Sdk.Hosting" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Verbara.Sdk.Hosting --version 2.2.1
                    
#r "nuget: Verbara.Sdk.Hosting, 2.2.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Verbara.Sdk.Hosting@2.2.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Verbara.Sdk.Hosting&version=2.2.1
                    
Install as a Cake Addin
#tool nuget:?package=Verbara.Sdk.Hosting&version=2.2.1
                    
Install as a Cake Tool

Verbara.Sdk.Hosting

The recommended entry point to the Verbara.Sdk family — single dotnet add brings in AMI, AGI, ARI, Live, Activities, Sessions, and Config plus a Microsoft.Extensions.DependencyInjection extension that wires everything into your IHost with one call. Native AOT, zero reflection, MIT licensed.

What it does

  • AddAsterisk(IConfiguration | Action<AsteriskOptions>) — registers IAmiConnection, IAriClient, IAgiServer, the Live API (AsteriskServer), IActivityRegistry, ISessionEngine, and the supporting hosted services. Idempotent and source-generator-validated.
  • AsteriskOptions — strongly-typed configuration model with [OptionsValidator] source-generated validation (no runtime reflection). Bind directly from appsettings.json or configure inline.
  • Hosted lifecycleIHostedService implementations connect AMI on StartAsync, drain on StopAsync. AGI server, ARI WebSocket, and AsteriskServer (Live aggregate) follow the same pattern.
  • Health checksAmiHealthCheck, AriHealthCheck, AgiHealthCheck auto-registered. Expose at /health for Kubernetes probes.
  • Multi-server support — register multiple AsteriskServer instances via AsteriskServerPool for federated deployments.

This is a meta-package: it does not contain its own runtime types. It transitively pulls in Verbara.Sdk, Verbara.Sdk.Ami, Verbara.Sdk.Agi, Verbara.Sdk.Ari, Verbara.Sdk.Live, Verbara.Sdk.Activities, Verbara.Sdk.Sessions, and Verbara.Sdk.Config. Add Voice AI / Push / OpenTelemetry packages on top as needed.

Install

dotnet add package Verbara.Sdk.Hosting

Quick start — bind from config

using Verbara.Sdk.Hosting;
using Microsoft.Extensions.Hosting;

var builder = Host.CreateApplicationBuilder(args);
builder.Services.AddAsterisk(builder.Configuration);

var host = builder.Build();
await host.RunAsync();
{
  "Asterisk": {
    "Ami": { "Hostname": "pbx.example.com", "Username": "admin", "Password": "secret" },
    "Ari": { "BaseUrl": "http://pbx.example.com:8088", "Username": "admin", "Password": "secret", "ApplicationName": "my-app" },
    "Agi": { "Port": 4573 }
  }
}

Quick start — inline configure

builder.Services.AddAsterisk(options =>
{
    options.Ami.Hostname = "192.168.1.100";
    options.Ami.Username = "admin";
    options.Ami.Password = "secret";
    // Optional: tune reconnect / heartbeat
    options.Ami.ReconnectInitialDelay = TimeSpan.FromSeconds(1);
    options.Ami.HeartbeatInterval = TimeSpan.FromSeconds(30);
});

After host.RunAsync(), resolve services in your code:

var ami = host.Services.GetRequiredService<IAmiConnection>();
var server = host.Services.GetRequiredService<AsteriskServer>();   // Live API aggregate
var ari = host.Services.GetRequiredService<IAriClient>();

Health endpoint

The package auto-registers IHealthCheck for AMI/ARI/AGI. Wire to ASP.NET Core:

builder.Services.AddHealthChecks();
// ...
app.MapHealthChecks("/health");

Multi-server (federation)

builder.Services.AddAsteriskServerPool(pool =>
{
    pool.AddServer("dc-east", o => { o.Ami.Hostname = "pbx-east"; /* ... */ });
    pool.AddServer("dc-west", o => { o.Ami.Hostname = "pbx-west"; /* ... */ });
});

See Examples/MultiServerExample/ for a full federation walkthrough.

Native AOT

AddAsterisk is fully AOT-safe: options validation comes from a source generator, no Type.GetType lookups, no Activator.CreateInstance. 0 trim warnings.

License

MIT. Part of the Verbara.Sdk project.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Verbara.Sdk.Hosting:

Package Downloads
Verbara.Sdk.OpenTelemetry

Verbara.Sdk.OpenTelemetry - batteries-included OpenTelemetry wiring for Verbara.Sdk. One-line AddVerbaraOpenTelemetry(...) enrolls every ActivitySource and Meter from VerbaraTelemetry and provides convenience helpers for Console, OTLP, and Prometheus exporters.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.2.1 193 5/23/2026
2.2.0 118 5/20/2026
2.1.2 120 5/8/2026
2.1.1 98 5/7/2026
2.1.0 686 5/7/2026
2.0.0 118 5/6/2026