Persistent Session Event Chunks
Persistent Session Event Chunks
To capture real-time streaming updates without losing data during network fluctuations, the application architecture routes volatile session communications into highly optimized database buffers. Asterisk 2 stores raw Telephony web messages inside temporary SessionEvents tables before running async parsing actions.
Asynchronous Ingestion & Processing Schema
The chart below details how streaming event strings write to staging tables prior to final ledger serialization:
graph LR
%% Ingress Streaming
subgraph LiveBus["ARI WebSocket Layer"]
StreamIn["Raw JSON Telephony Payload"]
end
%% Buffer Table
subgraph StagingTable["TelephonyDbContext Ledger"]
TabEvent[("SessionEvents Table<br/>(PK: EventId, Payload: JSON String)")]
end
%% Background Processing
subgraph AsyncWorker["Background Parsing Engine"]
EngineWorker["SessionEventProcessor.cs<br/>(Reads Staging Table Rows)"]
end
%% Final Target Ledgers
subgraph TargetStorage["Long-Term Master Datastores"]
TabCdr[("Finalized Call Ledgers<br/>(AstDbContext / AppDbContext)")]
end
%% Flows
StreamIn ==>|"High-Speed Staging Write"| TabEvent
TabEvent ==>|"Polled Bulk Read"| EngineWorker
EngineWorker ==>|"Parse & Map Attributes"| TabCdr
EngineWorker -.->|"Purge Processed Rows"| TabEvent
%% Polished Palette
classDef busToken fill:#0f172a,stroke:#38bdf8,stroke-width:2px,color:#fff,rx:6px,ry:6px;
classDef tabToken fill:#1e293b,stroke:#a855f7,stroke-width:2px,color:#fff,rx:6px,ry:6px;
classDef workerToken fill:#312e81,stroke:#ec4899,stroke-width:2px,color:#fff,rx:6px,ry:6px;
classDef targetToken fill:#065f46,stroke:#10b981,stroke-width:2px,color:#fff,rx:6px,ry:6px;
class LiveBus,StreamIn busToken;
class StagingTable,TabEvent tabToken;
class AsyncWorker,EngineWorker workerToken;
class TargetStorage,TabCdr targetToken;
Buffer Schema Field Model
1. SessionEvent Staging Class
EventId(long): High-range primary automatic auto-increment integer ID.SessionId(string): Distributed tracing string linking the event to global application trace pipelines.EventType(string): Event class indicator string (e.g.,ChannelCreated,DtmfReceived,RecordingFinished).Payload(string): Unrestricted storage text columns capturing complete, unparsed original JSON event payloads directly from telecommunication engines.CreatedAt(DateTime): High-precision UTC generation timestamp recording true packet network ingestion timelines.