Learn how to set up Asterisk in the Phone Calls module.
Note! Vtiger supports Asterisk Direct Gateway version 1.4 & 1.6 and Asterisk version 1.8 to 11.
This feature is available in Sales Starter, Sales Professional, Help Desk Starter, Help Desk Professional, Vtiger One Professional and Vtiger One Enterprise editions.
Phone Calls module is not readily available in Vtiger. It has to be installed manually to get started with the module. Follow these simple steps to install the module.
After installing Vtiger Asterisk Connector, please follow few simple steps to configure your Asterisk Server information in Vtiger CRM.
Configure your Asterisk Server information
Vtiger Asterisk App URL - configure server name where Vtiger Asterisk Connector is installed as shown:
Syntax : Protocol://Asterisk_Server_IP:Port
|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 Incoming Call Pop-up.|
|Callback URL||Callback URL that has to be configured in Vtiger Asterisk Connector|
|Vtiger Secret Key||Unique key generated for authentication, which has to be configured in Vtiger Asterisk Connector.|
8. Click Save button.
For each user who is allowed to handle incoming and outgoing calls from the CRM, the extension number should be configured in the User preferences page.
Once the configuration is completed on both sides i.e., Vtiger and Asterisk, you are now ready to make and receive calls in the CRM.
Note! Current integration does not support PSTN based connections (only SIP Trunks)
Vtiger Asterisk application acts a gateway to connect to Vtiger CRM from the Asterisk Server. It makes it easy for Vtiger and Asterisk interaction over HTTP when incoming or outgoing calls need to be handled.
Vtiger Asterisk Connector provides following features:
Click here to view all the features list.
Asterisk 1.8 onwards
Java 1.7 onwards
Vtiger Details [Copy these details from Vtiger CRM PhoneCalls settings page]
VtigerServerURL - https://yourondemand.od1.vtiger.com
VtigerSecretKey - [Copy this detail from Vtiger CRM Settings > Extensions > Phone Calls page]
|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.|
|VtigerURL||Copy and Paste the callback URL that is generated in your Vtiger Instance. You can find this under PhoneCalls settings page.|
|VtigerSecretKey||Copy and Paste the Vtiger Secret Key that is generated in your Vtiger Instance. You can find this under PhoneCalls settings page.|
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 ---
exten => _X.,1,Agi(agi://0.0.0.0/incoming.agi)
- _X = pattern to accept any number as extension
- 0.0.0.0 = VtigerAskteriskConnector_ServerIP (or the one configured in VtigerAskteriskConnector/VtigerAskteriskConnector.properties)
- DID = DID provided by your service provider.
Edit Asterisk cdr configuration file: (cdr_manager.conf) and modify “enabled” field as shown below:
;--- START --- enabled = yes ;--- END ---
;--- START --- permit = Vtiger_IP/255.255.255.0 ;--- END ---
;--- START --- permit = ASTERISK_IP/255.255.255.0 ;--- END ---
Trunks: Select any one of the outbound trunk, say “XYZ” from FreePBX.
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 ---
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
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)
1. For incoming call Asterisk server will not send the start-time and end-time to CRM when it is still in ringing or on-going-progress. In order to create 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 Asterisk server notifies CRM about the call details, which will include the actual start-time and end-time of the phone call. You can view the call details in the respective Phone call record.
2. On triggering a call via Asterisk provider, the record ID is sent to the provider.
Asterisk Manager Settings
AMI user added in connector config file should have 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 permit field.
permit = yy.yy.yy.yyy/255.255.255.0
Go to CRM Settings – > Extensions –> Phone Calls. Add 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 features and benefits of this integration, please check Asterisk + Vtiger CRM