Asterisk integration with a website: what breaks in production
Telephony on a website and the PBX itself are usually designed separately: the station lives in its own environment, the application in its own, and between them a layer appears that turns call events into database records.
While the load is small, everything adds up; in production with dozens of simultaneous conversations, the link between the PBX and the web application begins to lose data.
The first bottleneck is the event stream. Asterisk integration with a website is almost always implemented as a service that keeps call state in memory and listens to AMI events.
A container restart or brief PBX unavailability, and events for that interval do not arrive: in the card, the call remains “in conversation,” although the handset was hung up long ago. Without an accumulating log and reprocessing, no one cleans up such tails.
The second is desynchronization of request statuses. The web application waits for the final status, but the CDR record appears later, and when a call is transferred, the second leg goes through a separate channel with its own identifier.
The request is closed before the call or is not closed at all, and the missed call report diverges from reality.
The third is calls without a customer card.
The number arrives in one format and is stored in another in the database, the operator’s extension is not matched to the account — the incoming call goes into the common pool, and the operator picks up the handset without knowing the history of requests.
We look at how this is closed: a single call key, an event buffer with reprocessing, and number normalization on input.
What the link between telephony and the website provides: the effect in numbers and failures
The call card is assembled at the moment of dialing: the number, the page from which the request came, the traffic source, and previous requests are pulled up to the operator before they pick up the handset.
The conversation starts with the essence rather than clarifying questions — call handling time drops primarily because there is no need to manually search for the customer in the CRM system and reconstruct context from memory.
A unified request history combines calls, chat messages, and form submissions into a single profile.
The operator sees that the customer has already been answered and what exactly was promised, so repeat consultations on the same issue do not take time twice, and the share of requests closed on first contact grows.
A separate part of the effect is an eliminated class of failures.
A dropped session or restart of the operator’s workstation no longer means a lost call: the connection is restored, the recording and transcription are added to the card, and the customer does not dial the number again.
Previously, such a break caused a silent loss — the request was neither in the statistics nor in the queue, and it was only learned about from a complaint.
Line downtime is reduced because the load is distributed among operators automatically, and the queue does not accumulate during peak spikes from advertising platforms.
We measure the effect using before-and-after snapshots: time to answer, missed rate, number of repeat calls on the same issue, and volume of unowned requests. These same snapshots remain a working tool — they show where the integration is sagging, not just that it works.
Asterisk integration: options for connecting to a web application
The station and the web application exchange events in both directions: the website learns about an incoming call and line status, and the operator interface initiates an outgoing call.
The scheme is chosen based on the number of event consumers, the required speed at which the call card appears, and system behavior when the connection between the station and the website breaks.
| Connection option | When it fits | Limitations |
|---|---|---|
| Direct polling of the station from the website backend | one event consumer, a small call flow | a persistent connection and an account for the server; when the application restarts, events for that interval are lost |
| Events through an intermediary service and queue | multiple consumers: website, CRM system, reports | a separate service with a log and repeated event delivery is required |
| Softphone in the operator’s browser | one-click call directly from the customer card | certificates, encryption, and correct network configuration on the customer’s side |
Direct polling of the station is the easiest to set up, but each application holds its own connection and parses the event stream itself — with several consumers, the logic is duplicated, and a missed connection break results in a call without a card in the interface.
An intermediary service removes this: it stores events and delivers them again, so the call card comes up even after a website restart.
Infrastructure requirements follow from the chosen option: a stable channel between the station and the application, access by address list instead of an open port to the internet, a separate account with rights only for the necessary actions, and an event exchange log for incident analysis.
Implementation stages: from audit to handover to operation
The work order is the same for a new telephony integration with a website and for expanding an already operating PBX: first we record the current state, then we design, and only then we change the configuration.
Skipping the audit is pointless — most failures in production grow from unstated assumptions about how a call flows now.
- Telephony audit. Numbers, telecom operators, queues, extensions, transfer rules, missed call statistics — the output is a call flow map with bottlenecks.
- Call handling scheme. We agree on scenarios: callback from a form, call from the customer card, distribution by departments and hours, IVR, escalation to a manager.
- Routing setup. In Asterisk, we build the dialplan and queues, bind extensions, set forwarding, call recording, and transmission of the call event to CRM.
- Integration with the website. Callback widget, one-click call, insertion of page context into the operator card.
- Load testing. We run more simultaneous calls than the peak level, check behavior during an external line break and operator unavailability.
- Handover to operation. Documentation, on-call regulations, access, training for operators and administrators.
Acceptance is based on metrics, not on the fact that “it rings”: missed rate, time to answer, correctness of distribution by groups. After handover, route edits and monitoring of communication quality remain on our side.
What remains with the customer: configurations, schemes, regulations
We hand over not “server access” but a package that the customer or any other contractor can use to work without us: working configurations of the Asterisk node with comments, a call routing scheme, access rules, and regulations.
Everything is recorded in a shared repository, versioned, and accepted on the customer’s staging environment — before handover to production operation.
- Configurations: configuration files for the switch, call handling plan, external lines, queues, and IVR menus — with an explanation of why each parameter was chosen, not just “as is.”
- Routing scheme: where a call goes during and outside working hours, when the operator is busy, the external channel is unavailable, and the primary node fails; who receives the call when the queue overflows.
- Access rules: operator and administrator accounts, restrictions by addresses and ports, separation of rights, and the procedure for issuing and instantly revoking access upon termination.
- Support regulations: boundaries of responsibility, response time by request classes, procedure for editing the production configuration, and windows for work affecting call reception.
- Instructions for operators: answering and transferring a call, hold, placing in queue, working with missed calls — with descriptions of screen forms and typical situations.
- Logs and recordings: where conversation recordings and call history are stored, retention period, how to read the report on lost calls and line load.
- Backup and rollback: configuration copy schedule, storage location, step-by-step restoration of the previous node state.
Acceptance follows a checklist: we deploy the package on a clean staging environment, reproduce the routes, and make sure the documentation matches the system behavior. If there is a discrepancy, we fix the configuration, not the document.
Case study: how a class of failures was eliminated by linking telephony and the website
What it was like before the integration
Website requests and calls lived in different systems: the number from the form was not linked to the customer card, and the operator learned the context during the conversation.
During peak hours, some calls went unanswered, and only the number remained in the station log — without a link to the request. Lost requests reached one third, and response time stretched to hours.
What we changed
We linked the forms to the telephone station Asterisk through an event bus: submitting a form creates a request card, an outgoing call is initiated from the interface, and an incoming call from a known number opens the card automatically.
An unanswered call returns to the common pool after a specified interval instead of “sticking” to the operator; call recordings go into the same request history.
What the result was
- Lost requests — from one third during peak hours to isolated cases: every missed call goes into the report with a reason.
- Response time — from hours to minutes: the operator sees the request context before picking up the handset.
- Line load — calls are distributed evenly, and repeat calls have halved.
- Disputed situations are analyzed using the recording and the link to the request, not from memory.
The line summary is collected automatically: operator load and missed rate are visible without manually reconciling logs.
How event-based connection differs from direct polling of the station
Direct polling — the website itself asks the Asterisk station on a timer about channel states: who is on the line, who is on pause, who has finished the conversation.
The scheme is simple, but the status update delay equals the polling period, and the load on the station grows linearly — the more operators and open tabs, the more often requests are sent.
With several dozen workstations, the station spends a noticeable share of resources on responses instead of servicing calls.
Event-based exchange flips the scheme: the station itself reports a change — handset picked up, placed on hold, call ended — and the website maintains a persistent connection and listens to the stream.
Status update delay drops to fractions of a second, and the load depends not on the number of tabs but on the number of actual changes. The customer card and operator panel update at the moment of the event, not on the next polling cycle.
This scheme has its own cost — resilience to connection breaks. The connection breaks during a service restart, network failure, or update on the station side.
That is why automatic reconnection with increasing delay, deduplication of events that arrive again, and state recovery are needed: after a break, the website requests a snapshot of active channels and then trusts the stream again.
In practice, the choice is this: where real-time reaction is needed — a call from the browser, the customer card, operator status — we work by events.
We leave polling as a rare scheduled reconciliation: it barely loads the station and provides a fallback if an individual event is lost. This combination provides low latency and does not show the operator an outdated picture.
Common technical questions about telephony on a website
Before starting, the technical lead checks not scenarios but risks: whether the integration will fit into the existing PBX, what will happen if a node fails, who will get access to call recordings, and whether request history will be preserved.
These four questions hold up a project more often than others, so we answer them before the estimate.
Will the integration be compatible with our current PBX?
We connect to the operating PBX through open interfaces: call routing, queues, and extensions remain in the current configuration. The website receives call events and sends commands on top of them; there is no need to rewrite telephony from scratch.
If the platform differs from Asterisk, before starting we take a compatibility map — which calls, statuses, and recordings are available externally, and which will have to be covered by a separate module.
What happens if the telephony server is unavailable?
The website form saves the request to the database before attempting the call, so the request is not lost when the node is unavailable.
The second node takes over operator registration, and during migration we switch numbers one by one in a low-load window — call center downtime is measured in minutes, not a working day.
Who will get access to call recordings?
Recordings remain in the PBX storage; the website keeps only a link and call metadata. We assign rights by roles: a department head sees recordings of their department, an operator sees only their own, and external export goes into the audit log.
Can request history be migrated?
We migrate in batches: calls, recordings, and links to the customer from the CRM system. First we run the migration on a database copy, compare the number of requests and recording durations, and only then migrate the production environment.
Let’s discuss your task and come back with an estimate and plan
Before calculating timelines and scope of work, we need to see your scheme as a whole: how telephony is set up now, where calls are routed, what already exists on the website and in the CRM system.
Describe the task in your own words — that is enough to discuss it substantively and come back with an estimate for Asterisk integration, not general promises.
It is useful to attach what is already at hand: schemes, configuration exports, a description of scenarios. We will analyze the bottlenecks and come back with a work plan — what we do, what is required on your side, what access and data are needed to start the project.
- how calls come in and go out: scenarios, queues, transfers between employees;
- which scenarios are already automated and which rely on manual operator work;
- what should happen on the website: contact button, callback, request history in the personal account;
- how telephony, the website, and the CRM system are connected: where call history is stored and who reads it;
- what limitations the telecom operator has and on which node telephony runs today;
- who on the customer side confirms requirements and accepts the result by stages.
In response, you will receive the scope of work by stages, checkpoints, and the procedure for bringing it into production with rollback capability.
The project starts with an agreed plan and a test scenario on one number — this keeps the risk to real calls minimal, and you incur no timeline obligations. Describe the current scheme — we will come back with an analysis and plan.







