I've found a lot of callsbacks LIVE not called in vicidial_callbacks table, on active list too (SELECT * FROM `vicidial_callbacks` WHERE status = 'LIVE' and lead_id not in (select lead_id from vicidial_hopper))
The process for callbacks is:
AST_VDhopper.pl looks for ACTIVE callbaks where callback_time < now and
1) change the status from ACTIVE to LIVE on vicidial_callbacks table
2) change the status from CBHOLD to CALLBK on vicidial_list
3) insert the lead in vicidial_hopper table
We usually use the "force reset hopper" option after important changes on campaigns, and this options execute the following query:
DELETE from vicidial_hopper where campaign_id='$campaign_id' and status IN('READY','QUEUE','DONE');
leaving callbacks on status LIVE, then no more callable because AST_VDhopper.pl search only for ACTIVE.
To avoid changes on AST_Vdhopper.pl I'll solve my problem adding a cron with the following script
- Code: Select all
$sql1 = "SELECT lead_id
FROM `vicidial_callbacks`
WHERE status = 'LIVE' and lead_id not in (select lead_id from vicidial_hopper) ";
$rslt = mysql_to_mysqli($sql1, $link);
if (mysqli_num_rows($rslt) > 0) {
while ($row = mysqli_fetch_array($rslt)) {
$sql2 = "UPDATE vicidial_callbacks
SET
status = 'ACTIVE'
WHERE
lead_id ={$row['lead_id']}";
mysql_to_mysqli($sql2, $link);
$sql3 = "UPDATE vicidial_list
SET
status = 'CBHOLD'
WHERE
lead_id ={$row['lead_id']}
AND status = 'CALLBK' ";
mysql_to_mysqli($sql3, $link);
}
}
but the best solution is to change the query that loads callbacks from
SELECT vicidial_callbacks.lead_id,recipient,campaign_id,vicidial_callbacks.list_id,gmt_offset_now,state,vicidial_callbacks.lead_status,vendor_lead_code FROM vicidial_callbacks,vicidial_list where callback_time <= '$now_date' and vicidial_callbacks.status='ACTIVE' and vicidial_callbacks.lead_id=vicidial_list.lead_id
in
SELECT vicidial_callbacks.lead_id,recipient,campaign_id,vicidial_callbacks.list_id,gmt_offset_now,state,vicidial_callbacks.lead_status,vendor_lead_code
FROM vicidial_callbacks,vicidial_list
where
((callback_time <= '$now_date' and vicidial_callbacks.status='ACTIVE') OR ((vicidial_callbacks.status='LIVE' AND lead_id not in (select lead_id from vicidial_hopper))))
and vicidial_callbacks.lead_id=vicidial_list.lead_id
or something like that.