An e-commerce store with 50 operators reduced telephony costs by 40% after integrating Asterisk — savings amounted to hundreds of thousands of rubles monthly. Cloud PBXs (Mango, Zadarma) are convenient for startups, but as the business grows, hidden fees, limits on concurrent calls, and vendor lock-in appear. Asterisk is an open-source IP-PBX running on your own server. No monthly fee, full control over routing and data. We have implemented over 50 telephony integration projects in recent years.
How does Asterisk integration with a website work?
The connection is built on three components: Asterisk Manager Interface (AMI) for events and commands, WebRTC for browser-based calls, and AGI for call processing scripts. For WebRTC, you need to set up a WebSocket proxy (e.g., nginx) and a STUN/TURN server — without these, calls won't pass through NAT. We use a modern architecture with the PAMI library in PHP and ARI (REST interface) for complex logic.
Browser (WebRTC/SIP.js) ←→ Asterisk (Kamailio/nginx + WebSocket) ↓ AMI (Asterisk Manager Interface) ↓ Backend API (PHP/Go/Node) ↓ Database + Redis (events) For scaling, we use a BFF layer (backend for frontend) that aggregates data from AMI and ARI. Call recordings are sent to S3-compatible storage, and metadata to Elasticsearch for fast search.
Why Asterisk is better than cloud PBXs?
| Criteria | Asterisk (own server) | Cloud PBX |
|---|---|---|
| Monthly fee | Only server hosting | Monthly fee per number |
| Control over recordings | Full (local storage) | Limited by tariff |
| CRM integration | Any via AMI/AGI | Via provider API |
| Scalability | Up to 1000+ concurrent calls | Depends on tariff |
| Reliability | 99.9% with proper setup | Provider SLA level |
At the scale of 20+ operators, Asterisk provides several times the savings. We tested load up to 5000 calls per hour — the system holds steady.
What problems does integration solve?
- Click-to-Call — one-click call from the site, no softphone installation.
- Dynamic routing — switch calls to available operators or IVR.
- Call recording — full archiving to S3 with playback from CRM.
- Call history — all events go to database and Elasticsearch for analytics.
- WebRTC in the browser — direct calls without additional applications.
How to set up WebRTC for browser calls?
Setting up WebRTC requires deploying a WebSocket proxy (nginx with stream module) and a STUN/TURN server. We use coturn as the TURN server and configure Asterisk with chan_pjsip for WebRTC. The browser uses SIP.js or JsSIP to connect to Asterisk via WebSocket. After that, calls go directly between the browser and the PBX, bypassing additional software.
What stages does the integration include?
The integration process consists of seven stages. The first two — audit and design — take up to a week. Then we deploy Asterisk, configure WebRTC, and write the AMI daemon.
| Stage | Duration | Result |
|---|---|---|
| Analysis | 2–3 days | Current telephony scheme, load profile |
| Design | 3–5 days | Integration architecture, stack selection |
| Asterisk setup | 5–7 days | Working PBX, WebRTC certificates |
| Daemon development | 7–10 days | AMI daemon in PHP/Go, REST API |
| Website integration | 5–7 days | WebRTC, click-to-call, modal window |
| Testing | 3–5 days | Load testing, call recording verification |
| Deployment | 2–3 days | Production, supervisor, monitoring |
We provide complete API documentation and train the administrator (1 hour). Also included: CI/CD setup for automatic daemon deployment, tests for AMI commands, and monitoring (Zabbix/Prometheus) for Asterisk health.
Typical integration mistakes
- STUN/TURN not configured — calls fail through NAT.
- AMI accessible without TLS — control interception.
- No supervisor for the daemon — daemon won't restart after crash.
- MixMonitor not archived — disk overflow.
- AMI user permissions not restricted — risk of compromise.
To avoid these issues, order integration from us — we anticipate them at the design stage.
What's included in the work
- Project documentation: integration scheme, API description, access rights.
- Access to the Asterisk server and web application.
- Administrator training (1 hour): routing setup, statistics viewing, number addition.
- Warranty support for 1 month after deployment: bug fixes, consultations.
Timelines and cost
Full integration takes from 3 to 5 weeks depending on scenario complexity and current infrastructure. The cost is calculated individually. Contact us to discuss your project and get a preliminary estimate. Order Asterisk integration — get a free engineer consultation.







