amoCRM Integration
Connect amoCRM for click-to-call, incoming call notifications, and automatic call logging
The amoCRM integration enables click-to-call directly from the customer card, incoming call notifications, automatic call logging with recordings, and CRM data synchronization.
Features
| Feature | Description |
|---|---|
| Click-to-call | Call a customer with one click from the amoCRM widget |
| Incoming calls | Pop-up notification with contact name on incoming call |
| Call logging | Automatic call record in the contact card |
| Call recordings | Listen and download recordings from amoCRM |
| Missed calls | Automatic "Callback" task on missed call |
| Auto-create contacts | New contact + deal when an unknown number calls |
| Pipeline sync | Import pipelines and statuses from amoCRM |
| User sync | Map amoCRM users to Astervis operators |
| Contact sync | Import contacts with phone numbers |
| Deal sync | Import deals linked to contacts |
| Company sync | Import companies from amoCRM |
Requirements
- amoCRM account with admin access
- Astervis version 1.0.78 or higher
- Configured ARI (Asterisk REST Interface) on the PBX server
When installing via astervis-installer v0.0.52+, ARI is configured automatically.
Setting Up
Copy the API Token in Astervis
- Go to Settings → Integrations → amoCRM (click "Manage")
- In the AmoCRM Widget section, copy the API Token
The API Token is needed to link the amoMarket widget to your Astervis server.
Install the widget from amoMarket
- Open amoMarket and find Astervis Telephony
- Fill in the widget details:
- Astervis Server URL — your server address (e.g.,
https://mycompany.astervis.io:8443) - API Token — copied from the previous step
- Astervis Server URL — your server address (e.g.,
- Click Save
Connect AmoCRM via OAuth
- Go back to Astervis → Settings → Integrations → amoCRM
- In the Connect to AmoCRM section, enter your amoCRM subdomain (e.g.,
mycompany) - Click Connect AmoCRM
- The amoCRM authorization page will open — click Allow to grant access
Sync data
After successful authorization, perform the initial sync:
- Go to the Pipelines tab → click Sync
- Go to the Users tab → configure mapping and sync
- If needed, sync Contacts, Deals, Companies
User Mapping
For click-to-call to work correctly, you need to map amoCRM users to Astervis operators.
- Go to the Users tab
- Click Sync amoCRM Users
- In the table, for each amoCRM user select the corresponding Astervis operator
- Click Save Mapping
Without user mapping, click-to-call will not work because the system cannot determine which extension to use for the call.
Click-to-call
After setting up user mapping, the widget allows one-click calling:
- Open a contact card in amoCRM
- In the Astervis widget, click a phone number or the call button
- First, a call will ring on your extension (SIP phone or softphone)
- After you answer, the system automatically dials the customer's number
How it works
Incoming Calls
On incoming calls, the amoCRM widget automatically shows a pop-up notification:
- Known contact — displays the name with a link to the contact card
- Unknown number — automatically creates a new contact and deal
What happens on an incoming call
- Asterisk receives an incoming call via trunk
- Astervis detects the call via
ChannelCreatedevent through ARI WebSocket - The system searches for the contact by phone number in amoCRM
- If found — sends a notification with contact data to the widget
- If not found — creates a new contact and deal, then sends the notification
Incoming call detection works universally on any FreePBX/Asterisk configuration, without dialplan changes.
Missed Calls
When an incoming call is missed, the system automatically:
- Sends a
call_missednotification to the widget - Creates a "Callback" task in amoCRM linked to the contact
- The task is of type "Call" with a deadline of tomorrow
Call Logging
All completed calls are automatically logged to the contact card in amoCRM:
| Field | Description |
|---|---|
| Direction | Inbound / Outbound |
| Duration | Call duration in seconds |
| Status | Answered / Not answered |
| Recording | Link to listen/download |
| Source | "Astervis" |
| Date and time | Call start time |
Call Recordings
If Asterisk records calls, recordings are automatically attached to the call log. Recording links are:
- Protected with HMAC signature (SHA-256)
- Valid for 30 days
- Available for playback directly in amoCRM
Asterisk typically stores recordings in /var/spool/asterisk/monitor/. This directory is mounted into the backend Docker container as /records.
Data Synchronization
Pipelines
Import pipelines and their statuses from amoCRM:
- Go to the Pipelines tab
- Click Sync
- All pipelines with their stages will be imported
Contacts
Import contacts with phone numbers:
- Go to the Contacts tab
- Select a date range (optional)
- Click Sync
Deals
Import deals linked to contacts and pipelines:
- Go to the Deals tab
- Select a date range
- Click Sync
Companies
Import companies from amoCRM:
- Go to the Companies tab
- Click Sync
Troubleshooting
Authorization error
- Check that the subdomain is entered without
.amocrm.ru(e.g., justmycompany) - Ensure the Astervis Telephony widget is installed in amoMarket and the API Token is entered correctly
- Verify that your Astervis server is reachable at the specified URL
Click-to-call not working
- Make sure user mapping is configured
- Check that ARI is connected (backend logs should show
ARI WebSocket connected) - Ensure the operator is using a SIP phone or softphone registered on the PBX
No incoming call notifications
- Check that the widget is installed and Widget Token is entered
- Ensure ARI WebSocket is connected with
subscribeAll=true - Check backend logs for
[ARI] Incoming call detected
Recordings not attaching
- Verify the recordings directory is mounted (
/var/spool/asterisk/monitor:/records) - Ensure
RECORDING_SIGN_SECRETis set in.env - Check recording file name format (should contain the phone number)
Architecture
- SSE — real-time events from backend to widget (incoming call, answer, hangup)
- ARI WebSocket — channel events from Asterisk (ChannelCreated, ChannelStateChange, ChannelDestroyed)
- Redis Pub/Sub — internal event bus between modules
- amoCRM REST API — contact search, task creation, call logging
Last updated on