一、为vTiger访问Elastix PBX的AMI交互设置用户名口令权限
PBX>Tools>Asterisk File Editor
编辑 manager_custom.conf: (这个文件缺省不存在)
[vtiger]
secret=vtiger
permit=0.0.0.0/255.255.255.0,,当然设置127.0.0.1也可以
read = system,call,log,verbose,command,agent,user,dialplan
write = system,call,log,verbose,command,agent,user,originate
二、重新启动Asterisk
su -
asterisk -r
manager reload
manager show user vtiger
三、vTiger设置PBX Manager模块
In vTiger go to Module Manager --> SoftPhone Server Settings
Asterisk server IP: 192.168.180.182,当然设置127.0.0.1也可以
Asterisk server port: 5038
Asterisk username: vtiger
Asterisk password: vtiger
四、修改vtigercrm的Asterisk集成脚本
Edit file /var/www/html/vtigercrm/modules/PBXManager/utils/AsteriskClass.php
and find "$context =" and replace with "$context = "from-internal";"
一共有三处
switch($typeCalled){
case "SIP":
$context = "from-internal";
break;
case "PSTN":
$context = "from-internal";//"outbound-dialing";
break;
default:
$context = "from-internal";
}
$this->createCall($from, $to, $context);
}
五、配置后台脚本,监控Asterisk 入局电话
修改 /var/www/html/vtigercrm/cron/modules/PBXManager/AsteriskClient.php
修改
chdir('../../../');
# In case chdir is not permitted
#ini_set('include_path','../../../);
为
# chdir('../../../');
# In case chdir is not permitted
ini_set('include_path','/var/www/html/vtigercrm/');
设置脚本reboot后开机自动运行
vim /etc/rc.local
nohup /usr/bin/php /var/www/html/vtigercrm/cron/modules/PBXManager/AsteriskClient.php > /var/log/asterisk/AsteriskClient.log 2>&1 &
重新启动机器之前,可以手动启动脚本
nohup /usr/bin/php /var/www/html/vtigercrm/cron/modules/PBXManager/AsteriskClient.php > /var/log/asterisk/AsteriskClient.log 2>&1 &
排错:# tail -f /var/log/asterisk/AsteriskClient.log
六、确保vTiger用户(普通用户如销售、客服)的user profile 中有extencion number
例如,分机号码101被外线呼叫后,该分机绑定的vTiger CRM用户(销售,呼叫中心工作人员)的电脑屏幕上弹出相应客户的Contact, Order等信息。
vtiger点击右上角的My Preferences,
Asterisk Extension :设置为101
Receive Incoming Calls 选中
可选:vTiger中客户联系人有电话号码设置
比如用户Yang Jiang的手机号码为1381234567
七、创建Account,Contact,创建测试啦
手机拨打Asterisk电话分机100,SIP话机接入电话振铃;
普通用户登录的vTiger CRM网页中,右下角”弹出屏幕“提示有来电,显示来电号码,来电人姓名,点击来电人名可以打开这个Contact,查看他的订单等CRM相关信息。
注意:截屏中为英文的,实际汉化vtiger后,弹屏/界面都是中文的)