Integracion vtiger asterisk | Asterisk PBX | vTiger for incoming call with popup show customer detail

I. Install Vtiver 6

  1. install database

yum install php-imap -y

CREATE DATABASE Vtiger6 CHARACTER SET utf8 COLLATE utf8_general_ci;

  1. preparing php.ini

nano /etc/php.ini

register_globals = Off

allow_call_time_pass_reference = on

error_reporting = E_WARNING & ~E_NOTICE

safe_mode = off

display_errors = on

file_uploads = on

max_execution_time = 0

memory_limit = 512M

log_errors = off

output_buffering = on

short_open_tag = On

memory_limit = 512M

 

  1. preparing source code

tar zxf vtigercrm6.4.0.tar.gz

mv vtigercrm crm

cd crm

chown -R root:root crm

 

chown   root:root config.inc.php

chown   root:root tabdata.php

chown   root:root install.php

chown   root:root parent_tabdata.php

chown   root:root cache

chown   root:root cache/images/

chown   root:root cache/import/

chown   root:root storage/

chown   root:root install/

chown   root:root user_privileges/

chown   root:root smarty/cache/

chown   root:root smarty/templates_c/

chown   root:root modules/emails/templates/

chown   root:root modules/

chown   root:root cron/modules/

chown   root:root test/vtlib/

chown   root:root backup/

chown   root:root smarty/templates/modules/

chown   root:root test/wordtemplatedownload/

chown   root:root test/product/

chown   root:root test/user/

chown   root:root test/contact/

chown   root:root test/logo/

chown   root:root logs/

chown   root:root modules/webmails/tmp/

chown   root:root includes/runtime/

chown   root:root include/utils/

chown   root:root test/vtlib/HTML

chown   root:root include/utils/

chown   root:root include/utils/

chown   root:root include/utils/

chown   root:root includes/runtime/

chown   root:root test/templates_c/

chown   root:root includes/runtime/

chown   root:root test/

chown   root:root vtlib/

chown   root:root user_privileges/

chmod 777 libraries/htmlpurifier/library/HTMLPurifier/DefinitionCache/

chmod 777 includes/runtime/

chmod 777 test/

chmod 777 vtlib/

chmod 777 user_privileges/

 

chmod -R a+rw config.inc.php

chmod -R a+rw tabdata.php

chmod -R a+rw install.php

chmod -R a+rw parent_tabdata.php

chmod -R a+rw cache

chmod -R a+rw cache/images/

chmod -R a+rw cache/import/

chmod -R a+rw storage/

chmod -R a+rw install/

chmod -R a+rw user_privileges/

chmod -R a+rw Smarty/cache/

chmod -R a+rw Smarty/templates_c/

chmod -R a+rw modules/Emails/templates/

chmod -R a+rw modules/

chmod -R a+rw cron/modules/

chmod -R a+rw test/vtlib/

chmod -R a+rw backup/

chmod -R a+rw Smarty/templates/modules/

chmod -R a+rw test/wordtemplatedownload/

chmod -R a+rw test/product/

chmod -R a+rw test/user/

chmod -R a+rw test/contact/

chmod -R a+rw test/logo/

chmod -R a+rw logs/

chmod -R a+rw modules/Webmails/tmp/

 

  1. installing

http:// IP/crm

put all the values you need and install.

 

II. Integrating incoming call

  1. Table for incoming call

table_for_incoming

CREATE TABLE `income_call` (

`id` int(11) NOT NULL AUTO_INCREMENT,

`phone_num` varchar(15) DEFAULT NULL,

`extension` varchar(10) DEFAULT NULL,

`date` datetime DEFAULT NULL,

PRIMARY KEY (`id`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1;

 

  1. Insert new incoming call

Copy “test_insert_new_call.php” to “var/www/html/crm/incoming/”

/var/www/html/crm/incoming/test_insert_new_call.php?phone_no=xxxxx&extension=1000

insert_for_new_pickup_fone

  1. Embed javascript on header of Vitger6 at the and of file

/var/www/html/crm/layouts/vlayout/modules/Vtiger/resources/Header.js

//Put this content at the end of file//

/**

* @author Chau Ngoc Huynnh | Realtime Solutions

* @Email chaungochuynh@realtime.vn

* @copyright 2016

*/

<script>

//===========.::Bussiness From Realtime Solutions 2016 – wwwrealtime.vn::.============

function newguys(url,ext){

var xmlhttp = new XMLHttpRequest();

xmlhttp.onreadystatechange = function() {

if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {

var json = xmlhttp.responseText;

obj = JSON.parse(json);

var posts=obj.posts;

var post = posts[0].post;

var postext = post.phone_num;

//alert(JSON.stringify(post));  First Object

//alert(postext);

if(postext != null)

{

window.open(url + postext, “_blank”);

}

}

}

xmlhttp.open(“POST”,”incoming/webservice_incom.php?extension=” + ext + “&format=json”, true);

xmlhttp.send();

}

setInterval(function(){

newguys(‘incoming/Vtiger6_Open_URL.php?phone=’, ‘100’);

},3*1000);

//======.::END OF APPENDING::.==================================

</script>

 

 

 

  1. Put this files “Vtiger6_Open_URL.php” to “/var/www/html/crm/incoming”

This file will check if customer phone present in Vtiger DB and popup URL

open_url_Vtiger

When get new incoming phone number we need call from script put at header of Vtiger6

http://IP/crm/incoming/Vtiger6_Open_URL.php?phone=xxxxxxx

 

  1. Get extension from configuring

check-result

 

 

Result when ext: 1000 pick up the phone: (this is what we want to show 😉 ) just only 1000 show up this information when pickup

result

 

 

Next Click to call (c2c Vtiger 6.x)

integration Vtiger6 and asterisk 11 with click to call for sumary view, we have Call button for click call to Asterisk Server.

1

 

integration Vtiger6 and asterisk 11 with click to call for full view, we have Call button for click call to Asterisk Server.

2

 

See demo:

Mr Huynh.

Contact: sales@realtime.vn | chaungochuynh@realtime.vn

Hotline: 08 730 33888 | 0933119056

My skype: chaungochuynh15

Leave a Reply