Egroupware - click-to-call

The purpose of this howto is to install a click-to-call option in the addressbook of EGroupware.

Enable Mysql LAN access

If using 2 servers, we have to enable access to mysql on the lan from the machine that will connect to mysql:

db configuration setprop mysqld variable value

expand-template /etc/my.cnf

/etc/rc.d/init.d/mysqld restart


Create a user to remotely access the egrouwpare database

mysql
GRANT ALL ON egroupware.* 
TO lanuser@% 
IDENTIFIED BY 'keizjkfzizejjk943jd9e'; 

flush privileges;

\q;

This password must be set to something else.


Enable PBX's manager to access from the LAN

On the PBX, create a manager account or use the predefined account in


Headers -> manager.conf
 

Add a line to autorize local network under [remote_mgr]


permit=10.1.1.0/255.255.255.0


Create an Ibay "pbx" and install script

  • For user and group admin, no internet access (lan only), php activated.
  • Download and copy this script in the just created ibay and rename it to call.php.
  • Open the script and adapt it to your installation:
    • Address of the pbx:
      $strHost = "10.1.1.6";

       
    • Manager account:
      $strUser = "remote_mgr";

       
    • Manager's password:
      $strSecret = "0chanc3yo";

       
    • Address of EGrouwpare:
      $egwHost="10.1.1.10";

       
    • Mysql user with remote access permission:
      $egwUser="lanuser";

       
    • Mysql user's password:
      $egwPass="keizjkfzizejjk943jd9e";
      (this must be set to something else)

       
    • Egroupware database name:
      $egwData="egroupware";

Configure Egroupware

Create a custom field in addressbook

Goto the addressbook and
open it's preferences Menu.

 

 

Select "Custom Fields" menu

and create a text field named "pbx_extension".

Populate the new field

Save this and goto the contact with your own username. In Egroupware, each user has a corresponding entry in the address book. Modify the contact and select the last tab (I don't know what it's called in English). Enter your extension with a protocol prefix. It can be "IAX2/" or "SIP/"

Configure click-to-call

Back to the addressbook menu,
select Site configuration.

Enter a link to you ibay and script. Based on these examples, it should be like this:

http://10.1.1.6/pbx/call.php?number=%1&accountname=%u&account=%t


which will be used by egroupware in the addressbook listings:

  • %1 = number to call to be assigned to the variable number
  • %u = account name to be assigned to the variable accountname
  • %t = account phone to be assigned to the variable account

 

Popup size should not be too large. It will be opened in the top-left corner of the screen.

Testing click-to-call

So we're done! Open the addressbook and you should now see a link with the phone numbers.

Clicking the link will open a popup. The behaviour is similar to a callback. When the popup opens, it first calls your extension. If you pickup the call, the script will go on and call the number.

It is then up to you to have the popup do other things. Mine has a field where I can cut/paste a number and then click a button to call this number.

Fichier attachéTaille
call.php_.txt4.75 Ko