Verbara.Sdk.Sessions.Postgres 2.2.1

dotnet add package Verbara.Sdk.Sessions.Postgres --version 2.2.1
                    
NuGet\Install-Package Verbara.Sdk.Sessions.Postgres -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.Sessions.Postgres" 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.Sessions.Postgres" Version="2.2.1" />
                    
Directory.Packages.props
<PackageReference Include="Verbara.Sdk.Sessions.Postgres" />
                    
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.Sessions.Postgres --version 2.2.1
                    
#r "nuget: Verbara.Sdk.Sessions.Postgres, 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.Sessions.Postgres@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.Sessions.Postgres&version=2.2.1
                    
Install as a Cake Addin
#tool nuget:?package=Verbara.Sdk.Sessions.Postgres&version=2.2.1
                    
Install as a Cake Tool

Verbara.Sdk.Sessions.Postgres

Postgres-backed SessionStoreBase implementation for Verbara.Sdk.Sessions. Persists active and completed call sessions as JSONB rows in a shared Postgres database, enabling multi-instance deployments where multiple SDK hosts share a single durable session store.

Install

dotnet add package Verbara.Sdk.Sessions.Postgres

Configure

services.AddAsteriskSessionsBuilder()
        .UsePostgres(opts =>
        {
            opts.ConnectionString = "Host=localhost;Database=asterisk;Username=postgres;Password=secret";
            opts.TableName  = "asterisk_call_sessions"; // default
            opts.SchemaName = "public";                 // default
        });

Or pass a pre-built NpgsqlDataSource (recommended when you want to share pooling/logging configuration):

var dataSource = NpgsqlDataSource.Create("Host=localhost;Database=asterisk;Username=postgres;Password=secret");
services.AddAsteriskSessionsBuilder()
        .UsePostgres(dataSource);

Migrations

The package ships a starter migration at contentFiles/any/any/Migrations/001_create_sessions_table.sql. Apply it to your database before the application starts (e.g. via your migration runner, psql, or a deployment script):

CREATE TABLE IF NOT EXISTS asterisk_call_sessions (
    session_id   TEXT        PRIMARY KEY,
    linked_id    TEXT        NOT NULL,
    server_id    TEXT        NOT NULL,
    state        SMALLINT    NOT NULL,
    direction    SMALLINT    NOT NULL,
    created_at   TIMESTAMPTZ NOT NULL,
    updated_at   TIMESTAMPTZ NOT NULL,
    completed_at TIMESTAMPTZ NULL,
    snapshot     JSONB       NOT NULL
);
CREATE INDEX IF NOT EXISTS ix_asterisk_sessions_linked_id
    ON asterisk_call_sessions (linked_id);
CREATE INDEX IF NOT EXISTS ix_asterisk_sessions_active
    ON asterisk_call_sessions (state) WHERE completed_at IS NULL;

Notes

  • AOT-safe: uses source-generated JSON (SessionJsonContext) and parameterized SQL only.
  • UPSERT via INSERT ... ON CONFLICT (session_id) DO UPDATE.
  • SchemaName/TableName are embedded as SQL identifiers — they are validated against ^[A-Za-z_][A-Za-z0-9_]*$ at registration time and must be trusted inputs.
  • Partial index on state with WHERE completed_at IS NULL keeps the active scan fast even at scale.
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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.2.1 100 5/23/2026
2.2.0 96 5/20/2026
2.1.2 99 5/8/2026
2.1.1 96 5/7/2026
2.1.0 93 5/7/2026
2.0.0 89 5/6/2026