Asterisk.Sdk.Hosting 1.15.3

Suggested Alternatives

Verbara.Sdk.Hosting

dotnet add package Asterisk.Sdk.Hosting --version 1.15.3
                    
NuGet\Install-Package Asterisk.Sdk.Hosting -Version 1.15.3
                    
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="Asterisk.Sdk.Hosting" Version="1.15.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Asterisk.Sdk.Hosting" Version="1.15.3" />
                    
Directory.Packages.props
<PackageReference Include="Asterisk.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 Asterisk.Sdk.Hosting --version 1.15.3
                    
#r "nuget: Asterisk.Sdk.Hosting, 1.15.3"
                    
#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 Asterisk.Sdk.Hosting@1.15.3
                    
#: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=Asterisk.Sdk.Hosting&version=1.15.3
                    
Install as a Cake Addin
#tool nuget:?package=Asterisk.Sdk.Hosting&version=1.15.3
                    
Install as a Cake Tool

Asterisk.Sdk.Hosting

The recommended entry point to the Asterisk.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 Asterisk.Sdk, Asterisk.Sdk.Ami, Asterisk.Sdk.Agi, Asterisk.Sdk.Ari, Asterisk.Sdk.Live, Asterisk.Sdk.Activities, Asterisk.Sdk.Sessions, and Asterisk.Sdk.Config. Add Voice AI / Push / OpenTelemetry packages on top as needed.

Install

dotnet add package Asterisk.Sdk.Hosting

Quick start — bind from config

using Asterisk.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 Asterisk.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 Asterisk.Sdk.Hosting:

Package Downloads
Asterisk.Sdk.OpenTelemetry

Asterisk.Sdk.OpenTelemetry - batteries-included OpenTelemetry wiring for Asterisk.Sdk. One-line AddAsteriskOpenTelemetry(...) enrolls every ActivitySource and Meter from AsteriskTelemetry 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
1.15.3 158 5/3/2026 1.15.3 is deprecated because it is no longer maintained.
1.15.2 136 4/27/2026 1.15.2 is deprecated because it is no longer maintained.
1.15.1 142 4/26/2026 1.15.1 is deprecated because it is no longer maintained.
1.15.0 175 4/20/2026 1.15.0 is deprecated because it is no longer maintained.
1.14.0 119 4/20/2026 1.14.0 is deprecated because it is no longer maintained.
1.13.0 122 4/20/2026 1.13.0 is deprecated because it is no longer maintained.
1.12.0 123 4/19/2026 1.12.0 is deprecated because it is no longer maintained.
1.11.1 134 4/19/2026 1.11.1 is deprecated because it is no longer maintained.
1.11.0 119 4/19/2026 1.11.0 is deprecated because it is no longer maintained.
1.10.2 116 4/18/2026 1.10.2 is deprecated because it is no longer maintained.
1.10.1 113 4/18/2026 1.10.1 is deprecated because it is no longer maintained.
1.10.0 130 4/18/2026 1.10.0 is deprecated because it is no longer maintained.
1.9.0 131 4/17/2026 1.9.0 is deprecated because it is no longer maintained.
1.8.1 120 4/16/2026 1.8.1 is deprecated because it is no longer maintained.
1.8.0 138 4/13/2026 1.8.0 is deprecated because it is no longer maintained.
1.7.0 123 4/13/2026 1.7.0 is deprecated because it is no longer maintained.
1.6.0 125 4/13/2026 1.6.0 is deprecated because it is no longer maintained.
1.5.5 122 4/9/2026 1.5.5 is deprecated because it is no longer maintained.
1.5.3 1,098 3/30/2026 1.5.3 is deprecated because it is no longer maintained.
1.5.2 135 3/30/2026 1.5.2 is deprecated because it is no longer maintained.
Loading failed