Asterisk Realtime Proxies (AstDbContext)

Asterisk Realtime Proxies (AstDbContext)

To achieve microsecond data matching speeds during signaling cycles, Asterisk 2 configures dedicated read-only Entity Framework proxy contexts. These drivers route query expressions directly to underlying native relational tables used by active telecommunication modules.


Direct Proxy Query Routing Schema

The diagram below outlines how application LINQ expressions resolve fields from external operational storage arrays:

graph LR
    %% Application Consumer
    subgraph CoreTier["C# Routing Engine"]
        LinqQuery["Application Controller / Service<br/>(Queries DbSet Interfaces)"]
    end

    %% Decoupled EF Core Layer
    subgraph ProxyTier["Decoupled Proxy Context"]
        EF_Proxy["AstDbContext Engine<br/>(Read-Only Configuration)"]
    end

    %% Target Schema Ledgers
    subgraph ExternalDB["Underlying Realtime Store (wb_ast)"]
        Tab_End[("ps_endpoints Table<br/>(SIP PJSIP Parameters)")]
        Tab_Srv[("servers Table<br/>(Hardware Heartbeat Stats)")]
        Tab_Aud[("cdr / cel / queue_log Tables<br/>(Call Telemetry Logs)")]
    end

    %% Queries
    LinqQuery -->|"LINQ Execution"| EF_Proxy
    EF_Proxy ==>|"Direct Schema Map"| Tab_End
    EF_Proxy ==>|"Direct Schema Map"| Tab_Srv
    EF_Proxy ==>|"Direct Schema Map"| Tab_Aud

    %% Rich Tailored Palettes
    classDef coreToken fill:#0f172a,stroke:#38bdf8,stroke-width:2px,color:#fff,rx:6px,ry:6px;
    classDef proxyToken fill:#312e81,stroke:#ec4899,stroke-width:2px,color:#fff,rx:6px,ry:6px;
    classDef dbToken fill:#1e293b,stroke:#a855f7,stroke-width:2px,color:#fff,rx:6px,ry:6px;

    class CoreTier,LinqQuery coreToken;
    class ProxyTier,EF_Proxy proxyToken;
    class ExternalDB,Tab_End,Tab_Srv,Tab_Aud dbToken;

Architectural Safeties

1. Disabled Migration Scopes

Because AstDbContext queries operational tables managed by external installation drivers, code-first data migrations are explicitly blocked. Framework builders must never execute schema mutation tools targeting this target connection mapping string.

2. Immutability Enforcement

Data integration scripts enforce strict read isolation (AsNoTracking) across proxy DbSets, preventing accidental write back loops from polluting raw signaling logic configurations.