Skip to main content

Click-to-Dial

This is a simple but functionally limited method of initiating calls for a logged-in user, where phone numbers in any web application are wrapped into links. Full control is available through frontend integration of the operator application, or via backend integration using the REST API.

Call Initiation

The location where the phone number is displayed is wrapped in the following link.

Phone number: <a href="https://ucs.zakaznik.cz/dial/%2b1555444333" target="_blank">+1 555 444333</a>

It is recommended to open the link in a window with an approximate size of 600×600 px, as the user may not be logged in. In that case, a login dialog will be displayed before the call is initiated.

Phone number: <a href="https://ucs.zakaznik.cz/dial/%2b1555444333" class="click-to-dial">+1 555 444333</a>

<script>
document.querySelector('.click-to-dial').addEventListener('click', function (e) {
e.preventDefault();
window.open(
this.href,
'click-to-dial',
'width=600,height=600,resizable=no,scrollbars=no'
);
});
</script>

The popup window is then automatically closed after 3 seconds, as it contains the following JavaScript:

<script type="text/javascript">
setTimeout(function() { window.close(); }, 3000);
</script>

Call Termination

An ongoing call can be terminated using the following link:

<a href="https://ucs.zakaznik.cz/dial/hangup">Hang up call</a>