Call me back (CMB)

Call me back (CMB)

You are here:
Estimated reading time: 2 min.

This feature allows visitors on your website to enter their phone number to initiate a call from a PBX user to the number your visitor provided.

PBX configuration

From the PBX side you need a CMB context and an API key.

CMB Context

As a user with admin privileges you can create a CMB action in the menu Actions/Call Me Back/Add.

The CMB Context describes which number should be used to call. Here you enter a context name and a destination number which can either be an external number or an extension. For this number you can define an action rule that specifies what must happen when the call me back is triggered.
The extension can hold any action. Most useful for a CMB is to dial a call group or an ACD to handle the call. It is also possible to dial a single PBX user.
Note: if you want to connect your ‘call me back’ action to an extension with an ACD, then start with the action ‘answer and wait 1s’ in order to get the audio channel set up as well.

Get an API Key.

You will need an API Key to use in your call me back script to authenticate requests to the PBX.
Go to System/Options/Remote API. Click on the field API Key to be able to copy it. If the field is empty you can simply press ‘Generate new’ to create a new key.

Now allow the IP address of your webserver to access the PBX on port 443. Check menu System/Firewall.

Website frontend

The PBX API will be called from your web server, so you need a form on your website that takes input from visitors to get their number to call back to. For example:

<form method='post'>
        Number: <input type='text' name='number' />
        <input type='submit' value='Submit' />
</form>

A visitor on your website can enter his/her phone number and press Submit.

Website backend

To communicate with the PBX you can write e.g. a PHP script (or your preferred language) to send an HTTP request to the PBX:

$r = new HttpRequest('https://123.45.67.89/apis/lsp/callMeBack', HttpRequest::METH_GET);
$r->addQueryData(array('key' => '1bf0e78ee5a9a149c849f9491a4e896a', 'name' => 'support', 'number' => $_REQUEST["number"] ));
$r->send();

Example script

PLEASE NOTE: To make this example script work, the webserver requires the ‘HttpRequest‘ class

CMB Demo

Done. Check your phone.

'post'>
        Number: 'text' name='number' />
        'submit' value='Submit' />

WordPress

If you are using WordPress CMS to run your website, you can use e.g. this third party plugin.

Was this article helpful?
No