Module ClickToDial En

From Dolibarr ERP CRM Wiki
Jump to navigation Jump to search
Asterisk
Numero/ID of module 58
User doc. of module This page
Developer doc. of module Module ClickTodial (developer)

Introduction

This module allows you to trigger a phone call with a simple mouse click on a phone number in Dolibarr. This module is designed to work with:

  • Any SIP server with an URL interface for the ClickToCall
  • or with Asterisk (Asterisk is a server that does not provide such URL but a wrapper is included in Dolibarr to provide such service)
  • or with local software able to manage "tel:" urls from web browsers clicks
  • or with a locally installed softphone (like LinPhone).

Installation

This module is included with the Dolibarr distribution, so there is no need to install it.

Configuration

To use this module, you must first enable it using an administrator account, via the menu option "Home - Setup - Modules".

Choose the tab where the module is listed. Then click on "Activate".

The module is now activated.

If a cog icon appears Cog circle.svg on module thumb or at end of the line of the module, click on it to access the setup page specific to the module.

Solutions with no need to install client components

With Asterisk

This is how to fill the specific setup for Asterisk:

  • First, make sure you have an Asterisk server that works for SIP. This unfortunately is not relevant to module or Dolibarr, so we can only refer you to the Asterisk documentation.
  • Once you are sure, go into Dolibarr, into Setup - Module - ClickToDial setup and add Url
http://MYDOLIBARR/asterisk/wrapper.php?caller=__PHONEFROM__&called=__PHONETO__&login=__LOGIN__&password=__PASS__
  • Go on page Setup - Other and add constants
ASTERISK_HOST with IP of your asterisk server (ie: 127.0.0.1)
ASTERISK_TYPE with managed protocol (ie: SIP/)
ASTERISK_INDICATIF with prefix to add in phone number (ie: 0 or NONE)
ASTERISK_PORT with port of Asterisk sever (ie: 5038)
ASTERISK_CONTEXT with context of call (ex: from-internal)
CLICKTODIAL_FORCENEWTARGET with value 0 or 1. If this value is set to 0 or not defined, then calling will open a new window/tab in the browser.
  • Create a new console user on your Asterisk server ( File /etc/asterisk/manager.conf )
[dolibarruser]
secret = dolibarrpass
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
read = system,call,log,verbose,command,agent,user
#read = system,call,log,verbose,command,agent,user,config,dtmf,reporting,cdr,dialplan
write = system,call,log,verbose,command,agent,user,originate
#write = system,call,log,verbose,command,agent,user,originate,reporting

permit must contains IP viewed by Asterisk where Dolibarr is installed.

  • You may also need to edit file /etc/asterisk/extension.conf to define contact from-internal.
[from-internal] 
exten => _00XX.,1,NoOp(Call Dolibarr) 
same => n,Dial(SIP/providervoip/${EXTEN},30) 
same => n,hangup

Change providervoip with SIP provider.

Validate change with

asterisk -rvvvvvvvvvvvvvvvvvv
CLI> manager reload
CLI> dialplan reload
  • Enter Asterisk informations on your Dolibarr user card, tab ClickToDial
ClickToDial Login : dolibarruser (use same entry than added into manager.conf file)
ClickToDial Password : dolibarrpass (use same pass than added into manager.conf file)
ClickToDial Id caller (phone) : your phone

Using the phoning service of OVH

See page of Module OVH (SMS, ClickToDial, ...) required for that.


Solutions with client component installation

With with local software able to manage "tel:" url

If you have installe software able to manage link with syntax "tel:" from a web browser click (for example, the *Xivo client*), from Dolibarr 3.9, just go on the clicktodial setup page and set option *Use just a link "tel:" on phone numbers* to Yes. That's all.


With SIP phone software (Ekiga or LinPhone) + Linux + Firefox or Chrome

  • First, be sure, a SIP software (like Ekiga or Linphone) is installed and working correctly (you can phone using it) without using Dolibarr.
  • Once this is done, login to Dolibarr, go into ClickToDial module setup page. Into URL field, type
sip:__PHONETO__@yoursipdomain

For example, when using freephonie, the SIP system of the french ISP Free, URL would be

sip:__PHONETO__@freephonie.net
  • Now, we have to setup our browser to launch our sip software when clicking onto a "sip:" URL:

With Firefox

- Launch Firefox

- Type about:config in the address bar and press ‘Enter’

- Accept the warning

- Right click somewhere on the page and select New –> Boolean from the menu

- Set the name to “network.protocol-handler.expose.sip” without the quotes

- Set the value to “false”

- Close the about:config window (or tab)

- Copy launcher script file .sh (provided with dolibarr into scripts/clicktodial/ekiga.sh or scripts/clicktodial/linphone.sh with linphone) into your home directory. For example into /home/yourlogin

- Go on a card with a phone number (a third party or contact page for example). Click on phone link. When prompted, select the path to the launch script to run your SIP software you have copied previously (so /home/yourlogin/ekiga.sh or /home/yourlogin/linphone.sh).

Your browser should launch your SIP software and dial the number provided into URI each time you click on a phone number. That’s it!

With Chrome and Ubuntu

- Copy launcher script file .sh (provided with dolibarr into scripts/clicktodial/ekiga.sh for Ekiga or scripts/clicktodial/linphone.sh for Linphone) into your home directory. For example into /home/yourlogin

- Create a file /usr/share/applications/dolibarr_clicktodial.desktop to describe the SIP software to launch

[Desktop Entry]
Name=SIP phone
Comment=SIP phone
Type=Application
Exec=/home/yourlogin/linphone.sh %U
Icon=/usr/share/pixmaps/linphone/linphone.png
Terminal=false
Categories=Network;Telephony;

Replace path into line Exec= with the path and name of script or your SIP software.

- Add a ligne into file /usr/share/applications/defaults.list to tell to use this descriptor when we need to handle SIP urls.

x-scheme-handler/sip=dolibarr_clicktodial.desktop

Your browser should launch your SIP software and dial the number provided into URI each time you click on a phone number. That’s it!

Usage

Once setup is finished, all phone number in Dolibarr screens are now links you can click. If you do so, Dolibarr will call the defined page/URL, that should make the calling.