CallingCRM API & Telephony Engine Reference
Comprehensive reference for CallingCRM Server (Port 5000), Asterisk Telephony Engine (Port 4000), RabbitMQ event bus, and browser WebRTC softphone integrations.
Architecture & Auth
Call Management API
Telephony & Asterisk
Campaigns & CRM
Webhooks & Events
System Architecture & Flow
Overview of CallingCRM's three-tier architecture: CRM Server (:5000), Asterisk Engine (:4000), and Event Pipeline.
CallingCRM separates CRM customer record management from real-time telephony control into dedicated, high-performance microservices.
1. CRM Server (Node.js/Express on port 5000): Handles user authentication (JWT), MongoDB data persistence (Call records, Contacts, Campaigns), and customer 360 data.
2. Asterisk Telephony Engine (Node.js on port 4000 + Asterisk PBX): Connects directly to Asterisk ARI (Asterisk REST Interface) for low-latency call origination, WebRTC media bridging, hold, mute, and live supervision.
3. RabbitMQ Event Bus (exchange: events.calls): When Asterisk detects channel events (ringing, answer, hangup), it publishes structured JSON payloads. An event consumer updates the MySQL live calls table, and on call.ended triggers an HTTP sync to persist talk time and audio recording metadata into MongoDB.
4. WebRTC Softphone (Browser JsSIP): Agents register directly via WebSocket (WSS) to the Asterisk PBX using credentials obtained from GET /api/auth/sip-webrtc.
Request Code Sample
# Health check on CRM API Server (Port 5000)
curl -X GET http://localhost:5000/api/health \
-H "Accept: application/json"
# Health check on Asterisk ARI Gateway (Port 4000)
curl -X GET http://localhost:4000/health \
-H "x-api-key: your-asterisk-api-key"Standard JSON Response
{
"status": "ok",
"services": {
"mongodb": "connected",
"redis": "connected",
"asterisk_bridge": "online",
"rabbitmq_exchange": "events.calls"
},
"timestamp": "2026-09-29T18:05:00.000Z"
}