Follow these steps to install the Vtiger Asterisk Connector:
- Click on the link to download the Vtiger Asterisk Connector.
- Unzip the application package (VtigerAsteriskConnector.zip) to any path in the Asterisk Server.
- 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 on your server. |
AsteriskServerPort | Port on which the Asterisk Server is running. |
AsteriskUsername | The username that is configured in manager.conf of your Asterisk Server. |
AsteriskPassword | The password that is 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 Phone Calls settings page. |
VtigerSecretKey | Copy and paste the Vtiger Secret Key that is 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 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 trunks, 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 below within the 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 below within the 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 progress. In order to create a Phone call record in CRM, you need to fill in the start time, as the current time in CRM is set as the 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 the 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
- Log in to the CRM.
- Go to the User Profile.
- Go to Extensions.
- Go to Phone Calls.
- Add the following configuration:
- 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
- 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).
- 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.