Home  >   Integration   >  Vtiger Integration with Asterisk

Vtiger Integration with Asterisk

B
Bindu Rekha Babu
6 Feb, 2025 - Updated 12 days ago
Table of Contents

Feature Availability: One Pilot | One Growth | One Professional | One Enterprise | One AI

Introduction

Is your office crowded with the latest phones, faxes, mobiles, etc? Are you finding it difficult to communicate with your customers using multiple devices?
What if your laptop or desktop had a single app that could connect you to a customer with a single click?

 

Well, there is the Phone Calls module in Vtiger CRM!

With the Phone Calls module, you can connect with your contacts by simply placing a call directly from your laptop or desktop by clicking the phone call icon. Now, you do not have to worry about tying up with a service provider, logging into CRM, and placing your calls.

How does Vtiger CRM’s Phone Calls feature work?  

With the Phone Calls module installed, you can:

  • Place calls directly from your desktop or laptop.
  • Integrate services such as Live Chat, email, call logging, purchase history, feedback surveying, support tickets, etc.
  • Use different telephony gateways to connect to other hosted telephony services such as Plivo, Exotel, ViciDial, Knowlarity, and Asterisk ver. 1.4 and 1.6 (without Vtiger Connector) and Asterisk ver. 1.8 - 11 (with Vtiger Connector).

Integration with Asterisk

You can integrate Vtiger CRM and make calls using Asterisk as a gateway. You can call your contacts directly from the following CRM screens:

  • Contacts’ List View
  • Contact Summary View
  • Actions
  • Related organization record
  • Related deal record

Also, you can set up two types of gateways with Asterisk:

  • Normal gateway - To set this up, you must configure an extension phone number in the agent’s preferences. When you call a client, it connects to the extension number first. Agents must receive the call on the extension number to connect with the client.
  • Client gateway - Outgoing calls directly connect to the clients when you use client gateways. You can set up client gateways only with Asterisk and Plivo.

Other Telephony Gateways in Vtiger CRM

Vtiger CRM’s integrated telephony helps to connect with the following:

Benefits of Using the Phone Calls Feature

There are numerous advantages of using the Phone Calls module, a few are listed below:

  • Lower investments - Integrated telephony (web-based) comes at a cheaper cost regarding hardware and handling, as calls are routed through your internet.
  • Optimized resources - Vastly beneficial, especially if you are a small business with a few employees and do not want to invest more in communication.
  • Better control and coordination - You can control and coordinate your communication with a single platform. No more worries about working with too many devices and losing out on contact. 
  • Flexibility - Call from anywhere and anytime. You or your employees can work from the office, at home, or on the road. You can log in at different times and not worry about changes in weather or social conditions.
  • Increased volume of calls - Provides more lines of communication and enables handling many calls.
  • Increased productivity and efficiency - You will have a single platform, your computer, to track customer data and communicate with them. You don’t have to switch between multiple applications and devices to see data, making a phone call much more efficient.

Installing Phone Calls

 To use the Phone Calls module, you must first install it from the Extension Store. You can access the Extension Store if you are an Admin user. 

Follow these steps to install Phone Calls:

  1. Log in to CRM.
  2. Click the User Menu on the top right corner of the screen.
  3. Click Settings. 
  4. Look for the Extensions section.
  5. Select Extension Store.  
  6. Search for Phone Calls using the search bar.
  7. Click Install. 



 After you install the module, you can see it under Main Menu > Essentials > Conversations (as shown in the above image).
To learn more about the Phone Calls module in Vtiger, click here.
 

Configuring Asterisk 

Configuring Asterisk requires you to do the following:

  • Step 1: Set up Asterisk as a Normal Gateway
  • Step 2: Configuring Asterisk server information
  • Step 3: Configuring extension number for users

Note:

  • You can only configure Asterisk and other gateways if you are an Admin user.
  • To set up the gateway, log in to your Asterisk account and Vtiger CRM in different windows or tabs and keep both open as you will be required to navigate back and forth between these apps.

Normal Gateway

Let us first see how Asterisk works as a normal gateway.

  • CRM admins must subscribe to the Asterisk service and get their Asterisk Number.
  • CRM admins must configure Asterisk in the CRM.
  • Individual sales and support representatives must set up their Asterisk Extension Number in their CRM preferences. 
  • Incoming calls - When a customer calls on the Asterisk Number, the call is routed to all the sales and support representatives. Any one of the representatives can attend the call.
  • Outgoing calls - When a sales and support representative calls a customer, the call is first routed to the representative’s own extension number. The representative must receive the call on their extension number, after which it connects to the customer. 

Step 1: Set up Asterisk as a Normal Gateway

