Bitrix24 and Asterisk Integration: AMI, Call Recordings, CRM

Our company is engaged in the development, support and maintenance of Bitrix and Bitrix24 solutions of any complexity. From simple one-page sites to complex online stores, CRM systems with 1C and telephony integration. The experience of developers is confirmed by certificates from the vendor.
Showing 1 of 1All 1626 services
Bitrix24 and Asterisk Integration: AMI, Call Recordings, CRM
Medium
~1-2 weeks
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1356
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    943
  • image_bitrix-bitrix-24-1c_development_of_an_online_appointment_booking_widget_for_a_medical_center_594_0.webp
    Development based on Bitrix, Bitrix24, 1C for the company Development of an Online Appointment Booking Widget for a Medical Center
    693
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    828
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    731
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    1072

We often hear from companies: 'We already have Asterisk, everything is configured, ten operators, a hundred calls a day. Now we've taken Bitrix24 — how do we connect without redoing the telephony?' Good news: you won't have to throw away Asterisk. Integration via AMI or SIP trunk allows you to keep your existing PBX and get all CRM features: pop-up call card, automatic lead creation, call recording. Over 5 years we've set up such connections for dozens of clients — from startups to companies with call centers of 50 operators. Equipment savings with this approach reach 30%.

How to Integrate Bitrix24 with Asterisk Without Losing Flexibility?

There are two main architectural approaches: SIP trunk and AMI/AGI-integration. The choice depends on whether you want to move the media stream to the cloud or keep routing on Asterisk.

What Does AMI-Integration Provide Compared to SIP Trunk?

SIP trunk — Asterisk registers as a SIP trunk in the Bitrix24 cloud PBX. All voice passes through Bitrix24 servers, adding latency. AMI integration (via Asterisk Manager Interface) transmits only events: call started, ended, duration. The media stream stays local — sound quality does not degrade. For companies with an already configured provider, AMI is the optimal choice. AMI establishes connections 2 times faster than SIP trunk.

Characteristic SIP trunk AMI integration
Routing In Asterisk or in the cloud Only in Asterisk
Latency + (through Bitrix24 servers) Minimal (local)
Setup complexity Medium, requires SIP config Higher, requires AMI daemon
IVR/queue flexibility Limited by cloud PBX capabilities Full, Asterisk
Call recording Automatically in Bitrix24 Via API, with file attachment
Performance Lower due to extra hop Higher, media does not leave local network

According to Asterisk documentation, AMI provides management via TCP connection.

Setting Up AMI Integration: Step-by-Step Instructions

Let's deploy a typical scheme:

  1. Create an AMI user in /etc/asterisk/manager.conf:

    [bitriks_agi]
    secret = your_secret_password
    read = call,cdr
    write = originate
    permit = 127.0.0.1/255.255.255.0
    
  2. Run a daemon (on Node.js, PHP, or Python) that listens to AMI events:

    • Newchannel — incoming call
    • Hangup — termination
    • Bridge — operator answered
  3. On Newchannel, call the Bitrix24 REST API:

    POST /rest/telephony.externalcall.register
    {
      "USER_PHONE_INNER": "101",
      "USER_ID": 5,
      "PHONE_NUMBER": "+74951234567",
      "CALL_START_DATE": "2024-01-15T10:30:00+03:00",
      "CRM_CREATE": "Y",
      "CRM_SOURCE": "CALL_TRACKER",
      "TYPE": 2
    }
    
  4. Save CALL_ID — it is needed for finishing and attaching the recording.

  5. On Hangup, finish the call:

    POST /rest/telephony.externalcall.finish
    {
      "CALL_ID": "saved_CALL_ID",
      "USER_ID": 5,
      "DURATION": 185,
      "STATUS_CODE": "200",
      "ADD_TO_CHAT": "Y"
    }
    

How to Transfer Call Recordings to Bitrix24?

Asterisk saves the recording file. After the call, we transfer it via REST API:

POST /rest/telephony.externalCall.attachRecord
{
  "CALL_ID": "CALL_ID",
  "FILENAME": "record.mp3",
  "FILE_CONTENT": "<base64>"
}

For conversations longer than 5 minutes, base64 is inefficient. We use disk.file.uploadurl.prepare — get a link for direct upload.

Outgoing Calls from CRM

Manager clicks a number in the card — Asterisk must call. We subscribe to the OnExternalCallStart event and execute Originate via AMI:

Action: Originate
Channel: SIP/101
Exten: +74951234567
Context: outbound
Priority: 1
CallerID: "Ivanov Petr" <+74955551234>

Case from Our Practice: Call Center for 12 Operators

A few years ago, a telecommunications company approached us. They had their own Asterisk 18, 12 operators, multi-level IVR, and queues. They needed to implement Bitrix24 for client communication history but did not want to change the working PBX.

We chose AMI integration. The difficulty arose with queues: a call could be transferred between operators. The standard AMI handler attached the call to the first operator, even though another answered. We solved it by tracking the AgentConnect event — this event records which agent actually took the call from the queue. Thanks to this, the CRM had correct assignment to the right manager.

