@brokeros/int-voice) that connects cloud AI voice agents to enterprise telecom carriers.
This separation ensures your brokerage maintains full ownership of its telephone numbers, caller ID reputation, and telecom contract pricing without being locked into a single AI SaaS vendor.
Carrier Bridge Dispatcher Architecture
TheCarrierBridgeDispatcher (integrations/voice/bridge/carrier-bridge-dispatcher.ts) abstracts carrier-specific telecom APIs into a unified dispatch pipeline:
Supported Telephony Carrier Adapters
BrokerOS maintains self-contained, typed telecom adapters insideintegrations/voice/telephony/:
Carrier Verification & Latency Health Check
Through the Telephony Carriers Settings Tab (TelephonyCarriersTab.tsx), administrators can configure and verify carrier credentials:
- Credential Fields: Configure Provider, Account SID, Auth Token, API Key, API Token, Subdomain, and SIP Domain.
- Multiple Virtual Caller IDs: Bind pools of verified phone numbers to a single carrier trunk, enabling round-robin caller ID rotation.
- Live Connection Ping (
/verify): Administrators can click Verify Carrier to dispatch an immediate diagnostic ping (POST /api/marketing/voice/integrations/telephony/:id/verify). The system tests API authentication and measures round-trip network latency, rendering a green verification badge and latency readout (e.g., Valid - 84ms).
Dynamic Variable Normalization Engine
Before transmitting lead data to the carrier and voice engine, BrokerOS passes parameters throughnormalizeVoiceLeadVariables from @brokeros/constants:
1. E.164 Phone Normalization
Strips formatting characters, spaces, and brackets. Validates length and prepends international country codes:- Indian mobile:
98765 43210becomes+919876543210. - US mobile:
(415) 555-0199becomes+14155550199.
2. Phonetic Currency & Budget Expansion
Text-to-speech engines often fail when reading raw currency numbers. The normalizer transforms numbers into natural spoken words:- Indian Real Estate:
15000000is pronounced as “One Crore Fifty Lakh Rupees”. - International Real Estate:
750000is pronounced as “Seven Hundred and Fifty Thousand Dollars”.
3. Conversational Date & Time Formatting
Converts ISO timestamp strings into friendly conversational phrasing (for example, converting2026-10-18T11:00:00Z to “this Saturday morning at eleven o’clock”).
Concurrency Throttling & Calling Window Enforcement
High-volume campaigns can easily saturate carrier SIP channel capacities or overwhelm brokerage sales teams if not carefully regulated:- Concurrency Caps: Campaigns enforce strict concurrency limits (typically 5 to 20 concurrent channels per trunk). The worker dequeues calls in chunks and only initiates new dials as previous conversations terminate.
- Pacing Delays: To respect telecom carrier Calls-Per-Second (CPS) thresholds and avoid network rate-limiting, the background processor injects a 600ms pacing pause between consecutive batch chunks.
- Calling Window Enforcement: Outbound calling automatically observes statutory legal hours (
callingWindowStartandcallingWindowEnd, default 09:00 to 20:00). If a campaign is actively dialing when the evening cutoff arrives, it automatically halts dispatch and resumes the following morning. - Failover Routing: If a primary carrier encounters circuit congestion (HTTP 503), the
CarrierBridgeDispatchercan fall back to a secondary configured carrier trunk.