Note: You will be performing these steps in Vtiger CRM. 
Follow these steps to set up Asterisk as a Normal Gateway:

  1.  Log in to CRM.
  2. Click on the User Menu in the top right corner of the screen.
  3. Click Settings.
  4. Look for the Extensions section.
  1. Select Phone Configuration. The Phone Configuration window opens.
 
  1. Click +Add Gateway. The Gateway Configuration window opens.
 
  1. Select Asterisk from the Gateway drop-down.
  2. Select Active from the Gateway Status drop-down. This activates the gateway for incoming and outgoing calls.
  3. Set the gateway as default by selecting Yes from the Default Gateway drop-down. Note: This step is optional.

Step 2: Configure your Asterisk Server information

 
  1. Vtiger Asterisk App URL - Configure the server name where Vtiger Asterisk Connector is installed as shown: Syntax : Protocol://Asterisk_Server_IP:Port.
    1. Note: The image displays only sample data. Please refer to your Asterisk account details for the correct data.

Field Name

Description

Protocol

http/https

Asterisk_Server_IP

Your Asterisk Server IP

Port

Server Port configured in Vtiger Asterisk Connector config file.

Outbound Context

Vtiger-specific context configured in your Asterisk Server (as mentioned in Appendix)

Outbound Trunk

Trunk configured in your Asterisk server.

Outbound Prefix

SIP or Local (for Hosted Asterisk).

Ticket Title/Opportunity Name

You can set the merge tags (fields) for the Ticket/Opportunity creation from the Incoming Call Pop-up.

Callback URL

Callback URL that has to be configured in Vtiger Asterisk Connector

Vtiger Secret Key

The unique key generated for authentication must be configured in the Vtiger Asterisk Connector.

  1. Click Save.

Step 3: Configure the extension number for each user

Configure the extension number on the User Preferences page for each user who handles incoming and outgoing calls from the CRM.

  1. Log in to your CRM account.
  2. Click on the User Profile on the right side of the screen.
  3. Open My Preferences.
  4. Configure the user number in the Asterisk Extension field under the Asterisk Configuration block.
    1. Number format: Enter the number format.
    2. Extension: [Extension_number] For example, 1002.

Once the configuration is completed on both sides, i.e., Vtiger and Asterisk, you are ready to make and receive calls in the CRM.

Viewing Phone Call Logs

Every phone call you make or receive is saved with all the details as a Phone Call record. You can view Phone Call logs for these details. The log of the calls (incoming and outgoing) is listed under Main Menu > Essentials > Phone Calls. You can view the following details on this screen:

  • Call status, customer number, which agent or rep handled the call (mentioned in Handled By and Assigned To fields), call duration, etc.
  • Details for each call can be seen when you open the call record, such as -
    • Links to the voice recording
    • Call notes
    • Call transfer details
    • Call directions, etc.

You can create a list of all your phone calls, such as missed calls, completed calls, etc., from the List View. 

To learn how to create a list, click here.

Viewing Phone Call Status Values

Call status values to define the status of the calls being handled. You can see the following call statuses in the CRM.

  • Ringing: For inbound calls, before the call is routed.
  • In-progress: For inbound calls, after an agent or a rep picks up the call. For outbound calls, when a rep initiates a call.
  • Completed: For inbound and outbound calls, after a call is completed.
  • Voicemail: For inbound calls, if a call goes to voicemail.
  • Hang-up: For inbound calls, if a customer hangs up the call before it is routed to a rep.
  • No-answer: When it is not answered and there is no voicemail for an outbound call.

Vtiger Asterisk Connector

The Vtiger Asterisk Connector application acts as a gateway to connect to Vtiger CRM from the Asterisk Server. The Connector makes it easy for Vtiger and Asterisk to interact over HTTP for incoming or outgoing calls.

Vtiger Asterisk Connector provides the following features:

  • Connect to Vtiger and notify the incoming call.
  • Accept commands from Vtiger and forward it to Asterisk (Click-to-Call).
  • Call recording file management.

Click here to view all the features list.

Installation Prerequisites

  • Asterisk 1.8 onwards
  • Java 1.8 onwards
  • Vtiger Details [Copy these details from the Vtiger CRM PhoneCalls settings page]
  • VtigerServerURL - https://yourondemand.od1.vtiger.com
  • VtigerSecretKey - [Copy this detail from Vtiger CRM Settings > Extensions > Phone Calls page]

Installing Vtiger Asterisk Connector

  1. Click on the link to download Vtiger Asterisk Connector.
  2. Unzip the application package (VtigerAsteriskConnector.zip) to any path in the Asterisk Server.
  3. Update VtigerAsteriskConnector/VtigerAsteriskConnector properties.

For the Asterisk Server

 

ServerIP

IP on which the Vtiger Asterisk Connector will be running. (Preferably use 0.0.0.0)

ServerPort

Port on which Vtiger Asterisk Connector has to run on your server.

StorageDir

Path to store the Asterisk Call Recordings in your Asterisk server.

AsteriskAppDBPath

Path to store the Vtiger Asterisk Connector database file in your server.

AsteriskServerPort

Port on which Asterisk Server is running.

AsteriskUsername

Username configured in manager.conf of your Asterisk Server.

AsteriskPassword

