Bitrix24 Integration with Gravitel
Gravitel is a cloud-based PBX with a full set of telephony functions: multi-channel numbers, IVR, queues, call recording. Connecting it to Bitrix24 combines telephony and CRM in one work environment. Managers call from a client card, see who's calling before picking up, and supervisors get call statistics without exporting data from different systems.
Ready-made app vs custom integration
Gravitel offers an app in the Bitrix24 marketplace. It covers basic scenarios but has limitations.
| Feature | Marketplace app | Custom integration (REST API) |
|---|---|---|
| Incoming calls with CRM card | Yes | Yes |
| Outgoing click-to-call | Yes | Yes |
| Call recording in CRM | Yes (link to Gravitel) | Yes (file upload to B24) |
| Custom routing based on CRM data | No | Yes |
| Auto lead creation with custom logic | Basic logic | Any logic |
| IVR with Bitrix24 data | No | Yes |
| Multi-line support | Limited | Full support |
The app is suitable for teams up to 15–20 people with standard scenarios. For call centers and sales departments with custom routing, a custom integration via the telephony.* REST API is needed.
Connection via app
Setup procedure:
- Install the "Gravitel" app from the Bitrix24 marketplace.
- In the app settings, enter the API key from your Gravitel personal account.
- Map internal PBX numbers to Bitrix24 users.
- Enable call recording in Gravitel settings (if not already enabled).
- Configure rules for creating CRM entities: lead on first call, contact binding on repeat call.
After installation, incoming calls display the client card, and outgoing calls are triggered by clicking a number in CRM.
Custom integration via REST API
We use the telephony.* method group from Bitrix24 and the Gravitel API. Architecture:
-
Incoming call. Gravitel sends a webhook to our handler. The handler calls
telephony.externalcall.registerwith the number and employee internal ID. Bitrix24 displays the card. -
Call completion. Gravitel sends a second webhook with duration and status. The handler calls
telephony.externalcall.finishand, if a recording exists,telephony.externalcall.attachRecord. -
Outgoing call. User clicks a number in B24. The
OnExternalCallStartevent is sent to the handler, which initiates a callback via the Gravitel API.
Call routing and IVR setup
Call routing on the Gravitel side determines which manager receives the call. Typical schemes:
By department. An incoming number is tied to a department. A call to the sales department number → queue of sales managers. A call to the support number → queue of support staff. In Gravitel's PBX, this is configured through call handling scenarios.
By responsible person from CRM. In custom integration, the webhook handler for an incoming call searches for a contact in CRM via crm.contact.list by phone number. If the contact is found and a manager is assigned — the call is directed to that manager's internal number via the Gravitel API. If not found — the call goes to the general queue.
IVR with CRM data. Gravitel's voice menu can query an external service for where to route the call. The handler checks in Bitrix24:
- whether there's an open deal for the caller — if yes, connect to the responsible person
- VIP client (by a CRM field value) — priority queue
- after hours — transfer to the on-call manager's mobile
To implement this, the Gravitel call scenario is configured with an HTTP request to our endpoint, which returns the internal destination number.
Call queues
Gravitel supports distribution strategies: ring all, sequential, random, least busy. Combined with B24, we add logic:
- If a manager is in "Do Not Disturb" status in Bitrix24 — exclude from queue
- If a manager doesn't answer within 15 seconds — switch to next + notification in B24 chat about the missed call
Call recording
Gravitel stores recordings on its servers for 6 months (depends on plan). Storage options:
- Link in CRM card. Quick, doesn't take space in B24. Downside — recordings disappear after deletion from Gravitel.
-
Upload to B24. A script retrieves the recording file via the Gravitel API and uploads it to B24 Drive, then attaches it to the call via
telephony.externalcall.attachRecord. Recordings are stored indefinitely (within B24 plan limits).
What to verify after setup
- Incoming from new number → lead created with phone filled in
- Incoming from existing contact → client card shown to responsible manager
- Outgoing click-to-call → correct connection via callback
- Missed call → task created for manager to call back
- Call recording → accessible in CRM entity timeline
- Routing by responsible person → call reaches the right manager
- IVR → correct handling of branches







