Skip to content

Live OCS Monitor & Real-Time Telephony Supervision Module Documentation

9 min readUpdated: Nov 29, 2026
View as Markdown
Role Primary Use Case Key Capabilities
Chief Financial Officer (CFO) Revenue analytics & financial reporting. Review recurring revenue (MRR/ARR), margin trends, and aggregate accounting ledgers.
Billing Operations Specialist Invoice generation & payment collections. Generate monthly billing runs, review unpaid balances, and reconcile gateway payouts.
Telecom Audit Specialist CDR & transaction reconciliation. Audit high-precision Call Detail Records (CDRs) and Message Detail Records (MDRs) against billing debits.

  1. Module Overview (Technical)
  2. Module Overview (Commercial & Business Value)
  3. Visual Interface & Form Structure
  4. Architectural Flow & Real-Time OCS Supervision Engine
  5. Common Scenarios & Operational Playbooks
  6. Troubleshooting & Diagnostic Commands
  7. Model Context Protocol (MCP) AI Integration
  8. Glossary

The Live OCS Monitor & Real-Time Telephony Supervision module provides live, second-by-second visibility into active SIP dialogs traversing Ring2All SBC and supervised by the Ring2All BSS Online Charging System (OCS).

┌────────────────────────────────────────────────────────────────────────┐
│ Ring2All SBC (Kamailio Core) │
│ • Supervised SIP Dialogs (`dlg` module) │
│ • Media RTP Streams Relay (RTPEngine) │
└───────────────────────────────────┬────────────────────────────────────┘
│ (JSON-RPC / REST Hook)
▼
┌────────────────────────────────────────────────────────────────────────┐
│ Ring2All BSS OCS Engine (`/api/ocs`) │
│ • Cluster-Wide PostgreSQL 17 OCS Wallet Reservations + Local Cache │
│ • Running Accrued Revenue Ticker (1-second update cycle) │
│ • Real-Time Credit Limit & Wallet Balance Guard │
│ • Remote Call Teardown Dispatcher (`dlg.end_dlg`) │
└───────────────────────────────────┬────────────────────────────────────┘
│
▼
┌────────────────────────────────────────────────────────────────────────┐
│ Web Operations Dashboard (`/live-monitor`) │
│ • Live Call Duration Ticker │
│ • Active Channels & Real-Time CPS Metrics │
│ • One-Click Administrative Call Disconnection │
└────────────────────────────────────────────────────────────────────────┘

In single-server and Active-Active HA deployments, every active call’s credit reservation, billing rate, and session metadata is persisted atomically in PostgreSQL 17 alongside each node’s local fast-path cache. When /api/ocs/live-calls is queried on any HA node, the OCS engine reconciles local in-memory sessions with active cluster-wide database reservations (status = 'active' and unexpired tranche leases), guaranteeing accurate real-time supervision and balance protection even across multi-node failovers.

  • Supervised Active Dialogs: Count of live, bi-directional SIP dialogs currently established across the network.
  • Media Channels: Active RTP and WebRTC audio media relay sockets maintained by RTPEngine (2 channels per standard audio call).
  • Live Accrued Revenue: Calculated in real time for all in-progress calls using dynamic second-by-second evaluation: $$\text{Accrued Cost} = \text{Connection Fee} + \left(\text{Rate per Minute} \times \frac{\text{Elapsed Seconds}}{60}\right)$$
  • Active Calls Per Second (CPS): Rolling throughput calculation representing transaction intensity across telecom nodes.

2. Module Overview (Commercial & Business Value)

Section titled “2. Module Overview (Commercial & Business Value)”
  • Immediate Fraud Mitigation: Enables Network Operations Center (NOC) engineers to detect and instantly terminate toll fraud, PBX compromises, and international revenue share fraud (IRSF) while calls are in progress.
  • Zero Prepaid Credit Overrun: The OCS engine monitors wallet balances in real time, automatically dispatching teardown signals to Ring2All SBC before a prepaid customer’s account can enter negative territory.
  • Carrier Capacity Supervision: Allows engineering teams to ensure outbound traffic does not breach agreed carrier channel caps, preventing upstream SIP 503 Service Unavailable rejections.
  • Executive Revenue Telemetry: Real-time visibility of gross platform monetization as calls occur, without having to wait for offline batch rating processes.

