diff --git a/UPGRADE b/UPGRADE index a77a2493..e505346d 100644 --- a/UPGRADE +++ b/UPGRADE @@ -41,7 +41,7 @@ NOTE: Upgrading from 1.1.12-3 to 2.0.1 is at the bottom and comments are added to the astguiclient.conf file 7. Experimental FastAGI replacement for call_log and VD_hangup AGI scripts: - FastAGI_log.pl + FastAGI_log.pl - requires cpan module Net::Server to run If you want to use it, read the comments at the top of the script Look at the docs/conf_examples/extensions.conf.sample file for examples of how to use this new feature in your dialplan diff --git a/agi/agi-VDAD_LB_closer.agi b/agi/agi-VDAD_LB_closer.agi index c58674ef..e35be91e 100644 --- a/agi/agi-VDAD_LB_closer.agi +++ b/agi/agi-VDAD_LB_closer.agi @@ -307,7 +307,7 @@ $sthA->finish(); ### insert a LIVE record to the vicidial_auto_calls table -$stmtA = "INSERT INTO vicidial_auto_calls values('','$VARserver_ip','$channel_group','LIVE','$CIDlead_id','$uniqueid','$callerid','$channel','$VDADphone_code','$VDADphone','$SQLdate','IN')"; +$stmtA = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,uniqueid,callerid,channel,phone_code,phone_number,call_time,call_type,stage) values('$VARserver_ip','$channel_group','LIVE','$CIDlead_id','$uniqueid','$callerid','$channel','$VDADphone_code','$VDADphone','$SQLdate','IN','LIVE-0')"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $affected_rows = $dbhA->do($stmtA); @@ -406,7 +406,7 @@ if ($channel_status < 1) } $sthA->finish(); - $stmtA = "UPDATE vicidial_auto_calls set status='CLOSER' where callerid='$callerid';"; + $stmtA = "UPDATE vicidial_auto_calls set status='CLOSER', stage='CLOSER-$drop_timer' where callerid='$callerid';"; $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDCL XFER : |$affected_rows|$callerid\n|$stmtA|"; &agi_output;} @@ -492,6 +492,11 @@ else $drop_timer++; } + +$stmtA = "UPDATE vicidial_auto_calls set stage='LIVE-$drop_timer' where callerid='$callerid';"; +$affected_rows = $dbhA->do($stmtA); +#if ($AGILOG) {$agi_string = "-- VDAD : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} + } diff --git a/agi/agi-VDAD_LB_closer_inbound.agi b/agi/agi-VDAD_LB_closer_inbound.agi index b51b8cfd..e1e8da61 100644 --- a/agi/agi-VDAD_LB_closer_inbound.agi +++ b/agi/agi-VDAD_LB_closer_inbound.agi @@ -344,7 +344,7 @@ $sthA->finish(); ### insert a LIVE record to the vicidial_auto_calls table -$stmtA = "INSERT INTO vicidial_auto_calls values('','$VARserver_ip','$channel_group','LIVE','$new_lead_id','$uniqueid','$callerid','$channel','$phone_code','$phone_number','$SQLdate','IN')"; +$stmtA = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,uniqueid,callerid,channel,phone_code,phone_number,call_time,call_type,stage) values('$VARserver_ip','$channel_group','LIVE','$new_lead_id','$uniqueid','$callerid','$channel','$phone_code','$phone_number','$SQLdate','IN','LIVE-0')"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $affected_rows = $dbhA->do($stmtA); @@ -451,7 +451,7 @@ if ($channel_status < 1) } $sthA->finish(); - $stmtA = "UPDATE vicidial_auto_calls set status='CLOSER' where callerid='$callerid';"; + $stmtA = "UPDATE vicidial_auto_calls set status='CLOSER', stage='CLOSER-$drop_timer' where callerid='$callerid';"; $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDCL XFER : |$affected_rows|$callerid\n|$stmtA|"; &agi_output;} @@ -542,6 +542,11 @@ else $drop_timer++; } + +$stmtA = "UPDATE vicidial_auto_calls set stage='LIVE-$drop_timer' where callerid='$callerid';"; +$affected_rows = $dbhA->do($stmtA); +#if ($AGILOG) {$agi_string = "-- VDAD : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} + } diff --git a/agi/agi-VDAD_LB_closer_inboundCID.agi b/agi/agi-VDAD_LB_closer_inboundCID.agi index cfacf012..d8474cb5 100644 --- a/agi/agi-VDAD_LB_closer_inboundCID.agi +++ b/agi/agi-VDAD_LB_closer_inboundCID.agi @@ -341,10 +341,9 @@ while ($sthArows > $cbc) $cbc++; } $sthA->finish(); - ### insert a LIVE record to the vicidial_auto_calls table -$stmtA = "INSERT INTO vicidial_auto_calls values('','$VARserver_ip','$channel_group','LIVE','$new_lead_id','$uniqueid','$callerid','$channel','$phone_code','$phone_number','$SQLdate','IN')"; +$stmtA = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,uniqueid,callerid,channel,phone_code,phone_number,call_time,call_type,stage) values('$VARserver_ip','$channel_group','LIVE','$new_lead_id','$uniqueid','$callerid','$channel','$phone_code','$phone_number','$SQLdate','IN','LIVE-0')"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $affected_rows = $dbhA->do($stmtA); @@ -451,7 +450,7 @@ if ($channel_status < 1) } $sthA->finish(); - $stmtA = "UPDATE vicidial_auto_calls set status='CLOSER' where callerid='$callerid';"; + $stmtA = "UPDATE vicidial_auto_calls set status='CLOSER', stage='CLOSER-$drop_timer' where callerid='$callerid';"; $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDCL XFER : |$affected_rows|$callerid\n|$stmtA|"; &agi_output;} @@ -542,6 +541,11 @@ else $drop_timer++; } + +$stmtA = "UPDATE vicidial_auto_calls set stage='LIVE-$drop_timer' where callerid='$callerid';"; +$affected_rows = $dbhA->do($stmtA); +#if ($AGILOG) {$agi_string = "-- VDAD : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} + } diff --git a/agi/agi-VDAD_LB_transfer.agi b/agi/agi-VDAD_LB_transfer.agi index 90131688..3fb9739a 100644 --- a/agi/agi-VDAD_LB_transfer.agi +++ b/agi/agi-VDAD_LB_transfer.agi @@ -265,7 +265,7 @@ exit; ### Grab call parameters from vicidial_auto_calls table -$stmtA = "UPDATE vicidial_auto_calls set uniqueid='$unique_id', channel='$channel',status='LIVE' where callerid='$callerid' order by call_time desc limit 1;"; +$stmtA = "UPDATE vicidial_auto_calls set uniqueid='$unique_id', channel='$channel',status='LIVE',stage='LIVE-0' where callerid='$callerid' order by call_time desc limit 1;"; $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDAD : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} if ($affected_rows > 0) @@ -393,7 +393,7 @@ if ($rec_countWAIT < 1) } $sthA->finish(); - $stmtA = "UPDATE vicidial_auto_calls set status='XFER' where callerid='$callerid';"; + $stmtA = "UPDATE vicidial_auto_calls set status='XFER', stage='XFER-$drop_timer' where callerid='$callerid';"; $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDAD XFER : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} @@ -459,6 +459,11 @@ else $drop_timer++; } + +$stmtA = "UPDATE vicidial_auto_calls set stage='LIVE-$drop_timer' where callerid='$callerid';"; +$affected_rows = $dbhA->do($stmtA); +#if ($AGILOG) {$agi_string = "-- VDAD : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} + } diff --git a/agi/agi-VDAD_LO_closer.agi b/agi/agi-VDAD_LO_closer.agi index b650dd1f..6f0b9978 100644 --- a/agi/agi-VDAD_LO_closer.agi +++ b/agi/agi-VDAD_LO_closer.agi @@ -308,7 +308,7 @@ $sthA->finish(); ### insert a LIVE record to the vicidial_auto_calls table -$stmtA = "INSERT INTO vicidial_auto_calls values('','$VARserver_ip','$channel_group','LIVE','$CIDlead_id','$uniqueid','$callerid','$channel','$VDADphone_code','$VDADphone','$SQLdate','IN')"; +$stmtA = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,uniqueid,callerid,channel,phone_code,phone_number,call_time,call_type,stage) values('$VARserver_ip','$channel_group','LIVE','$CIDlead_id','$uniqueid','$callerid','$channel','$VDADphone_code','$VDADphone','$SQLdate','IN','LIVE-0')"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $affected_rows = $dbhA->do($stmtA); @@ -406,7 +406,7 @@ if ($channel_status < 1) } $sthA->finish(); - $stmtA = "UPDATE vicidial_auto_calls set status='CLOSER' where callerid='$callerid';"; + $stmtA = "UPDATE vicidial_auto_calls set status='CLOSER', stage='CLOSER-$drop_timer' where callerid='$callerid';"; $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDCL XFER : |$affected_rows|$callerid\n|$stmtA|"; &agi_output;} @@ -496,7 +496,7 @@ if ($channel_status < 1) } $sthA->finish(); - $stmtA = "UPDATE vicidial_auto_calls set status='CLOSER' where callerid='$callerid';"; + $stmtA = "UPDATE vicidial_auto_calls set status='CLOSER', stage='CLOSER-$drop_timer' where callerid='$callerid';"; my $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDCL XFER REMOTE: |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} @@ -581,6 +581,11 @@ else $drop_timer++; } + +$stmtA = "UPDATE vicidial_auto_calls set stage='LIVE-$drop_timer' where callerid='$callerid';"; +$affected_rows = $dbhA->do($stmtA); +#if ($AGILOG) {$agi_string = "-- VDAD : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} + } diff --git a/agi/agi-VDAD_LO_closer_inbound.agi b/agi/agi-VDAD_LO_closer_inbound.agi index fa4ac35d..d8a8e0fa 100644 --- a/agi/agi-VDAD_LO_closer_inbound.agi +++ b/agi/agi-VDAD_LO_closer_inbound.agi @@ -346,7 +346,7 @@ $sthA->finish(); ### insert a LIVE record to the vicidial_auto_calls table -$stmtA = "INSERT INTO vicidial_auto_calls values('','$VARserver_ip','$channel_group','LIVE','$new_lead_id','$uniqueid','$callerid','$channel','$phone_code','$phone_number','$SQLdate','IN')"; +$stmtA = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,uniqueid,callerid,channel,phone_code,phone_number,call_time,call_type,stage) values('$VARserver_ip','$channel_group','LIVE','$new_lead_id','$uniqueid','$callerid','$channel','$phone_code','$phone_number','$SQLdate','IN','LIVE-0')"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $affected_rows = $dbhA->do($stmtA); @@ -452,7 +452,7 @@ if ($channel_status < 1) } $sthA->finish(); - $stmtA = "UPDATE vicidial_auto_calls set status='CLOSER' where callerid='$callerid';"; + $stmtA = "UPDATE vicidial_auto_calls set status='CLOSER', stage='CLOSER-$drop_timer' where callerid='$callerid';"; $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDCL XFER : |$affected_rows|$callerid\n|$stmtA|"; &agi_output;} @@ -545,7 +545,7 @@ if ($channel_status < 1) } $sthA->finish(); - $stmtA = "UPDATE vicidial_auto_calls set status='CLOSER' where callerid='$callerid';"; + $stmtA = "UPDATE vicidial_auto_calls set status='CLOSER', stage='CLOSER-$drop_timer' where callerid='$callerid';"; my $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDCL XFER REMOTE: |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} @@ -634,6 +634,11 @@ else $drop_timer++; } + +$stmtA = "UPDATE vicidial_auto_calls set stage='LIVE-$drop_timer' where callerid='$callerid';"; +$affected_rows = $dbhA->do($stmtA); +#if ($AGILOG) {$agi_string = "-- VDAD : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} + } diff --git a/agi/agi-VDAD_LO_transfer.agi b/agi/agi-VDAD_LO_transfer.agi index 17de8ca6..6d062db8 100644 --- a/agi/agi-VDAD_LO_transfer.agi +++ b/agi/agi-VDAD_LO_transfer.agi @@ -265,7 +265,7 @@ exit; ### Grab call parameters from vicidial_auto_calls table -$stmtA = "UPDATE vicidial_auto_calls set uniqueid='$unique_id', channel='$channel',status='LIVE' where callerid='$callerid' order by call_time desc limit 1;"; +$stmtA = "UPDATE vicidial_auto_calls set uniqueid='$unique_id', channel='$channel',status='LIVE',stage='LIVE-0' where callerid='$callerid' order by call_time desc limit 1;"; $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDAD : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} if ($affected_rows > 0) @@ -392,7 +392,7 @@ if ($rec_countWAIT < 1) } $sthA->finish(); - $stmtA = "UPDATE vicidial_auto_calls set status='XFER' where callerid='$callerid';"; + $stmtA = "UPDATE vicidial_auto_calls set status='XFER', stage='XFER-$drop_timer' where callerid='$callerid';"; $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDAD XFER : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} @@ -472,7 +472,7 @@ if ($rec_countWAITrem < 1) } $sthA->finish(); - $stmtA = "UPDATE vicidial_auto_calls set status='XFER' where callerid='$callerid';"; + $stmtA = "UPDATE vicidial_auto_calls set status='XFER', stage='XFER-$drop_timer' where callerid='$callerid';"; $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDAD XFER REMOTE: |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} @@ -537,6 +537,11 @@ else $drop_timer++; } + +$stmtA = "UPDATE vicidial_auto_calls set stage='LIVE-$drop_timer' where callerid='$callerid';"; +$affected_rows = $dbhA->do($stmtA); +#if ($AGILOG) {$agi_string = "-- VDAD : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} + } diff --git a/agi/agi-VDADautoREMINDER.agi b/agi/agi-VDADautoREMINDER.agi index 3b136c81..18854310 100644 --- a/agi/agi-VDADautoREMINDER.agi +++ b/agi/agi-VDADautoREMINDER.agi @@ -283,7 +283,7 @@ while ($sthArows > $rec_count) $sthA->finish(); ### Grab call parameters from vicidial_auto_calls table -$stmtA = "UPDATE vicidial_auto_calls set uniqueid='$unique_id', channel='$channel',status='LIVE' where callerid='$callerid' order by call_time desc limit 1;"; +$stmtA = "UPDATE vicidial_auto_calls set uniqueid='$unique_id', channel='$channel',status='LIVE',stage='LIVE-0' where callerid='$callerid' order by call_time desc limit 1;"; $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDAD : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} if ($affected_rows > 0) @@ -368,7 +368,7 @@ if ($pin == "1") ### send call to voicemail # # Thank you for your response, we will now transfer you to your agent's voicemail box. # $AGI->stream_file("$voicemail_xfer_file"); - $stmtA = "UPDATE vicidial_auto_calls set status='XFER' where callerid='$callerid';"; + $stmtA = "UPDATE vicidial_auto_calls set status='XFER', stage='XFER-$drop_timer' where callerid='$callerid';"; $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDAD XFER : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} diff --git a/agi/agi-VDADautoREMINDERxfer.agi b/agi/agi-VDADautoREMINDERxfer.agi index 211444d2..da391cc1 100644 --- a/agi/agi-VDADautoREMINDERxfer.agi +++ b/agi/agi-VDADautoREMINDERxfer.agi @@ -285,7 +285,7 @@ while ($sthArows > $rec_count) $sthA->finish(); ### Grab call parameters from vicidial_auto_calls table -$stmtA = "UPDATE vicidial_auto_calls set uniqueid='$unique_id', channel='$channel',status='LIVE' where callerid='$callerid' order by call_time desc limit 1;"; +$stmtA = "UPDATE vicidial_auto_calls set uniqueid='$unique_id', channel='$channel',status='LIVE',stage='LIVE-0' where callerid='$callerid' order by call_time desc limit 1;"; $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDAD : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} if ($affected_rows > 0) @@ -370,7 +370,7 @@ if ($pin == "1") ### send call to voicemail # # Thank you for your response, we will now transfer you to your agent's voicemail box. # $AGI->stream_file("$voicemail_xfer_file"); - $stmtA = "UPDATE vicidial_auto_calls set status='XFER' where callerid='$callerid';"; + $stmtA = "UPDATE vicidial_auto_calls set status='XFER', stage='XFER-$drop_timer' where callerid='$callerid';"; $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDAD XFER : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} diff --git a/agi/agi-VDADcloser.agi b/agi/agi-VDADcloser.agi index 7ca72602..8bee824e 100644 --- a/agi/agi-VDADcloser.agi +++ b/agi/agi-VDADcloser.agi @@ -304,7 +304,7 @@ $sthA->finish(); ### insert a LIVE record to the vicidial_auto_calls table -$stmtA = "INSERT INTO vicidial_auto_calls values('','$VARserver_ip','$channel_group','LIVE','$CIDlead_id','$uniqueid','$callerid','$channel','$VDADphone_code','$VDADphone','$SQLdate','IN')"; +$stmtA = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,uniqueid,callerid,channel,phone_code,phone_number,call_time,call_type,stage) values('$VARserver_ip','$channel_group','LIVE','$CIDlead_id','$uniqueid','$callerid','$channel','$VDADphone_code','$VDADphone','$SQLdate','IN','LIVE-0')"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $affected_rows = $dbhA->do($stmtA); @@ -400,7 +400,7 @@ if ($channel_status < 1) } $sthA->finish(); - $stmtA = "UPDATE vicidial_auto_calls set status='CLOSER' where callerid='$callerid';"; + $stmtA = "UPDATE vicidial_auto_calls set status='CLOSER', stage='CLOSER-$drop_timer' where callerid='$callerid';"; $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDCL XFER : |$affected_rows|$callerid\n|$stmtA|"; &agi_output;} @@ -473,6 +473,11 @@ else $drop_timer++; } + +$stmtA = "UPDATE vicidial_auto_calls set stage='LIVE-$drop_timer' where callerid='$callerid';"; +$affected_rows = $dbhA->do($stmtA); +#if ($AGILOG) {$agi_string = "-- VDAD : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} + } diff --git a/agi/agi-VDADcloser_PHONE.agi b/agi/agi-VDADcloser_PHONE.agi index 5991be29..623c508b 100644 --- a/agi/agi-VDADcloser_PHONE.agi +++ b/agi/agi-VDADcloser_PHONE.agi @@ -345,7 +345,7 @@ $sthA->finish(); ### insert a LIVE record to the vicidial_auto_calls table -$stmtA = "INSERT INTO vicidial_auto_calls values('','$VARserver_ip','$channel_group','LIVE','$CIDlead_id','$uniqueid','$callerid','$channel','$VDADphone_code','$VDADphone','$SQLdate','IN')"; +$stmtA = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,uniqueid,callerid,channel,phone_code,phone_number,call_time,call_type,stage) values('$VARserver_ip','$channel_group','LIVE','$CIDlead_id','$uniqueid','$callerid','$channel','$VDADphone_code','$VDADphone','$SQLdate','IN','LIVE-0')"; $affected_rows = $dbhA->do($stmtA); $stmtA = "INSERT INTO vicidial_closer_log (lead_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,processed) values('$CIDlead_id','$VDADcampaign','$SQLdate','$now_date_epoch','QUEUE','$VDADphone_code','$VDADphone','VDCL','N')"; @@ -444,7 +444,7 @@ if ($channel_status < 1) } $sthA->finish(); - $stmtA = "UPDATE vicidial_auto_calls set status='CLOSER' where callerid='$callerid';"; + $stmtA = "UPDATE vicidial_auto_calls set status='CLOSER', stage='CLOSER-$drop_timer' where callerid='$callerid';"; $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDCL XFER : |$affected_rows|$callerid\n|$stmtA|"; &agi_output;} @@ -517,6 +517,11 @@ else $drop_timer++; } + +$stmtA = "UPDATE vicidial_auto_calls set stage='LIVE-$drop_timer' where callerid='$callerid';"; +$affected_rows = $dbhA->do($stmtA); +#if ($AGILOG) {$agi_string = "-- VDAD : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} + } diff --git a/agi/agi-VDADcloser_inbound.agi b/agi/agi-VDADcloser_inbound.agi index 7e85c12e..82bf17a5 100644 --- a/agi/agi-VDADcloser_inbound.agi +++ b/agi/agi-VDADcloser_inbound.agi @@ -343,7 +343,7 @@ $sthA->finish(); ### insert a LIVE record to the vicidial_auto_calls table -$stmtA = "INSERT INTO vicidial_auto_calls values('','$VARserver_ip','$channel_group','LIVE','$new_lead_id','$uniqueid','$callerid','$channel','$phone_code','$phone_number','$SQLdate','IN')"; +$stmtA = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,uniqueid,callerid,channel,phone_code,phone_number,call_time,call_type,stage) values('$VARserver_ip','$channel_group','LIVE','$new_lead_id','$uniqueid','$callerid','$channel','$phone_code','$phone_number','$SQLdate','IN','LIVE-0')"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $affected_rows = $dbhA->do($stmtA); @@ -450,7 +450,7 @@ if ($channel_status < 1) } $sthA->finish(); - $stmtA = "UPDATE vicidial_auto_calls set status='CLOSER' where callerid='$callerid';"; + $stmtA = "UPDATE vicidial_auto_calls set status='CLOSER', stage='CLOSER-$drop_timer' where callerid='$callerid';"; $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDCL XFER : |$affected_rows|$callerid\n|$stmtA|"; &agi_output;} @@ -527,6 +527,11 @@ else $drop_timer++; } + +$stmtA = "UPDATE vicidial_auto_calls set stage='LIVE-$drop_timer' where callerid='$callerid';"; +$affected_rows = $dbhA->do($stmtA); +#if ($AGILOG) {$agi_string = "-- VDAD : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} + } diff --git a/agi/agi-VDADcloser_inboundANI.agi b/agi/agi-VDADcloser_inboundANI.agi index 5d723c3d..25afd55c 100644 --- a/agi/agi-VDADcloser_inboundANI.agi +++ b/agi/agi-VDADcloser_inboundANI.agi @@ -343,7 +343,7 @@ $sthA->finish(); ### insert a LIVE record to the vicidial_auto_calls table -$stmtA = "INSERT INTO vicidial_auto_calls values('','$VARserver_ip','$channel_group','LIVE','$new_lead_id','$uniqueid','$callerid','$channel','$phone_code','$phone_number','$SQLdate','IN')"; +$stmtA = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,uniqueid,callerid,channel,phone_code,phone_number,call_time,call_type,stage) values('$VARserver_ip','$channel_group','LIVE','$new_lead_id','$uniqueid','$callerid','$channel','$phone_code','$phone_number','$SQLdate','IN','LIVE-0')"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $affected_rows = $dbhA->do($stmtA); @@ -439,7 +439,7 @@ if ($channel_status < 1) } $sthA->finish(); - $stmtA = "UPDATE vicidial_auto_calls set status='CLOSER' where callerid='$callerid';"; + $stmtA = "UPDATE vicidial_auto_calls set status='CLOSER', stage='CLOSER-$drop_timer' where callerid='$callerid';"; $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDCL XFER : |$affected_rows|$callerid\n|$stmtA|"; &agi_output;} @@ -512,6 +512,11 @@ else $drop_timer++; } + +$stmtA = "UPDATE vicidial_auto_calls set stage='LIVE-$drop_timer' where callerid='$callerid';"; +$affected_rows = $dbhA->do($stmtA); +#if ($AGILOG) {$agi_string = "-- VDAD : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} + } diff --git a/agi/agi-VDADcloser_inboundCID.agi b/agi/agi-VDADcloser_inboundCID.agi index f448d413..7624750e 100644 --- a/agi/agi-VDADcloser_inboundCID.agi +++ b/agi/agi-VDADcloser_inboundCID.agi @@ -359,7 +359,7 @@ while ($sthArows > $cbc) $sthA->finish(); ### insert a LIVE record to the vicidial_auto_calls table -$stmtA = "INSERT INTO vicidial_auto_calls values('','$VARserver_ip','$channel_group','LIVE','$new_lead_id','$uniqueid','$callerid','$channel','$phone_code','$phone_number','$SQLdate','IN')"; +$stmtA = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,uniqueid,callerid,channel,phone_code,phone_number,call_time,call_type,stage) values('$VARserver_ip','$channel_group','LIVE','$new_lead_id','$uniqueid','$callerid','$channel','$phone_code','$phone_number','$SQLdate','IN','LIVE-0')"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $affected_rows = $dbhA->do($stmtA); @@ -455,7 +455,7 @@ if ($channel_status < 1) } $sthA->finish(); - $stmtA = "UPDATE vicidial_auto_calls set status='CLOSER' where callerid='$callerid';"; + $stmtA = "UPDATE vicidial_auto_calls set status='CLOSER', stage='CLOSER-$drop_timer' where callerid='$callerid';"; $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDCL XFER : |$affected_rows|$callerid\n|$stmtA|"; &agi_output;} @@ -528,6 +528,11 @@ else $drop_timer++; } + +$stmtA = "UPDATE vicidial_auto_calls set stage='LIVE-$drop_timer' where callerid='$callerid';"; +$affected_rows = $dbhA->do($stmtA); +#if ($AGILOG) {$agi_string = "-- VDAD : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} + } diff --git a/agi/agi-VDADcloser_inboundCIDlookup.agi b/agi/agi-VDADcloser_inboundCIDlookup.agi index b5883b36..46edb341 100644 --- a/agi/agi-VDADcloser_inboundCIDlookup.agi +++ b/agi/agi-VDADcloser_inboundCIDlookup.agi @@ -379,7 +379,7 @@ $sthA->finish(); ### insert a LIVE record to the vicidial_auto_calls table -$stmtA = "INSERT INTO vicidial_auto_calls values('','$VARserver_ip','$channel_group','LIVE','$new_lead_id','$uniqueid','$callerid','$channel','$phone_code','$phone_number','$SQLdate','IN')"; +$stmtA = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,uniqueid,callerid,channel,phone_code,phone_number,call_time,call_type,stage) values('$VARserver_ip','$channel_group','LIVE','$new_lead_id','$uniqueid','$callerid','$channel','$phone_code','$phone_number','$SQLdate','IN','LIVE-0')"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $affected_rows = $dbhA->do($stmtA); @@ -476,7 +476,7 @@ if ($channel_status < 1) } $sthA->finish(); - $stmtA = "UPDATE vicidial_auto_calls set status='CLOSER' where callerid='$callerid';"; + $stmtA = "UPDATE vicidial_auto_calls set status='CLOSER', stage='CLOSER-$drop_timer' where callerid='$callerid';"; $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDCL XFER : |$affected_rows|$callerid\n|$stmtA|"; &agi_output;} @@ -549,6 +549,11 @@ else $drop_timer++; } + +$stmtA = "UPDATE vicidial_auto_calls set stage='LIVE-$drop_timer' where callerid='$callerid';"; +$affected_rows = $dbhA->do($stmtA); +#if ($AGILOG) {$agi_string = "-- VDAD : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} + } diff --git a/agi/agi-VDADcloser_inbound_5ID.agi b/agi/agi-VDADcloser_inbound_5ID.agi index cd13fd54..1c961b7b 100644 --- a/agi/agi-VDADcloser_inbound_5ID.agi +++ b/agi/agi-VDADcloser_inbound_5ID.agi @@ -342,7 +342,7 @@ while ($sthArows > $cbc) $sthA->finish(); ### insert a LIVE record to the vicidial_auto_calls table -$stmtA = "INSERT INTO vicidial_auto_calls values('','$VARserver_ip','$channel_group','LIVE','$new_lead_id','$uniqueid','$callerid','$channel','$phone_code','$phone_number','$SQLdate','IN')"; +$stmtA = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,uniqueid,callerid,channel,phone_code,phone_number,call_time,call_type,stage) values('$VARserver_ip','$channel_group','LIVE','$new_lead_id','$uniqueid','$callerid','$channel','$phone_code','$phone_number','$SQLdate','IN','LIVE-0')"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $affected_rows = $dbhA->do($stmtA); @@ -448,7 +448,7 @@ if ($channel_status < 1) } $sthA->finish(); - $stmtA = "UPDATE vicidial_auto_calls set status='CLOSER' where callerid='$callerid';"; + $stmtA = "UPDATE vicidial_auto_calls set status='CLOSER', stage='CLOSER-$drop_timer' where callerid='$callerid';"; $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDCL XFER : |$affected_rows|$callerid\n|$stmtA|"; &agi_output;} @@ -525,6 +525,11 @@ else $drop_timer++; } + +$stmtA = "UPDATE vicidial_auto_calls set stage='LIVE-$drop_timer' where callerid='$callerid';"; +$affected_rows = $dbhA->do($stmtA); +#if ($AGILOG) {$agi_string = "-- VDAD : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} + } diff --git a/agi/agi-VDADcloser_inbound_NOCID.agi b/agi/agi-VDADcloser_inbound_NOCID.agi index a64c4198..dea0a349 100644 --- a/agi/agi-VDADcloser_inbound_NOCID.agi +++ b/agi/agi-VDADcloser_inbound_NOCID.agi @@ -341,7 +341,7 @@ while ($sthArows > $cbc) $sthA->finish(); ### insert a LIVE record to the vicidial_auto_calls table -$stmtA = "INSERT INTO vicidial_auto_calls values('','$VARserver_ip','$channel_group','LIVE','$new_lead_id','$uniqueid','$callerid','$channel','$phone_code','$phone_number','$SQLdate','IN')"; +$stmtA = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,uniqueid,callerid,channel,phone_code,phone_number,call_time,call_type,stage) values('$VARserver_ip','$channel_group','LIVE','$new_lead_id','$uniqueid','$callerid','$channel','$phone_code','$phone_number','$SQLdate','IN','LIVE-0')"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $affected_rows = $dbhA->do($stmtA); @@ -447,7 +447,7 @@ if ($channel_status < 1) } $sthA->finish(); - $stmtA = "UPDATE vicidial_auto_calls set status='CLOSER' where callerid='$callerid';"; + $stmtA = "UPDATE vicidial_auto_calls set status='CLOSER', stage='CLOSER-$drop_timer' where callerid='$callerid';"; $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDCL XFER : |$affected_rows|$callerid\n|$stmtA|"; &agi_output;} @@ -524,6 +524,11 @@ else $drop_timer++; } + +$stmtA = "UPDATE vicidial_auto_calls set stage='LIVE-$drop_timer' where callerid='$callerid';"; +$affected_rows = $dbhA->do($stmtA); +#if ($AGILOG) {$agi_string = "-- VDAD : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} + } diff --git a/agi/agi-VDADtransfer.agi b/agi/agi-VDADtransfer.agi index 5e7e8d86..35757247 100644 --- a/agi/agi-VDADtransfer.agi +++ b/agi/agi-VDADtransfer.agi @@ -255,7 +255,7 @@ exit; ### Grab call parameters from vicidial_auto_calls table -$stmtA = "UPDATE vicidial_auto_calls set uniqueid='$unique_id', channel='$channel',status='LIVE' where callerid='$callerid' order by call_time desc limit 1;"; +$stmtA = "UPDATE vicidial_auto_calls set uniqueid='$unique_id', channel='$channel',status='LIVE',stage='LIVE-0' where callerid='$callerid' order by call_time desc limit 1;"; $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDAD : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} if ($affected_rows > 0) @@ -382,7 +382,7 @@ if ($rec_countWAIT < 1) } $sthA->finish(); - $stmtA = "UPDATE vicidial_auto_calls set status='XFER' where callerid='$callerid';"; + $stmtA = "UPDATE vicidial_auto_calls set status='XFER', stage='XFER-$drop_timer' where callerid='$callerid';"; $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDAD XFER : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} @@ -435,6 +435,11 @@ else $drop_timer++; } + +$stmtA = "UPDATE vicidial_auto_calls set stage='LIVE-$drop_timer' where callerid='$callerid';"; +$affected_rows = $dbhA->do($stmtA); +#if ($AGILOG) {$agi_string = "-- VDAD : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} + } diff --git a/agi/agi-VDADtransferBROADCAST.agi b/agi/agi-VDADtransferBROADCAST.agi index 8755c0ee..76bec373 100644 --- a/agi/agi-VDADtransferBROADCAST.agi +++ b/agi/agi-VDADtransferBROADCAST.agi @@ -256,7 +256,7 @@ exit; ### Grab call parameters from vicidial_auto_calls table -$stmtA = "UPDATE vicidial_auto_calls set uniqueid='$unique_id', channel='$channel',status='LIVE' where callerid='$callerid' order by call_time desc limit 1;"; +$stmtA = "UPDATE vicidial_auto_calls set uniqueid='$unique_id', channel='$channel',status='LIVE',stage='LIVE-0' where callerid='$callerid' order by call_time desc limit 1;"; $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDAD : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} if ($affected_rows > 0) @@ -388,7 +388,7 @@ if ($rec_countWAIT < 1) } $sthA->finish(); - $stmtA = "UPDATE vicidial_auto_calls set status='XFER' where callerid='$callerid';"; + $stmtA = "UPDATE vicidial_auto_calls set status='XFER', stage='XFER-$drop_timer' where callerid='$callerid';"; $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDAD XFER : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} @@ -441,6 +441,11 @@ else $drop_timer++; } + +$stmtA = "UPDATE vicidial_auto_calls set stage='LIVE-$drop_timer' where callerid='$callerid';"; +$affected_rows = $dbhA->do($stmtA); +#if ($AGILOG) {$agi_string = "-- VDAD : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} + } diff --git a/agi/agi-VDADtransferSURVEY.agi b/agi/agi-VDADtransferSURVEY.agi index df8d507b..573f8e47 100644 --- a/agi/agi-VDADtransferSURVEY.agi +++ b/agi/agi-VDADtransferSURVEY.agi @@ -292,7 +292,7 @@ if ($AGILOG) {$agi_string = "-- VDAD vicidial_list VOTER update: |$affected_r $AGI->stream_file('US_pol_survey_transfer'); ### Grab call parameters from vicidial_auto_calls table -$stmtA = "UPDATE vicidial_auto_calls set uniqueid='$unique_id', channel='$channel',status='LIVE' where callerid='$callerid' order by call_time desc limit 1;"; +$stmtA = "UPDATE vicidial_auto_calls set uniqueid='$unique_id', channel='$channel',status='LIVE',stage='LIVE-0' where callerid='$callerid' order by call_time desc limit 1;"; $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDAD : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} if ($affected_rows > 0) @@ -419,7 +419,7 @@ if ($rec_countWAIT < 1) } $sthA->finish(); - $stmtA = "UPDATE vicidial_auto_calls set status='XFER' where callerid='$callerid';"; + $stmtA = "UPDATE vicidial_auto_calls set status='XFER', stage='XFER-$drop_timer' where callerid='$callerid';"; $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDAD XFER : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} @@ -490,6 +490,11 @@ else $drop_timer++; } + +$stmtA = "UPDATE vicidial_auto_calls set stage='LIVE-$drop_timer' where callerid='$callerid';"; +$affected_rows = $dbhA->do($stmtA); +#if ($AGILOG) {$agi_string = "-- VDAD : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} + } diff --git a/agi/agi-VDADtransferTEST.agi b/agi/agi-VDADtransferTEST.agi index b21e5371..485268fa 100644 --- a/agi/agi-VDADtransferTEST.agi +++ b/agi/agi-VDADtransferTEST.agi @@ -257,7 +257,7 @@ exit; ### Grab call parameters from vicidial_auto_calls table -$stmtA = "UPDATE vicidial_auto_calls set uniqueid='$unique_id', channel='$channel',status='LIVE' where callerid='$callerid' order by call_time desc limit 1;"; +$stmtA = "UPDATE vicidial_auto_calls set uniqueid='$unique_id', channel='$channel',status='LIVE',stage='LIVE-0' where callerid='$callerid' order by call_time desc limit 1;"; $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDAD : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} if ($affected_rows > 0) @@ -384,7 +384,7 @@ if ($rec_countWAIT < 1) } $sthA->finish(); - $stmtA = "UPDATE vicidial_auto_calls set status='XFER' where callerid='$callerid';"; + $stmtA = "UPDATE vicidial_auto_calls set status='XFER', stage='XFER-$drop_timer' where callerid='$callerid';"; $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDAD XFER : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} @@ -441,6 +441,11 @@ else $drop_timer++; } + +$stmtA = "UPDATE vicidial_auto_calls set stage='LIVE-$drop_timer' where callerid='$callerid';"; +$affected_rows = $dbhA->do($stmtA); +#if ($AGILOG) {$agi_string = "-- VDAD : |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} + } diff --git a/docs/SCRATCH_INSTALL.txt b/docs/SCRATCH_INSTALL.txt index 4263ad0f..f029e32d 100644 --- a/docs/SCRATCH_INSTALL.txt +++ b/docs/SCRATCH_INSTALL.txt @@ -732,6 +732,28 @@ this loaded on your system. - make install +mtop is a great utility for real-time monitoring of mysql and the queries that +are running in it. +*OPTIONAL* + 14. Go to http://mtop.sourceforge.net to download the most recent version + - to install this directly on the command line type: + - cd /usr/local + - wget http://superb-east.dl.sourceforge.net/sourceforge/mtop/mtop-0.6.6.tar.gz + - gunzip mtop-0.6.6.tar.gz + - tar xvf mtop-0.6.6.tar + - cd mtop-0.6.6 + - cpan + - install Curses + - install Getopt::Long + - install Net::Domain + - quit + - perl Makefile.PL + - make + - make install + - /usr/local/bin/mtop --dbuser=root --seconds=3 + + + PHASE 4: INSTALLING ASTERISK diff --git a/extras/MySQL_AST_CREATE_tables.sql b/extras/MySQL_AST_CREATE_tables.sql index fdc2d5b2..a7610525 100644 --- a/extras/MySQL_AST_CREATE_tables.sql +++ b/extras/MySQL_AST_CREATE_tables.sql @@ -320,9 +320,12 @@ phone_code VARCHAR(10), phone_number VARCHAR(12), call_time DATETIME, call_type ENUM('IN','OUT') default 'OUT', +stage VARCHAR(20) default 'START', +last_update_time TIMESTAMP, index (uniqueid), index (callerid), -index (call_time) +index (call_time), +index (last_update_time) ); CREATE TABLE vicidial_log ( diff --git a/extras/upgrade_2.0.2.sql b/extras/upgrade_2.0.2.sql index cd6a5ade..b31db762 100644 --- a/extras/upgrade_2.0.2.sql +++ b/extras/upgrade_2.0.2.sql @@ -22,3 +22,9 @@ ALTER TABLE servers ADD vicidial_balance_active ENUM('Y','N') default 'N'; ALTER TABLE servers ADD balance_trunks_offlimits SMALLINT(5) UNSIGNED default '0'; DELETE from vicidial_phone_codes; + + +ALTER TABLE vicidial_auto_calls ADD stage VARCHAR(20) default 'START'; +ALTER TABLE vicidial_auto_calls ADD last_update_time TIMESTAMP; +ALTER TABLE vicidial_auto_calls ADD index (last_update_time); + diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php index c986949a..58625a5b 100644 --- a/www/vicidial/admin.php +++ b/www/vicidial/admin.php @@ -2755,7 +2755,7 @@ echo ""; echo "
ADD A NEW CAMPAIGN
\n"; echo "\n"; echo "
\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "\n"; echo "\n";
Campaign ID: $NWB#vicidial_campaigns-campaign_id$NWE
Campaign ID: $NWB#vicidial_campaigns-campaign_id$NWE
Campaign Name: $NWB#vicidial_campaigns-campaign_name$NWE
Active: $NWB#vicidial_campaigns-active$NWE
Park Extension: $NWB#vicidial_campaigns-park_ext$NWE