What Is Click-to-Call? Building One-Click Calling with Grandstream UCM PBX Integration

Picture a sales rep's day: they open a customer record in the CRM, read the number, turn to the desk phone and punch in eleven digits one by one. For someone making fifty calls a day, that is a real waste of time and a constant risk of misdialing. Click-to-call removes that step entirely.

In this post I share how one-click calling works and what to watch out for in PBX integration, based on Arasix Click-to-Call, an application I built for companies.

What Is Click-to-Call?

Click-to-call means starting a phone call by clicking a number on a web page or in an app. In an enterprise setting the call is not placed from the browser; it goes through the user's existing desk phone and the company PBX. That way call quality, caller ID and call records all stay on the company's own infrastructure.

How Does One-Click Calling Work?

For the user it is a single click, but behind the scenes the following happens:

The user clicks a number in the directory and the app sends the request to the server.

The server opens a secure session with the PBX and sends the call command.

The PBX rings the user's extension first.

When the user picks up, the PBX dials the target number and bridges the two parties.

The call status is reported back to the app in real time.

This approach is known as "callback" or "originate". Users don't need to install any software or softphone on their computer.

PBX Integration with Grandstream UCM

Grandstream UCM series PBXs offer two integration channels:

HTTPS API: Used for commands such as logging in and starting a call. The session is opened through a challenge step, so the password is never sent directly.

WebSocket event stream: The PBX pushes the status of extensions and active calls in real time. Whether a call is ringing, connected or ended comes through this channel.

On top of that, the CDR (call detail record) produced after the call is used to confirm its duration and outcome.

Challenges I Faced During Development

1. Call Status Is Not Always Certain

Events from the PBX are sometimes delayed and sometimes never arrive. The first instinct is to mark an unanswered call as "failed", yet the conversation may well have happened. So I modeled call states as an explicit lifecycle: dispatching → accepted → ringing → connected → ended. Calls whose outcome cannot be verified are clearly shown as "Unknown". Showing uncertainty honestly is more trustworthy than presenting false certainty.

2. The Same Call Must Never Go Out Twice

A user may double-click the button, or a network glitch may resend the request. The result: a system that calls the customer twice. To prevent this, every call request gets a unique idempotency key, backed by a per-user lock and database-level locking. No matter how many times the same request arrives, only one command reaches the PBX.

3. When the PBX Is Unreachable

The PBX may be under maintenance or the VPN link may drop. If every call request then waits for a long timeout, the whole app slows down. I used a circuit breaker that trips after consecutive connection failures: for a short time the system rejects calls immediately, the user sees what is going on right away, and the flow returns to normal on its own once the PBX recovers.

4. Cost and Security Control

The convenience of one-click calling also brings the risk of uncontrolled use. Premium-rate (0900 / 0898) and international numbers are blocked by default, and every blocked attempt is written to the audit log. Role- and permission-based access, two-factor authentication and trusted device management were also must-haves for enterprise use.

Benefits of Click-to-Call for Companies

Time savings: The dialing step disappears completely.

Error-free calls: No more wrong numbers.

Traceability: Who talked to which customer, when and for how long is recorded.

CRM integration: Calls sit on the same screen as sales opportunities and customer notes.

Existing infrastructure: No new phones or lines needed; the current PBX is used.

Conclusion

Click-to-call may look like a simple "call" button at first glance, but a reliable product requires honest modeling of call states, protection against duplicate calls and resilience against PBX outages. You can explore all features and screenshots of the project on the Arasix Click-to-Call project page.