The entire integration setup (with recording transfer and outgoing calls) took 6 business days. The company still works on this scheme — stable, without failures.

What Is Included in the Integration Work?

Stage Duration Result
Audit of current Asterisk configuration 1 day Routing scheme, provider list
Architecture design 1-2 days Choice of approach (AMI/SIP), API specification
Daemon development 3-4 days Working module with logging
Bitrix24 setup (widgets, REST user) 1 day CRM integration ready
Testing and debugging 1-2 days Verification of all scenarios
Documentation and training 1 day Administrator instructions

Total: 5 to 8 business days turnkey. Project cost depends on scheme complexity — we will calculate individually after audit.

Common Mistakes and How to Avoid Them

  • Duplicate calls in CRM. On call transfer, Asterisk creates a new channel. Filter by LinkedID in AMI events — it remains constant.
  • Recording not attached. The file may not be ready at the time of Hangup. Add a 5-10 second delay or track file appearance via inotify.
  • Incorrect assignment to operator. In queues, use AgentConnect, not Newchannel.

Why Entrust the Integration to Us?

We have over 5 years of experience with Bitrix24 and Asterisk. Completed more than 30 telephony integration projects. Certified 1C-Bitrix specialists. We guarantee stable operation and post-launch support. If you have a non-standard configuration, we will assess the project for free and offer the optimal solution. Contact us to discuss details. Get a free engineer consultation.

Turnkey Telephony Setup: From SIP to CRM

SIP trunk not registering — the first problem when connecting telephony to Bitrix24. The client sends provider data, you enter it in "Telephony → Telephony Settings → SIP Connector", and the status hangs "Waiting for registration". Ports 5060/5061 for SIP and range 10000–20000 for RTP are blocked on the firewall — classic. Or codec G.729 is not supported, and G.711 consumes 87 kbit/s per line. For 20 simultaneous conversations — count yourself. We connect and configure telephony so that calls are not lost, routing works according to business logic, and CRM receives data automatically.

SIP (Session Initiation Protocol) — standard for voice communication over the internet. Our specialists have 5+ years of experience integrating with Bitrix24. Warranty on configured solutions — 1 year. Contact us for a free audit of your current infrastructure — we often find blind spots: missed calls without tasks, managers with status "On line" and zero calls, IVR branches that no one reaches.

How to Avoid Failures in SIP Registration and Connection?

Improper NAT, closed ports, or incompatible codecs — 90% of failures. We check codec support on the operator's side, configure keepalive and backup SIP servers. After setup, registration stays stable for months.

You already have a contract with an operator, and changing numbers is not an option. We connect to Bitrix24 via SIP connector. For stable operation, you need a channel: at least 100 kbit/s per line for G.729, 87 kbit/s for G.711a.

Typical tasks:

  • City numbers from any operator — preserved when switching to B24
  • 8-800 numbers for inbound — routing via CRM
  • Multi-line numbers with department distribution via IVR
  • Analog lines via Grandstream or Linksys VoIP gateways

Where it usually gets stuck:

  • SIP/RTP ports are closed at the provider or router level
  • NAT not forwarded correctly — one-way audio
  • Different codecs on the PBX and Bitrix side — no audio at all

We solve these problems in 1–3 days, not weeks.

Step-by-step instructions for connecting via SIP trunk:

  1. Check SIP (5060/5061) and RTP (10000–20000) ports are open on the firewall.
  2. Agree on codecs: G.711 or G.729 — test both options.
  3. Configure SIP connector in Bitrix24 admin: login, password, provider domain/IP.
  4. Enable keepalive (30–60 second interval) for stable registration.
  5. Test two-way audio with a test call.
  6. Configure backup SIP server in case of primary failure.

Cloud PBX or SIP Trunk: Which to Choose?

Cloud PBX requires no hardware — set up in 1–2 days. SIP trunk retains your numbers and allows a hybrid scheme with an on-premise PBX. Cloud PBX is configured 2-3 times faster and saves up to 40% of budget compared to maintaining your own infrastructure. Compare providers based on real cases.

Provider Real Benefit Pitfalls
Bitrix24.Telephony Built-in, setup via portal UI Tied to B24 tariff, more expensive at scale
Sipuni Native module for B24, quick integration Limited number geography
Mango Office Powerful analytics, speech analytics included Above-market price
UIS (CoMagic) Call tracking + PBX all-in-one Complex admin panel
Zadarma 70+ countries, budget-friendly API sometimes slow, support slow
MegaFon PBX FMC — mobile as office SIP setup via support, not UI
MTT Flexible tariffs, good API No native module for B24
Rostelecom Stability, government sector Slow setup, bureaucracy

Why Do You Need Call Recording and How to Set It Up?

