Bitrix24 Integration with 3CX
3CX is a commercial IP PBX with a well-designed web interface and its own ecosystem of client applications. Unlike Asterisk, 3CX provides a structured API for integrations — which simplifies the task but also imposes constraints on architectural decisions.
Two Official Integration Methods
Built-in CRM Integration in 3CX. 3CX has a Settings → CRM Integration section where you can configure call event forwarding to external CRMs. Bitrix24 is not listed among the preconfigured CRMs in 3CX by default, but it is supported via Custom CRM — a mechanism based on HTTP request templates.
3CX Call Flow Designer (CFD) + Webhooks. CFD is a visual call-flow designer in 3CX that allows HTTP requests to be made on specific call events. It is more flexible than CRM integration and suitable for non-standard scenarios.
Configuration via Custom CRM Integration
In the 3CX Management Console → CRM Integration → Custom CRM:
Call Answered URL:
https://your_portal.bitrix24.com/rest/KEY/telephony.externalcall.register/
Request parameters are passed in the POST body:
{
"USER_PHONE_INNER": "%Ext%",
"PHONE_NUMBER": "%CallerNumber%",
"CALL_START_DATE": "%CallStarted%",
"CRM_CREATE": "Y",
"TYPE": "%Direction%"
}
3CX supports placeholder variables: %Ext% — extension number, %CallerNumber% — caller number, %Direction% — direction (1=inbound, 2=outbound). The full list of variables is in the 3CX documentation.
Call Ended URL:
https://your_portal.bitrix24.com/rest/KEY/telephony.externalcall.finish/
Parameters:
{
"CALL_ID": "%call_id_saved%",
"DURATION": "%TalkDuration%",
"STATUS_CODE": "200"
}
The issue: Custom CRM Integration in 3CX provides no state-storage mechanism (you cannot save the CALL_ID from the Bitrix24 response and pass it upon call completion). This is the key limitation — a full integration with CALL_ID persistence requires an intermediate server.
Intermediate Server: Solving the CALL_ID Problem
Architecture with an intermediate handler:
3CX → webhook → PHP/Node.js handler
↓
Bitrix24 REST API → receive CALL_ID
↓
Store CALL_ID in Redis/DB with key = call UNIQUEID
↓
3CX → completion webhook → handler
↓
Retrieve CALL_ID from Redis
↓
telephony.externalcall.finish
↓
Attach recording
This adds an infrastructure component but provides full control over the integration.
Call Recordings in 3CX
3CX saves recordings to the server directory or cloud storage (depending on version and settings). Access to files via the 3CX Recording Storage API or directly via the filesystem.
To transfer to Bitrix24 — a script runs after the call ends, queries the 3CX API to get the recording link, and uploads it via telephony.externalCall.attachRecord.
3CX returns the recording link via the calls API:
GET /api/recordings?callId={callId}
Authorization via JWT token (3CX version 18+): Authorization: Bearer <token>.
3CX SBC and NAT Issues
3CX is often deployed with an SBC (Session Border Controller) for NAT traversal. When integrating with Bitrix24 via SIP trunk, ensure the external SBC IP is registered in the Bitrix24 SIP trunk settings. Otherwise — one-way audio during calls from Bitrix24 to 3CX.
Case Study: Distributed Team, 3CX in the Cloud
An IT company with offices in two cities used 3CX Hosted (cloud version). Requirement: when a client calls a Moscow number and reaches a St. Petersburg manager, the call in Bitrix24 should be created for the St. Petersburg manager and linked to the Moscow inbound number.
3CX Custom CRM Integration does not support mapping extension numbers to Bitrix24 users. The solution was an intermediate handler with a mapping table: 3CX extension → Bitrix24 USER_ID. When registering the call, the handler looks up the table and inserts the USER_ID of the correct user.
Setup time: 5–7 business days.







