Asterisk.Sdk.Push.Webhooks
1.14.0
See the version list below for details.
dotnet add package Asterisk.Sdk.Push.Webhooks --version 1.14.0
NuGet\Install-Package Asterisk.Sdk.Push.Webhooks -Version 1.14.0
<PackageReference Include="Asterisk.Sdk.Push.Webhooks" Version="1.14.0" />
<PackageVersion Include="Asterisk.Sdk.Push.Webhooks" Version="1.14.0" />
<PackageReference Include="Asterisk.Sdk.Push.Webhooks" />
paket add Asterisk.Sdk.Push.Webhooks --version 1.14.0
#r "nuget: Asterisk.Sdk.Push.Webhooks, 1.14.0"
#:package Asterisk.Sdk.Push.Webhooks@1.14.0
#addin nuget:?package=Asterisk.Sdk.Push.Webhooks&version=1.14.0
#tool nuget:?package=Asterisk.Sdk.Push.Webhooks&version=1.14.0
Asterisk.Sdk.Push.Webhooks
Outbound HTTP webhook delivery for Asterisk.Sdk.Push. Consumes events from the in-process Push bus, matches them against WebhookSubscription topic patterns, and POSTs to configured URLs with HMAC-SHA256 signing and exponential retry/backoff.
Usage
using Asterisk.Sdk.Push.Topics;
using Asterisk.Sdk.Push.Webhooks;
builder.Services.AddAsteriskPush()
.AddAsteriskPushWebhooks(opts =>
{
opts.MaxRetries = 5;
opts.InitialDelay = TimeSpan.FromSeconds(1);
opts.MaxDelay = TimeSpan.FromSeconds(60);
opts.TimeoutPerAttempt = TimeSpan.FromSeconds(10);
});
// Runtime registration:
var store = app.Services.GetRequiredService<IWebhookSubscriptionStore>();
await store.AddAsync(new WebhookSubscription
{
Id = "crm-prod",
TopicPattern = TopicPattern.Parse("calls.**"),
TargetUrl = new("https://crm.example.com/hooks/calls"),
Secret = "<shared secret>"
});
Delivery headers
| Header | Value |
|---|---|
Content-Type |
application/json |
X-Signature |
sha256=<hex> (absent if subscription has no secret) |
X-Event-Type |
PushEvent.EventType |
User-Agent |
WebhookDeliveryOptions.UserAgent (default Asterisk.Sdk.Push.Webhooks/1.0) |
traceparent |
PushEventMetadata.TraceContext (absent if null) |
Extra per-subscription headers are appended from WebhookSubscription.Headers.
Extension points
- Custom payload shape: implement
IWebhookPayloadSerializerand register as singleton beforeAddAsteriskPushWebhooks. - Custom signature: implement
IWebhookSigner(e.g., JWT, asymmetric signatures) and register as singleton. - Durable subscriptions: implement
IWebhookSubscriptionStore(SQL/Redis/Postgres) and register as singleton. The defaultInMemoryWebhookSubscriptionStoreis process-local.
Observability
Counters on Asterisk.Sdk.Push.Webhooks meter:
asterisk.push.webhooks.deliveries.succeededasterisk.push.webhooks.deliveries.failedasterisk.push.webhooks.deliveries.retriedasterisk.push.webhooks.deliveries.dead_letter
Enroll via Asterisk.Sdk.OpenTelemetry — WithAllSources() includes this meter automatically once the meter name is added to AsteriskTelemetry.MeterNames.
| 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
- Asterisk.Sdk.Push (>= 1.14.0)
- Asterisk.Sdk.Resilience (>= 1.14.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.6)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.6)
- Microsoft.Extensions.Http (>= 10.0.6)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.6)
- Microsoft.Extensions.Options (>= 10.0.6)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.