How Difficult is It to Host Your Own SIP Based Dialer?

I wouldn't recommend vicibox for a production server, there is so much twikes that need to be done, also the asterisk version used is a pain in the neck. I rather used the scratch installation suggested by the majority of the vicidial users , sure requires a lot more timing and little knowledge, but at lease you will learn from the ground, the ups and downs of your box.
-----------
Great business opportunity for the insurance industry, I'm trying to pull this kind of project since 2009, but unfortunately lack of time and hight bills (living in NY) keep me out to completed.. Great initiative from your side Keep it up !!!!!
 
I really haven't ran into issues with it yet, very happy with the newest version of vicibox. Having said that I'm working on a couple diff additions to the code right now for stuff that was missing from the non agent API that I had to add.

It isn't perfect but nothing is, and it's easy for me to work with.
 
Ok I see, what are your trying to do with the script.
------
In regards to the vici - Sugar integration, have you try the Dispo Call URL method... it maybe a lot more efficient and less headaches.. what do you think?
 
That's part of how it's hooked together. The data flows both ways in my setup though. A ton of the dialers out there do not factor in that sometimes an agent gets inbound calls that do not come through the dialer and it needs to be fixed so that a status change in the crm reflects to the dialer.

Im already well past that hurdle.

The reason I started on this in the first place was because there were things about every other crm and dialer I used together that I found to be cumbersome because the developers appeared to not be interested in single agents and appeared to not understand several very simple things about sales process.
 
the developers appeared to not be interested in single agents

Very, very, very true. I've even had predictive dialer companies tell me this. Basically, predictive dialers don't work with less than 5 agents. To be honest, this is a very true statement. But then, they totally ignore the enhancements that can be done for a single agent in a more 'power dialer' style of usage.

What frustrates me with most dialers (and some crms) is they require that you throw away a lot of data. For instance, I have literally millions of 'leads' with things like home value, income range, type of mortgage, spouse names, etc, but when I load it into a dialer, a large part of this is lost.

Now, trying to sync that back up again in the future is almost impossible. I tried vanillasoft for a while, they have a decent crm system, but they don't understand that I need to call 5000 numbers to generate 100 prospects. They do understand nurturing those 100 prospects.

On the other hand, I don't really care about switching caller ids. I have enough people in my area that I'll be busy for the next several years. I say I'm a local agent to any of the 8 area codes within 50 miles of my office.

Dan
 
Sugar is nice in that you can make a custom field for anything, then you don't pass all the data to the dialer, but when it connects it pops up the sugar interface because it opens the lead up there via the webform using the leadid field in sugar. I could have fields for their favorite color and hobbies if I wanted. At some point it would get ignorant and start causing issues with the sql to have way more than necessary, but there isn't a limit on what I can store.

They aren't interested in single agents because apparently we're more trouble, and we don't make them much money, and larger outfits pay for more seats.
 
I see how it works from vici to sugar using the webform and Url Dispo , but how do you trigger the other way around from Sugar to Vici.. If you can share some code, I will love to see it..

Thanks.
 
You have to take sugars logic hook functions or sugarbean functions, have them open a php script on the sugar server that then pulls the variables you need via mysql, then passes them into vicidial using the non-agent api or a script on the vicidial server side.

You can also perform functions with crontab, using it to run a mysql query on the sugar server side to trigger events that are then passed into vicidial.
- - - - - - - - - - - - - - - - - -
A simple way is go download the processmanager addon for sugar, it has a setting to run a custom script.
 
Last edited:
<?php



