How to setup Vtiger CRM Telephony Integration with Asterisk

August 3, 2016

Human has been answering telephone for a long time without knowing who is on the other side. Customer expectation has grown multifold for companies to keep customer records well before the salesman pick the call. A lot of such powerful & productive integration can be done when you marry Asterisk to Vtiger CRM.

Call Tracking, Call Logging, Make calls from inside your CRM, Know who is calling are a few productive integration that can be done with ready-to-use PBXManager Suite.

Asterisk and Vtiger CRM

Here is a simple setting up guide for the integration.

Setting up PBX Manager with Asterisk

Step 1: Install & Configure Asterisk

Install:

user-ThinkPad-T410:~ user$ sudo apt-get install asterisk

Launch Asterisk CLI to check Asterisk is running,

user-ThinkPad-T410:~ user$ sudo asterisk -r

To get out of the CLI, type exit

*CLI > exit

Configure:

Take backup of sip.conf and extensions.conf file in /etc/asterisk folder

user-ThinkPad-T410:~ user$ sudo cp sip.conf old-sip.conf

user-ThinkPad-T410:~ user$ sudo cp extensions.conf old-extensions.conf

Edit sip.conf file

user-ThinkPad-T410:~ user$ sudo vi /etc/asterisk/sip.conf

Configure the sip.conf file with the sample-sip.conf file

Edit extensions.conf

user-ThinkPad-T410:~ user$ sudo vi /etc/asterisk/extensions.conf

Configure the sip.conf file with the sample-extensions.conf file

Edit Asterisk cdr configuration file: (cdr_manager.conf) : download sample-cdr_manager.conf file to configure

Edit Asterisk manager configuration file: (manager.conf) :download sample-manager.conf file

To apply changes restart Asterisk

user-ThinkPad-T410:~ user$ sudo /etc/init.d/asterisk restart

Launch Asterisk CLI

user-ThinkPad-T410:~ user$ sudo asterisk -rvvv

V’s are verbose level

user-ThinkPad-T410*CLI> sip show peers /* It lists registered users in sip.conf with status unmonitored */

Step 2: Install Softphone — ZoIPer

  1. Create an account in ZoIPer
  2. Choose SIP option.Credentials:user/[email protected] : [email protected] : 7002login

    Domain / Outbound Proxoy : 10.2.1.20

  3. Click Next → Account Name ([email protected]) → NextNow your account has been registered in your Asterisk server. You can verify the request and response in Asterisk CLI window.

Step 3: Install Vtiger Asterisk Connector

Vtiger Asterisk connector is a gateway to connect Asterisk server and your Vtiger CRM. It helps to make interaction over HTTP when it handles incoming or outgoing calls.

Features:

  1. Pops out notification on incoming call.
  2. Transfers the input from Vtiger to Asterisk.
  3. Manages call record file.

Installation & Configuration:

  • Download Vtiger Asterisk Connector
  • Unzip the downloaded package in CRM root directory
  • Edit VtigerAsteriskConnector/VtigerAsteriskConnector.properties file to make the following changes

Location where the application server will be running.

ServerIP 10.2.1.20 IP on which Vtiger Asterisk Connector runs.
ServerPort 8282 Port on which Vtiger Asterisk Connector runs.

Call Recordings storage path

StorageDir /var/www/html/VtigerAsteriskConnector/storage Asterisk Call Recording storage file path in Asterisk server.

Location where the applications database files will be stored.

AsteriskAppDBPath /var/www/html/VtigerAsteriskConnector/storage Vtiger Asterisk Connector database file path in your server.

Asterisk Server Details

AsteriskServerPort 6072 Port on which Asterisk Server runs.
AsteriskUsername Collin Username used in manager.conf file.
AsteriskPassword myloginkey Password used in manager.conf file.

Vtiger CRM URL

VtigerURL Integrating Vtiger CRM URL.
VtigerSecretKey 86935037846293d782ab4 Copy and Paste the Vtiger Secret Key under Vtiger CRM Settings Integration PBXManager Asterisk Server Details

Step 4: Configure PBX Manager in Vtiger

  1. Login to your Vtiger CRM.
  2. Click CRM Settings Integration PBX Manager.
  3. Edit Asterisk Server Details.
Vtiger Asterisk App URL Protocol://Asterisk_Server_IP:Port

Protocol – http / https

Asterisk_Server_IP – Asterisk Server IP

Port – Server Port configured in Vtiger Asterisk Connector config file.

Outbound Context internal Context configured in Asterisk server [exten => _X.,1,Agi(agi://10.2.1.254/incoming.agi)]
Outbound Trunk XYZ Trunk configured in Asterisk server(same as the trunk name in FreePBX.)
Vtiger Secret Key 86935037846293d782ab4 Unique key configured for authentication

Configure user extension number:

  1. Open My Preferences.
  2. In “More Information” block configure the user number in CRM Phone Extension field. Eg. 7001
  3. Start Asterisk Connector. In terminal execute lines one by one

user-ThinkPad-T410:~ user$ cd VtigerAsteriskConnector/bin/

user-ThinkPad-T410:~ user$ ./start.sh /* To start Asterisk Connector */

To refresh Asterisk connector

user-ThinkPad-T410:~ user$ ./start.sh

user-ThinkPad-T410:~ user$ ./stop.sh

To verify, you can run Protocol://Asterisk_Server_IP:Port )

We believe this guide helped you integrate your Asterisk with your Vtiger CRM and get the best out of your CRM. We have given a sample of a integration, you can enhance it further more and do more. You can extend it to add lots of features and make your work simple. If you have any questions or further help in extending your Vtiger CRM with advanced functionalities, you can get help from us.