Home  >   FAQs   >  How do I install the Vtiger Asterisk Connector?
FAQs in this section

How do I install the Vtiger Asterisk Connector?

Table of Contents
Follow these steps to install the Vtiger Asterisk Connector:
  1. Click on the link to download Vtiger Asterisk Connector.
  2. Unzip the application package (VtigerAsteriskConnector.zip) to any path in Asterisk Server. 
  3. Unzip VtigerAsteriskConnector.zip
Update VtigerAsteriskConnector/VtigerAsteriskConnector.properties
 
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.
 
Vtiger
 
VtigerURL Copy and Paste the callback URL that is generated in your Vtiger Instance. You can find this under the PhoneCalls settings page.
VtigerSecretKey Copy and Paste the Vtiger Secret Key that is generated in your Vtiger Instance. You can find this under the PhoneCalls 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:
    1. _X = pattern to accept any number as an extension
    2. 0.0.0.0 = VtigerAskteriskConnector_ServerIP (or the one configured in VtigerAskteriskConnector/VtigerAskteriskConnector.properties)
    3. 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 permit field as Vtiger Connector uses same IP to for AMI login.
    ;--- START --- permit = ASTERISK_IP/255.255.255.0 ;--- END ---

---------------------------------------------------------------------------------------------------------------------------------------------
Here is a configuration example

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

Context

a. 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 below dial plan within existing context, say “Outgoing”
exten => _X.,1,Agi(agi://0.0.0.0/incoming.agi)
b. 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 below dial plan within existing inbound context, 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 an incoming call, the Asterisk server will not send the start and end times to CRM when it is still ringing or in on-going-progress. In order to create a Phone call record in 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.
  • On triggering a call via Asterisk provider, the record ID is sent to the provider.


Asterisk Manager Settings


AMI user added in 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:
a. Vtiger Asterisk App URL = http://127.0.0.1: (the port you picked)
Refer VtigerAsteriskConnector config file.
ServerIP = 127.0.0.1 ServerPort = 56002 [pick a unused port] AsteriskServerIP = 127.0.0.1 AsteriskServerPort = 5038 AsteriskUserName =admin AsteriskPassword = xxxxxxxxx
b. Outbound Context = Vtiger_outbound
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).
c. Outbound Trunk = XYZ
It must match the trunk name added in FreePBX.
To know more about the features and benefits of this integration, please check Asterisk + Vtiger CRM.
Was this FAQ helpful?
0  out of  0  found this helpful.
Comments 0
Be the first to comment
© Copyright 2023 Vtiger. All rights reserved.