The Live Call Monitor & SBC Channels interface combines real-time telephony KPI status cards (Supervised Calls, Media Channels, Calls Per Second, Accrued Revenue, and Core Health) with an interactive table of active calls featuring live updating duration timers and one-click disconnect controls.

Live OCS Monitor Dashboard

Metric Card Unit Source Description & Operational Significance
Supervised Calls Integer DB-Backed OCS Reservations & Cache Number of active established SIP dialogs being charged across all HA nodes in real time.
Media Channels Integer RTPEngine Socket Active bidirectional audio RTP streams relayed across the perimeter SBC.
Calls Per Second (CPS) Decimal Rolling Counter Real-time call establishment rate across all configured telecom nodes.
Accrued Revenue Currency ($) Dynamic Rating Ticker Total live monetary value accumulated by currently connected calls.
SBC Core Health Status Badge Heartbeat Ping Operational status of the connected SBC SIP Signaling Engine.
Field Name Format Description
Call UUID & Status String / Pulse Badge Unique SIP call identifier with pulsing activity indicator.
Caller (CLI) E.164 String Originating phone number presented by the caller.
Destination E.164 / Geo Name Target dialed number and geographical destination name.
Customer & Account Text Corporate customer name and account number being debited.
Carrier Provider Text Terminating wholesale carrier handling the outbound hop.
Rate / Min $0.0000 Applicable retail per-minute tariff from the customer’s Rate Card.
Live Duration MM:SS (Live Ticker) Exact running call duration updated every 1,000 milliseconds.
Accrued Cost $0.0000 Real-time calculated charge to date for the active session.
Actions Disconnect Button Sends an immediate SIP BYE / dlg.end_dlg command to terminate the call.

4. Architectural Flow & Real-Time OCS Supervision Engine

Section titled “4. Architectural Flow & Real-Time OCS Supervision Engine”
┌────────────────────────────────────────────────────────────────────────┐
│ Inbound Call Arrives at Ring2All SBC Core │
└───────────────────────────────────┬────────────────────────────────────┘
│
▼
┌────────────────────────────────────────────────────────────────────────┐
│ Step 1: Real-Time Pre-Authorization Check (`/api/ocs/pre-auth`) │
│ • Verify Customer status: `active` │
│ • Check balance: Prepaid (wallet > $0) or Postpaid (within limit) │
│ • Atomically reserve initial credit tranche in PostgreSQL 17 │
│ • Resolve retail rate & calculate max allowed duration (seconds) │
│ • Return: `{ authorized: true, maxDurationSeconds: 1800 }` │
└───────────────────────────────────┬────────────────────────────────────┘
│
▼
┌────────────────────────────────────────────────────────────────────────┐
│ Step 2: Live Dialog Tracking & Interim Tranche Renewal │
│ • SIP 200 OK received: call connected │
│ • DB-backed reservation visible across every BSS HA API node │
│ • Live monitor web dashboard displays running timers │
└───────────────────────────────────┬────────────────────────────────────┘
│
┌────────────────────────┴────────────────────────┐
│ │
▼ (Normal Call End) ▼ (Administrative Kill / Balance Exhausted)
┌───────────────────────────────────────┐ ┌───────────────────────────────────────┐
│ Call Terminates (SIP BYE) │ │ Force Teardown Signal │
│ • Settle final wallet reservation │ │ • Send `dlg.end_dlg` to SBC via RPC │
│ • Record rated CDR & reconcile │ │ • Drop dialog and release media │
└───────────────────────────────────────┘ └───────────────────────────────────────┘

5. Common Scenarios & Operational Playbooks

Section titled “5. Common Scenarios & Operational Playbooks”

Scenario A: Terminating a Suspected Toll Fraud Call

