Verbara.Sdk.Hosting
2.1.0
See the version list below for details.
dotnet add package Verbara.Sdk.Hosting --version 2.1.0
NuGet\Install-Package Verbara.Sdk.Hosting -Version 2.1.0
<PackageReference Include="Verbara.Sdk.Hosting" Version="2.1.0" />
<PackageVersion Include="Verbara.Sdk.Hosting" Version="2.1.0" />
<PackageReference Include="Verbara.Sdk.Hosting" />
paket add Verbara.Sdk.Hosting --version 2.1.0
#r "nuget: Verbara.Sdk.Hosting, 2.1.0"
#:package Verbara.Sdk.Hosting@2.1.0
#addin nuget:?package=Verbara.Sdk.Hosting&version=2.1.0
#tool nuget:?package=Verbara.Sdk.Hosting&version=2.1.0
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>)— registersIAmiConnection,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 fromappsettings.jsonor configure inline.- Hosted lifecycle —
IHostedServiceimplementations connect AMI onStartAsync, drain onStopAsync. AGI server, ARI WebSocket, andAsteriskServer(Live aggregate) follow the same pattern. - Health checks —
AmiHealthCheck,AriHealthCheck,AgiHealthCheckauto-registered. Expose at/healthfor Kubernetes probes. - Multi-server support — register multiple
AsteriskServerinstances viaAsteriskServerPoolfor 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 | Versions 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. |
-
net10.0
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.7)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.7)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.7)
- Microsoft.Extensions.Options (>= 10.0.7)
- Verbara.Sdk (>= 2.1.0)
- Verbara.Sdk.Activities (>= 2.1.0)
- Verbara.Sdk.Agi (>= 2.1.0)
- Verbara.Sdk.Ami (>= 2.1.0)
- Verbara.Sdk.Ari (>= 2.1.0)
- Verbara.Sdk.Config (>= 2.1.0)
- Verbara.Sdk.Live (>= 2.1.0)
- Verbara.Sdk.Sessions (>= 2.1.0)
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.