Password configured in manager.conf of your Asterisk Server.

For Vtiger

 

  VtigerURL

Copy and Paste the callback URL that is generated in your Vtiger Instance. You can find this under the Phone Calls settings page.

VtigerSecretKey

Copy and Paste the Vtiger Secret Key generated in your Vtiger Instance. You can find this under the Phone Calls settings page.

Changes Required in Asterisk Server

  • Edit Asterisk Extensions configuration file: (extensions.conf)
; --- START ---- [vtiger_inbound] exten => DID,1,Agi(agi://0.0.0.0/incoming.agi) exten => _X.,1,Agi(agi://0.0.0.0/incoming.agi) ; --- END --- --- START ---- [vtiger_outbound] exten => _X.,1,Agi(agi://0.0.0.0/incoming.agi) ; --- END ---

Add the above two contexts in extensions.conf OR include the below dial plan within the existing context (both inbound and outbound context).
exten => _X.,1,Agi(agi://0.0.0.0/incoming.agi)


Note:
  • _X = pattern to accept any number as an extension
  • 0.0.0.0 = VtigerAskteriskConnector_ServerIP (or the one configured in VtigerAskteriskConnector/VtigerAskteriskConnector.properties)
  • DID = DID provided by your service provider.
  • Edit the Asterisk cdr configuration file: (cdr_manager.conf) and modify the Enabled field as shown below:

    ;--- START --- enabled = yes ;--- END ---

  • Edit Asterisk Manager configuration file: (manager.conf)

    Add Vtiger IP in the ACL (Access Control List) under the username configured in VtigerAskteriskConnector/VtigerAskteriskConnector.properties as shown below:
    ;--- START --- permit = Vtiger_IP/255.255.255.0 ;--- END ---

  • Add Asterisk server IP under the permit field as Vtiger Connector uses the same IP for AMI login.
    ;--- START --- permit = ASTERISK_IP/255.255.255.0 ;--- END ---

Configuration Example

  • Trunks: Select any one of the outbound trunk, say “XYZ” from FreePBX.

Context

  • Outbound Calls: [Should be part of trunk = XYZ]
    Add new context for handling outbound calls.
    ; --- START ---- [vtiger_outbound] exten => _X.,1,Agi(agi://0.0.0.0/incoming.agi) ; --- END ---

    Or

Include dial plan within the existing context below, say Outgoing
exten => _X.,1,Agi(agi://0.0.0.0/incoming.agi)

  • Inbound Calls

Add new context for handling inbound calls. And make this context as default in FreePBX Settings > Asterisk SIP Settings > Default Context = vtiger_inbound.

; --- START ---- [vtiger_inbound] exten => 123456789,1,Agi(agi://0.0.0.0/incoming.agi) exten => _X.,1,Agi(agi://0.0.0.0/incoming.agi) ; --- END ---

where 123456789 - Inbound DID

Or

Include the dial plan within the existing inbound context below, say from-internal, assuming all incoming calls are routed to this context.

[from-internal]        …        … exten => _X.,1,Agi(agi://0.0.0.0/incoming.agi)

Note:

  • For incoming calls, the Asterisk server will not send the start time and end time to the CRM when it is still in ringing or ongoing progress state. To create a Phone call record in the CRM, you need to fill in the start time, as the current time on CRM is set as default. After the call is completed, the Asterisk server notifies CRM about the call details, including the actual start time and end time of the phone call. You can view the call details in the respective Phone call record.
  • The record ID is sent to the provider when triggering a call via Asterisk provider.

Asterisk Manager Settings

AMI users added to the connector config file should have the following permissions.

;---------START----------     read = all,system,call,log,verbose,command,agent,user,config, originate     write = all,system,call,log,verbose,command,agent,user,config, originate ;---------STOP

xx.xx.xx.xxx is our Vtiger Server IP, added under permit field.

permit = xx.xx.xx.xxx/255.255.255.0

yy.yy.yy.yyy is our Asterisk server IP, added under the permit field.

permit = yy.yy.yy.yyy/255.255.255.0

Vtiger Settings

  1. Go to CRM Settings > Extensions > Phone Calls.
  2. Add the following configuration:
    1. Vtiger Asterisk App URL = http://127.0.0.1: (the port you picked)
      1. Refer VtigerAsteriskConnector config file.
      2. ServerIP = 127.0.0.1 ServerPort = 56002 [pick a unused port] AsteriskServerIP = 127.0.0.1 AsteriskServerPort = 5038 AsteriskUserName =admin AsteriskPassword = xxxxxxxxx
    2. Outbound Context = Vtiger_outbound
      1. It must match a context in extensions.conf, in that context, you must have exten => _X.,1,agi(agi://0.0.0.0/incoming.agi).
    3. Outbound Trunk = XYZ
      1. It must match the trunk name added in FreePBX.

 

    Was this article helpful?
    3  out of  13  found this helpful.
    Comments 0
    Be the first to comment
    © Copyright 2023 Vtiger. All rights reserved.