Dispo Call URL Not always executing

All installation and configuration problems and questions

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

Dispo Call URL Not always executing

Postby Kinghtflyer » Mon Dec 02, 2013 11:16 am

Single Server Vicibox 3.04 From 64bit-Preload.iso VERSION: 2.8-403a BUILD:1305101350 : Asterisk 1.4.44-vici : NO Digium HArdware : Single Server
AMD 8-CORE 4Ghz 16GigRAM : MSI 3070 Mboard : 3-2TB SATA Drives : Disabled RAID : No extra software :

6 agents logged in on all servers
System Load Average: 0.93 0.96 1.01 M

Sometimes we have 10 agents. I have never seen load over 1.5 (8 cores)

Here is the URL.
VARhttp://24.155.188.156/postDisp3.php? ... dispo--B--

This php simply inserts the disposition into a mysql DB separate of vicidial (But on the same server)

Here is the code. I don't believe it is a loaded server issue. But I will get the latest vicibox and try setting up a 2 server cluster.

<?php

$phonenum= $_GET['phonenum'];
$agentname= $_GET['agentname'];
$lms_campaign= $_GET['lms_campaign'];
$vici_campaign= $_GET['campaign'];
$vici_list=$_GET['list'];
$product=$_GET['product'];
$disposition=$_GET['disposition'];
$agentID=substr($agentname,0,3);
$agentname=substr($agentname,4);
$LeadId=$_GET['lead_id'];



$db=mysql_pconnect("localhost","root","secret");
if (!$db){
echo "Vici-MySQL Database error!";
exit;
}
mysql_select_db("preleadDB", $db);
$sql="INSERT INTO `prelead` (phone_num,agentID,agentName,lms_campaign,vici_campaign,product,disposition)
VALUES
('$phonenum','$agentID','$agentname','$lms_campaign','$vici_campaign','$product','$disposition')";
if (!mysql_query($sql,$db))
{
die('Error: ' . mysql_error());
}
echo "1 record added<BR>";
Kinghtflyer
 
Posts: 69
Joined: Wed Sep 19, 2012 12:10 pm

Re: Dispo Call URL Not always executing

Postby williamconley » Mon Dec 02, 2013 9:03 pm

dispo call url ONLY executes if an agent dispositions the call. if there is no answer (busy, no answer, disconnected ...) the dispo call url never fires. Also if an agent closes her web page without dispositioning that last lead (lunch time?).

Note: Your "Build" number for the vicidial version is ... a bit off. LOL

You should also consider switching to mysqli instead of mysql in php. Here is a sample function to simplify mysqli operation.

Change DEBUG to false instead of deleting it (it will resolve to "true" if missing in some systems ... thus tossing debug output!)

Put the function at the bottom of any page (not in any loops or if statements) and use the "executor" anywhere you like on the page.

It grabs Vicidial DB access automatically if on the same server. You may need to modify the relative path to the dbconnect.php file, of course.

There is a sample "update" and "get" line for proper usage. Those are all you need within your code to grab data after the functions are on the page.

Code: Select all
<?PHP
define('DEBUG', true);

require_once("../vicidial/dbconnect.php");
$DBLink = new mysqli($VARDB_server, $VARDB_user, $VARDB_pass, $VARDB_database, $VARDB_port);

$Query = "SELECT $fieldlist from $table $conditions";
UpdateData($DBLink, $Query);
$Records=GetData($DBLink, $Query);

print_r($Records);

foreach ($Records as $Record){
     print_r($Record);
}

function GetData($DBLink, $Query) {
    if (DEBUG)
        echo "<pre>Query: $Query\n</pre>";
    if ($Result = $DBLink->query($Query)) {
        if (DEBUG) {
            printf("<pre>Affected rows (Non-Select): %d\n</pre>", $DBLink->affected_rows);
        }
        while ($Record = $Result->fetch_assoc()) {
            $ReturnData[] = $Record;
        }
        return $ReturnData;
    } else {
        if (DEBUG) {
            printf("<pre>Errormessage: %s\n</pre>", $DBLink->error);
            printf("<pre>Affected rows (Non-Select): %d\n</pre>", $DBLink->affected_rows);
            echo "<pre>No Records Returned\n</pre>";
        }
        return false;
    }
}

function UpdateData($DBLink, $Query) {
    if (DEBUG)
        echo "<pre>Query: $Query\n</pre>";
    if ($Result = $DBLink->query($Query)) {
        if (DEBUG) {
            printf("<pre>%s\n</pre>", $DBLink->info);
            printf("<pre>Affected rows (Non-Select): %d\n</pre>", $DBLink->affected_rows);
        }
        return;
    } else {
        if (DEBUG) {
            printf("<pre>Errormessage: %s\n</pre>", $DBLink->error);
            printf("<pre>%s\n</pre>", $DBLink->info);
        }
        return;
    }
}
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: Dispo Call URL Not always executing

Postby Kinghtflyer » Tue Dec 03, 2013 9:06 am

Thanks for the tip(s)
I have checked the 'search for leads' and the 2 dispositions I am looking for "XFER" and "LMS" are showing up in the DiSPO history in ViciDial but not always in 'Our' database table. XFER is what we have the "Fronter" disposiition when that agent has qualified a lead and transfers to a "Closaer". It seems the dispo POST URL always captures this disposition.

The Closer then upon further conversation with the customer has the option to hit web form1 which pushes all the captured data from lead list and the custom fields into our 'CMS lead management system'. Also when the 'closer' dispositions the lead as a 'LMS' when terminating the call, the dispo post-url should insert another record into our database. This doesn't seem to happen always. I have seen it first hand. If I get the agent to dummy dial the lead, and re-dispo it as LMS, the post-url works okay. My assumptioon, maybe mysql is overloaded? This used to work without flaw. We only added a couple of agents, and with our load as low as it is it doesn't seem that is the cause.

I am going to upgrade vici this weekend and take a wait and see.
Kinghtflyer
 
Posts: 69
Joined: Wed Sep 19, 2012 12:10 pm


Return to Support

Who is online

Users browsing this forum: No registered users and 156 guests