amoCRM Integration
Click-to-call, call logging and pipeline sync with amoCRM.
Connect Astervis to amoCRM and your agents stop switching windows. Calls dial straight from the contact card, an incoming-call popup shows who's calling before anyone picks up, and every call is logged back to amoCRM with a playable recording. Behind the scenes Astervis keeps your pipelines, stages and users in sync so call data lands on the right deal.
Everything runs on the same on-premise stack you already installed — your call data and recordings never leave your server. amoCRM only ever sees what you choose to log: a call entry, a recording link, and the contacts or deals you ask it to create.
This page is for an admin connecting amoCRM for the first time. You'll need admin access to both your Astervis instance and your amoCRM account, plus the ability to create an integration in the amoCRM developer area.
Before you start
Astervis must be installed
A running Astervis instance on your PBX server, reachable on port 8443.
ARI must be reachable
The integration links live calls through Asterisk's REST Interface (ARI).
Concretely, you need:
- An Astervis instance reachable from the internet on its single exposed port —
https://<your-domain-or-IP>:8443. amoCRM's OAuth redirect and webhooks call back to this URL. - Call recordings mounted into the stack. The installer mounts your PBX's recording directory read-only —
/var/spool/asterisk/monitor:/records— so Astervis can serve recordings to amoCRM without copying audio anywhere. - An amoCRM account where you can create an integration (Settings → Integrations → Create integration).
Connecting via OAuth
amoCRM uses the standard OAuth 2.0 authorization-code flow. You register an integration in amoCRM, point it at Astervis, and approve it once. Astervis stores the resulting tokens and refreshes them automatically — you won't touch them again unless you disconnect.
Create the integration in amoCRM
In amoCRM, go to Settings → Integrations → Create integration. Set the redirect URI to your Astervis callback:
https://<your-domain-or-IP>:8443/api/v1/amocrm/callbackGrant the integration access to contacts, deals (leads), pipelines, users and calls. amoCRM gives you a Client ID and Client Secret — keep them handy.
Enter the credentials in Astervis
Open Settings → Integrations → amoCRM in the Astervis admin panel and
paste the Client ID, Client Secret and your amoCRM account subdomain (the
*.amocrm.ru / *.amocrm.com part of your URL).
Authorize
Click Connect. Astervis sends you to amoCRM's authorize screen. Approve
the requested scopes. amoCRM redirects back to the callback endpoint with a
one-time code, which Astervis exchanges for an access token and a refresh
token.
Confirmed
You land back on the integration page showing Connected. Astervis immediately runs a first sync of your pipelines and users (see Pipeline & user sync).
Tokens refresh on their own. amoCRM access tokens are short-lived; Astervis uses the refresh token to renew them before they expire, so the connection stays live without any manual re-authorization.
Disconnecting
To stop the integration, open Settings → Integrations → amoCRM and click Disconnect. Astervis revokes its stored tokens and stops sending and receiving amoCRM events. Your historical call records and recordings stay in Astervis — disconnecting only severs the link to amoCRM; it doesn't delete anything.
The four OAuth-lifecycle endpoints map to these actions:
| Endpoint | What it does |
|---|---|
authorize | Redirects the admin to amoCRM's consent screen. |
callback | Receives the auth code and exchanges it for tokens. |
connect | Saves credentials and marks the integration active. |
disconnect | Revokes tokens and deactivates the integration. |
What the integration does
Once connected, the integration covers the full call lifecycle inside amoCRM — placing calls, announcing incoming ones, and logging the result.
Click-to-call
Dial any number straight from the amoCRM contact or deal card.
Incoming-call popup
A live notification shows the caller and matched contact before pickup.
Call logging
Every call is written back to amoCRM with direction, duration and a recording.
Missed-call follow-up
A callback task is created automatically when a call is missed.
Auto-create contact / deal
Unknown numbers can spin up a new contact and deal on the fly.
Pipeline & user sync
Pipelines, stages and operators stay aligned between the two systems.
Click-to-call
An agent presses Call on a contact or deal in amoCRM. Astervis originates the call through Asterisk: it first rings the agent's own extension (their SIP phone or softphone), and once they answer, it dials the customer's number and bridges the two legs. Because the call is placed by your PBX, it uses your trunks, your caller ID and your dial plan — amoCRM is only the trigger.
Incoming-call popup
When a call arrives, Astervis matches the caller's number against your amoCRM contacts and pushes a popup to the agent's amoCRM screen — who's calling, which contact and deal it belongs to, and the call's state — all before they pick up. The popup updates live as the call is answered and ends, so the agent always sees the current state without refreshing.
Call logging with recordings
When a call finishes, Astervis writes a call entry back to amoCRM: direction (incoming / outgoing), duration, the operator who handled it, and a link to the recording. The recording itself never leaves your server — Astervis serves it from the read-only /records mount and amoCRM embeds the link.
Recording links are HMAC-signed. Astervis doesn't expose raw recording
paths. Each link carries a SHA-256 HMAC signature derived from a server-side
secret, so only links Astervis generated will play, and they expire after a
set window. The signing key is the RECORDING_SIGN_SECRET environment
variable — the installer generates it for you. Keep it secret; rotating it
invalidates every previously issued link.
You normally won't set this by hand, but for reference it lives in the stack's environment:
# Signs every recording URL handed to amoCRM (auto-generated by the installer)
RECORDING_SIGN_SECRET=<random-secret>Missed-call callback task
If a call goes unanswered, Astervis automatically creates a follow-up task in amoCRM on the relevant contact or deal, so the missed caller doesn't fall through the cracks. The agent sees a "call back" task in their amoCRM queue with the number and time of the missed call.
Auto-create contact and deal
When a call comes from a number that isn't in amoCRM yet, Astervis can create the contact — and optionally a deal in your default pipeline — automatically, then attach the call log to it. This keeps your pipeline complete without agents manually adding every first-time caller. You control whether auto-creation is on, and which pipeline new deals land in, from the integration settings.
Pipeline & user sync
Astervis keeps a local picture of your amoCRM pipelines, stages and users so it can route call logs and tasks correctly and show meaningful names in dashboards. The first sync runs right after you connect; afterwards amoCRM's webhooks notify Astervis of changes in near real time, and you can trigger a manual resync from the integration page at any time.
How call linking works
The hard part of any telephony-to-CRM integration is matching a live phone call to the right CRM action at the right moment. Astervis does this with a dedicated ARI service for amoCRM — a small piece of the backend that listens to your PBX and drives amoCRM accordingly.
Asterisk emits channel events
Astervis holds an ARI (Asterisk REST Interface) connection to your PBX and subscribes to channel events — a channel being created, a state change (ringing → answered), and the channel being destroyed (hangup).
The amoCRM service reacts
The integration's ARI service translates those raw channel events into call intent: a new inbound call → fire the incoming-call popup and match the contact; an answered call → update the popup; a hangup → write the call log, attach the recording, and create a missed-call task if nobody answered.
amoCRM is updated over its REST API
Astervis calls amoCRM's REST API to search contacts, push the call entry, create deals or tasks, and deliver the recording link. The agent's amoCRM screen receives live updates as the call progresses.
Because linking is driven by Asterisk channel events rather than polling, the popup and the call log reflect what's actually happening on the line — there's no lag waiting for a CDR to land.
Requirements at a glance
Troubleshooting
Related
Last updated on