class calllead extends SugarBean {

function calllead($focusObjectId,$focusObjectType)

{





$id = $focusObjectId;



$leadid = '\''.$id.'\''; //adds single quotes for sql query



///////////////////////////////////////////////////////////////////////////

//Verify lead does exist in sugar and pull the row into an array

///////////////////////////////////////////////////////////////////////////



//connect to sugar db

$link = @mysql_connect('localhost','dbuser','password') or die("couldn't connect");

$db = @mysql_select_db('sugardbname',$link) or die("couldn't connect");

$sql = "SELECT * FROM leads WHERE id = $leadid";

$match_query = mysql_query($sql) or die('Query failed: ' . mysql_error() . "<br />\n$sql");

$lead = mysql_fetch_array($match_query);



//close db

@mysql_close($link); //close mysql



$dnc = $lead['do_not_call'];



if($dnc == 0){ //Check first to see if on Do not call list inside sugarcrm



//Extract variables from mysql array



$first_name = $lead['first_name'];

$last_name = $lead['last_name'];

$phone_number = $lead['phone_work'];

$vendor_lead_code = $id;

$postal_code = $lead['primary_address_postcode'];

$city = $lead['primary_address_city'];

$state = $lead['primary_address_state'];

$status = 'NEW';

$search_method = 'VENDOR_LEAD_CODE';

$search_location = 'LIST';





///////////////////////////////////////////////////////////////////////////

//Post to Vicidial

///////////////////////////////////////////////////////////////////////////



//Post URL for Vicidial

$url = 'http://vicidial/non_agent_api.php?';



//variables being posted

$source = 'test';

$user =;

$pass = ';

$function = 'update_lead';

$list_id = 8888;

$dnc_check = 'Y';





$fields = array(

'source'=>urlencode($source),

'user'=>urlencode($user),

'pass'=>urlencode($pass),

'function'=>urlencode($function),

'list_id'=>urlencode($list_id),

'dnc_check'=>urlencode($dnc_check),

'first_name'=>urlencode($first_name),

'last_name'=>urlencode($last_name),

'search_location'=>urlencode($search_location),

'search_method'=>urlencode($search_method),

'vendor_lead_code'=>urlencode($vendor_lead_code),

'phone_number'=>urlencode($phone_number),

'postal_code'=>urlencode($postal_code),

'status'=>urlencode($status)



);



//url-ify the data for the POST

foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }

rtrim($fields_string,'&');



//open connection

$ch = curl_init();





//set the url, number of POST vars, POST data

curl_setopt($ch,CURLOPT_URL,$url);

curl_setopt($ch,CURLOPT_POST,count($fields));

curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);

curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);



//execute post

$result = curl_exec($ch);



$badresult = 'ERROR: update_lead NO MATCHES FOUND IN THE SYSTEM';

$badlength = strlen($badresult);



$result = substr($result,0,$badlength);



if($result == $badresult){



///////////////////////////////////////////////////////////////////////////

//Add to Vicidial as New lead

///////////////////////////////////////////////////////////////////////////



//variables being posted

$function = 'add_lead';

$dnc_check = 'Y';

$add_to_hopper = 'Y';





$fields = array(

'source'=>urlencode($source),

'user'=>urlencode($user),

'pass'=>urlencode($pass),

'function'=>urlencode($function),

'phone_number'=>urlencode($phone_number),

'list_id'=>urlencode($list_id),

'dnc_check'=>urlencode($dnc_check),

'first_name'=>urlencode($first_name),

'last_name'=>urlencode($last_name),

'add_to_hopper'=>urlencode($add_to_hopper),

'vendor_lead_code'=>urlencode($vendor_lead_code),

'date_of_birth'=>urlencode($date_of_birth),

'postal_code'=>urlencode($postal_code),

'gender'=>urlencode($gender)

);



//url-ify the data for the POST

foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }

rtrim($fields_string,'&');



//open connection

$ch = curl_init();





//set the url, number of POST vars, POST data

curl_setopt($ch,CURLOPT_URL,$url);

curl_setopt($ch,CURLOPT_POST,count($fields));

curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);

curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);



//execute post

$result = curl_exec($ch);

$id = urlencode($id);



//close connection

curl_close($ch);



}







}

}

}

?>
- - - - - - - - - - - - - - - - - -
Some info was removed from that script to protect the sql db and the logins and location of my vicidial server, but you can get the jist. Sugar is passing 2 variables out to this script, the lead id and the category "lead". It then takes that information, polls the mysql db, grabs the whole row of the lead with matching id, then grabs the variables out of the array from the mysql, and curls the output into vicidial on the condition that it does not have a donotcall flag.

If it does not see that lead in the vicidial db at all, it then adds it to the top of the list into the hopper to dial.

There is a second script that fires right behind it in case that the lead is in the dialer that resets the called since last in vicidial to no on the server side.

Lots of mysql manipulation takes place.

The more you dig into sugarcrm, the more you notice its just a glorified webpage built on top of a mysql db.

It's halfway tempting to rebuild the whole webpage and ditch their interface entirely.
 
Last edited:
The logic is great, I just having a few problem with the Curl function but I guess is my lack of knowledge, I getting a time out response... anyway
Did you noticed the sql user CRON?? that can create a security concern on a production server ????
----------
Thanks for the script
 
Back
Top