All incoming and outgoing calls are recorded automatically. Storage — Bitrix24 cloud (tariff limited) or your own server via the voximplant module. Each recording is attached to a CRM card: contact, deal, lead. Listening — from the deal timeline.

Control tools:

  • Recording notification — mandatory under 152-FZ, configured in IVR
  • AI transcription — speech recognition via built-in CoPilot module or external service. Converts calls to text, searchable by keywords
  • Sentiment analysis — system flags negative calls. Not a replacement for listening, but filters 90% of routine
  • Selective recording — only incoming, only specific departments
  • Automatic duration control — calls shorter than 15 seconds almost always indicate a problem: dropped, not reached, manager didn't pick up

Manager sees summary reports: number of calls per manager, average duration, missed calls without callbacks. The last point is the most painful: a missed call without a callback task equals a lost client.

Typical Routing Mistakes

Routing is the most fragile part. Set up "in order", but the manager logged in and went to lunch — the call hangs for 40 seconds and drops. Or IVR with five nesting levels — the client hangs up on the third. We use working distribution scenarios:

  • By CRM responsible — number found in database, call goes directly to manager
  • In order — even load among operators with "On line" status
  • By departments via IVR — voice menu, max two levels. More means lost calls
  • By time — working/non-working hours, weekends
  • By region — detected by number code, distributed to local managers

On incoming call, the system performs: Number found in CRM:

  • Route to responsible manager
  • Pop-up card: name, company, open deals, contact history
  • If manager doesn't answer within 15 seconds — forward to colleague, then to supervisor

Number not found:

  • Automatically creates a lead in CRM (setting Telephony → CRM Integration → Create lead for unknown number)
  • Call distributed by queue
  • All information recorded for later processing

How to Automate Work with CRM Integration?

Pop-up card on incoming call shows:

  • Name, company, position
  • Current deals with statuses
  • Last 5 interactions — calls, emails, chats
  • Customer comments
  • Buttons: "Create deal", "Set task", "Transfer call"

Automation via business processes is configured in "CRM → Robots and triggers":

  • Missed call → lead + callback task for responsible
  • Call end → record activity in deal timeline
  • Missed without callback within 30 minutes → notify supervisor
  • Incoming from client with overdue deal → escalation

Analytics available in "Telephony → Balance and statistics" and CRM reports:

  • Number of calls by manager, department, direction
  • Average duration and hold time
  • Missed call percentage with weekly trend
  • Call-to-deal conversion — most important metric for sales

How to Increase Conversion with Callback, Auto-dialer, and Voice Menu?

"Call me back" widget on website — one field (phone), nothing extra. The system calls the manager first, then the client. Each request automatically creates a lead in CRM. Anti-spam: limit requests from one number. A/B testing placement — widget bottom right converts better than left, but depends on design. Callback reduces missed calls by up to 30% compared to manual dialing.

Auto-dialer:

  • Dial segment from CRM — manager connects after client answers
  • Robotic dial with voice message — order confirmations, appointment reminders
  • IVR scenarios: "press 1 to confirm"
  • Scheduled with time zone awareness — module checks region by number code

Building a voice menu:

  • Welcome message — company name, recording notice
  • Department selection via DTMF — max 4–5 items
  • Music on hold with queue position
  • Non-working hours — voicemail or informational message

Recording by professional voice actor — worthwhile for greeting and main menu. Deeper levels — speech synthesis, easier to update.

Which codecs to choose for stable operation? G.711 (A-law/µ-law) — standard codec, bandwidth 87 kbit/s per line. G.729 — compressed codec, 31 kbit/s. If bandwidth is limited, G.729 is preferred, but not all providers support it. Also possible G.722 (HD voice) — requires 64 kbit/s and PBX support.

What's Included in Telephony Setup?

Deliverables after project completion:

  • Configured SIP registration (cloud PBX or SIP trunk turnkey)
  • Working call routing (by CRM, queue, IVR)
  • Call recording with cloud or server storage
  • CRM integration: pop-up cards, auto lead creation, business processes
  • Callback widget on website
  • Voice menu (IVR) with voice actor recording or synthesis
  • Configuration documentation and staff training (2 sessions)
  • Technical support for one month after launch

Everything included in the comprehensive setup — no hidden extras. Order telephony setup and get a ready-made infrastructure for working with clients.

Setup Timeline and Pricing

Task Timeframe
Cloud PBX + basic routing 1–2 days
SIP trunk (if provider releases data quickly) 1–3 days
Routing + IVR 2–5 days
CRM integration: robots, triggers, cards 3–5 days
Callback widget 1 day
Comprehensive setup with audit 2–3 weeks

Pricing is calculated individually — depends on number of lines, routing complexity, and required integrations. Average budget for setup ranges from several thousand to tens of thousands in local currency depending on scope. We'll evaluate your project in 1 day. Start with a free audit of your current infrastructure — we often find blind spots: missed calls without tasks, managers with "On line" status and zero calls, IVR branches that no one reaches. Contact us for a consultation — we'll offer the optimal solution for your budget and business processes.