Update vtiger field through Dispo Call URL

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

Update vtiger field through Dispo Call URL

Postby eroennig » Wed Mar 05, 2014 12:17 pm

I am trying use the "Dispo Call URL" function to automatically update the status of a vtiger lead. However, I seem to need some help :) Has anyone set this up already and could give me a quick step-by-step tutorial on how to do this?

Thanks
Goautodial 3.3 | Vicidial 2.7-401a Build 130508-2256 | Asterisk 1.8.23 | Single Server
eroennig
 
Posts: 22
Joined: Tue Dec 17, 2013 12:26 pm

Re: Update vtiger field through Dispo Call URL

Postby williamconley » Tue Apr 01, 2014 9:41 pm

dispo call url is not a function, it's a php script. there should be an example (or two) in the agc folder.

In fact, have a look at:
/usr/src/astguiclient/trunk/www/agc/dispo_move_list.php
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Update vtiger field through Dispo Call URL

Postby TroyD » Tue May 20, 2014 4:02 pm

This is what Im playing with to update Sugarcrm. Although I have a seperate table for phones, you can easily get the idea and modify. Also you should put some if ispost statements in there to handle things better. I am assuming here that I will always have a vaild post.. There is a better way to do this Im sure of it, but at least it will get you going down the path to updating CRM upon dispositions.. (Currently I am not getting a value posted for the security_phrase field but hope to resolve this soon)

This is for writing to MSSQL with php 5.3 You will have to use other methods for writing to db if you use mysql.. Google is your friend.. Basically change sqlsrv to mysql or mssql for pdo extensions..

(Hosting this on IIS by the way, you can host on apache if you like)

*******************Begin PHP Code **************
<?php

//Set Debug options overriding the PHP settings temporarily
ini_set('display_errors', 1);
error_reporting(E_ALL);

//Define SQL server connection
$serverName = "192.111.000.123";
$connectionInfo = array( "Database"=>"NEWCRM", "UID"=>"admin", "PWD"=>"yourpasswd" );
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn === false ) {
die( print_r( sqlsrv_errors(), true));
}

//Get status from dialer and store in variable
$phoneid = $_GET["security_phrase"];
$dial_status = $_GET["dispo"];

// Deal with the time and date and set into variable
date_default_timezone_set("UTC");
$timestamp = date("Y-m-d H:i:s", time());
// echo "$timestamp";

//Query to update CRM with posted data from dialer
$sql = "UPDATE phone_phones SET dial_status = '".$dial_status."', last_called_time = '".$timestamp."', dialer_call_attempts = dialer_call_attempts +1 Where id = '".$phoneid."'";

// If we have addl paramaters use this
//$params = array(1, "some data");

// Run the query if any errors then die.
$stmt = sqlsrv_query( $conn, $sql);
if( $stmt === false ) {
die( print_r( sqlsrv_errors(), true));
}


// Close the SQL connection.
sqlsrv_close( $conn);


// Log posted variables for debugging
file_put_contents( "dialogger.txt", print_r($_REQUEST, true));

?>

*********************** END PHP Code *******************
|3 Server - Cluster - WEB/DB/DIALER - ViciBox Install
|ASTERISK VER - Asterisk 11.25.1-vici
|AstGuiClient VERSION: 2.14-678a
|BUILD: 180613-0943
TroyD
 
Posts: 96
Joined: Fri Nov 02, 2007 4:03 pm

Re: Update vtiger field through Dispo Call URL

Postby mav2287 » Tue May 20, 2014 5:39 pm

We also use Vtiger on one of our installs. We have been using 6.0.0 which is pretty, but not as functional. We pull up leads with the following.

Code: Select all
<iframe src="http://XXX.XXX.XXX.XXX/vtigercrm/index.php?module=Leads&view=Detail&record=--A--vendor_lead_code--B--" style="background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame"  width="--A--script_width--B--" height="--A--script_height--B--" STYLE="z-index:17"> </iframe>


We sync the lead ids to a custom field with the following mysql query
Code: Select all
 update vtiger_leadscf set cf_739 = leadid;


This way we can just do a normal export for vtiger and then drop that into vicidial. Then we dial on it and it pops the leads. The way we do notes is similar to the script already posted above.
ViciBox5.x86_64-5.0.3.preload from .iso upgraded to 13.1 | VERSION: 2.10-444c BUILD: 150129-0828 | 1.8.32.2-vici | Dual Server | No Digium/Sangoma Hardware | No Extra Software After Installation | Intel twin quad core 3Ghz Xeon chips | 32gb of RAM
mav2287
 
Posts: 256
Joined: Thu Oct 03, 2013 6:47 pm

Re: Update vtiger field through Dispo Call URL

Postby williamconley » Mon Jul 07, 2014 11:57 pm

That would be something to ask on a PHP and/or MySQL forum. Here, we would suggest you open the aforementioned php file and modify it to suit your needs. It's fairly easy for any php/mysql tech who is familiar with Vicidial and vTiger ... but still should not present a problem for anyone who is ONLY familiar with php/MySQL. But bringing you up to speed on two languages here in this post is a bit outside ... Especially since you lead with "hey, show me how to do something vague". Like ... teach me how to drive (instead of teach me how to start a car, mom gave me the key).
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)


Return to Support

Who is online

Users browsing this forum: No registered users and 116 guests