Bitrix24 Integration with MTT
MTT (Mezhregionalny TranzitTelecom) is a Russian telecommunications operator with a virtual PBX service for businesses. Companies often choose MTT for its broad geographic number coverage and competitive outbound call rates. The integration with Bitrix24 is built via the MTT REST API and webhooks.
MTT Virtual PBX API: What Is Available
MTT provides an HTTP API for managing the virtual PBX and receiving call events. Documentation is available in the MTT management portal (the "API" section).
Key events for integration with Bitrix24:
| MTT Event | Description | Action in Bitrix24 |
|---|---|---|
incoming_call |
Inbound call | telephony.externalcall.register |
answer_call |
Operator answered | Update call status |
end_call |
Call ended | telephony.externalcall.finish |
miss_call |
Missed call | telephony.externalcall.finish (STATUS_CODE=304) |
MTT sends notifications to the configured URL as POST JSON. Configuration in the MTT management portal: PBX Settings → Integrations → HTTP Notifications.
Handler Architecture
The MTT handler works similarly to other virtual PBX integrations with one important consideration: MTT delivers events in real time with no delivery guarantees. Idempotency must be implemented — processing the same event twice must not create duplicates in Bitrix24.
Idempotency via cache with TTL:
$cacheKey = 'mtt_call_' . $event['call_id'] . '_' . $event['type'];
if ($cache->exists($cacheKey)) {
// This event has already been processed
http_response_code(200);
exit;
}
$cache->set($cacheKey, 1, 3600); // TTL 1 hour
// Process the event
Extension Mapping
MTT Virtual PBX identifies employees by extension numbers. In Bitrix24, employees are identified by USER_ID. The mapping table is stored in the handler configuration or in a database.
A separate scenario — group calls, where MTT rings multiple operators simultaneously. In the answer_call event, MTT specifies who actually answered. It is important to use this number for USER_ID in Bitrix24, not the number the call was originally directed to.
Call Recordings: Download via API
MTT stores recordings on its servers. Access via API:
GET https://api.mtt.ru/v1/records/{call_id}
Authorization: Bearer {api_key}
The response contains the download URL. The file is available for 90 days by default (configurable in the plan).
After obtaining the file — standard upload to Bitrix24 via telephony.externalCall.attachRecord.
Configuring Multiple MTT Numbers
Companies with multiple city numbers on MTT can route all numbers to one group of operators or split by department. In the Bitrix24 integration, this matters for correctly determining LINE_NUMBER — Bitrix24 uses this to identify which line the call belongs to.
MTT passes the to_number field in the event — the number that was dialed. The handler uses this field to determine LINE_NUMBER:
$lineMap = [
'+74991234567' => '100', // Sales department line
'+74997654321' => '101', // Support line
];
$lineNumber = $lineMap[$event['to_number']] ?? '100';
Case Study: Trade Automation Company
A company with 15 managers and two groups: inbound sales and technical support. MTT was used as the primary operator with two city numbers. Integration requirement: calls to the sales number go to sales managers, calls to the support number go to technical specialists. Missed calls — automatic callback via Bitrix24 robots.
The challenge: MTT recorded a missed call as a miss_call event only if none of the operators answered. If an operator picked up and immediately hung up (under 3 seconds), the event came as end_call with duration < 3. The handler checked the duration: if duration < 3 — the call was marked as missed in Bitrix24.
Automatic callback for missed calls was set up via a Bitrix24 robot: creating a new lead and launching a chain with a callback task after 10 minutes.
Setup time: 4–6 business days.