Section titled “Scenario A: Terminating a Suspected Toll Fraud Call”
  1. In the Live OCS Monitor, search for high-cost international prefixes (e.g. +232, +882, +370).
  2. Identify any suspicious calls where duration or rate per minute is extraordinarily high.
  3. Click the red Disconnect (phone off) button on the call row.
  4. Confirm the prompt: “Disconnect live call dialog?”.
  5. The platform sends a direct dlg.end_dlg RPC command to Ring2All SBC Core, immediately terminating the call and releasing all media sockets.

Scenario B: Monitoring Live Capacity During Peak Calling Windows

Section titled “Scenario B: Monitoring Live Capacity During Peak Calling Windows”
  1. Verify that Live Stream: ON is illuminated green in the top toolbar (refreshes every 2.5 seconds).
  2. Monitor the Media Channels metric to verify that Perimeter RTPEngine capacity remains within healthy operating thresholds.
  3. Check the SBC Core Health and Media Relay indicators to ensure zero packet drop or signaling latency.

Query Live Dialogs Directly on SBC Core Engine

Section titled “Query Live Dialogs Directly on SBC Core Engine”
Terminal window
kamcmd dlg.list

Inspect Active Cluster-Wide Calls via BSS API

Section titled “Inspect Active Cluster-Wide Calls via BSS API”
Terminal window
curl -s -H "Authorization: Bearer <TOKEN>" https://198.51.100.20/api/ocs/live-calls | jq .
Terminal window
curl -s -X POST https://198.51.100.20/api/ocs/kill-call \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"callUuid": "call-7b91a2-live-01"}'

7. Model Context Protocol (MCP) AI Integration

Section titled “7. Model Context Protocol (MCP) AI Integration”

The Live OCS Monitor & Real-Time Telephony Supervision module connects directly to the Ring2All BSS MCP Server, empowering NOC operators and telephony AI agents to inspect live traffic, monitor real-time CPS, and execute emergency call hangups.

Tool Name Access Role Description & Primary Function Example Arguments
get_live_calls_telemetry Telecom & Carrier Engineer / Admin Retrieves real-time active call telemetry, CPS metrics, active channels, and supervised sessions from OCS engine. {}
disconnect_live_call_ocs Super Administrator Forcefully terminates an active call session in the Online Charging System (OCS) and signals the telecom switch. {"callId": "call-7b91a2-live-01"}

Sample MCP Tool Execution: get_live_calls_telemetry

Section titled “Sample MCP Tool Execution: get_live_calls_telemetry”
{
"name": "get_live_calls_telemetry",
"arguments": {}
}
{
"activeCallsCount": 14,
"callsPerSecond": 3.8,
"activeChannels": 28,
"estimatedHourlyRevenue": 42.60,
"calls": [
{
"callId": "call-7b91a2-live-01",
"caller": "+13055550199",
"callee": "+442079460991",
"durationSeconds": 85,
"currentCost": 0.0170,
"customerName": "Cuadra Telecom Corp",
"carrier": "Telnyx Primary Carrier"
}
]
}

Conversational AI Prompts for AI Assistant

Section titled “Conversational AI Prompts for AI Assistant”
  • “What is our current active call count and calls-per-second rate?”
  • “List all active calls that have exceeded 60 minutes in duration.”
  • “Disconnect active call session call-7b91a2-live-01 immediately.”

  • Active Channels: The count of concurrent audio and media relay channels active on the platform.
  • Calls Per Second (CPS): Measure of telephony signaling throughput representing newly initiated calls per second.
  • OCS (Online Charging System): Telecom architecture component that inspects customer balances in real time before and during calls.
  • Pre-Authorization: Real-time query performed by the SBC to the OCS before completing an outbound call to verify credit.
  • SIP Dialog: A peer-to-peer SIP relationship between two user agents that persists for a measurable duration.
  • Model Context Protocol (MCP): Open protocol standard that enables secure, controlled integration between Large Language Models and external tools, databases, and telecom rating engines.