diff --git a/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi b/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi index b61433d9..fe49e051 100644 --- a/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi +++ b/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi @@ -186,6 +186,7 @@ # 130108-1804 - Changes for Asterisk 1.8 compatibility # 130925-1821 - Added variable filter to prevent DID SQL injection attack # 130926-1548 - Added new queue_log IVR entries for QM +# 131209-1539 - Added called_count logging # $script = 'agi-VDAD_ALL_inbound.agi'; @@ -200,6 +201,7 @@ $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=195; $one_mysql_log=0; $dial_ingroup_flag=0; +$called_count=1; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); @@ -559,7 +561,7 @@ if ($call_handle_method =~ /^CLOSER/) $VCcallerid = $callerid; $insert_lead_id = $CIDlead_id; - $stmtA= "SELECT phone_number from vicidial_list where lead_id='$insert_lead_id';"; + $stmtA= "SELECT phone_number,called_count from vicidial_list where lead_id='$insert_lead_id';"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -567,7 +569,8 @@ if ($call_handle_method =~ /^CLOSER/) if ($sthArows > 0) { @aryA = $sthA->fetchrow_array; - $phone_number = $aryA[0]; + $phone_number = $aryA[0]; + $called_count = $aryA[1]; $originalCID = $phone_number; } $sthA->finish(); @@ -969,7 +972,7 @@ if ($call_handle_method =~ /LOOKUP/) if ( ( ($call_handle_method =~ /^VID/) && (length($vendor_id)) < 3) || (length($phone_number) < 3) ) { ### insert a record into the vicidial_list table - $stmtA = "INSERT INTO vicidial_list (entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,called_since_last_reset,phone_code,phone_number,security_phrase,called_count,gmt_offset_now,comments) values('$SQLdate','$tsSQLdate','INBND','$fronter','$vendor_id','VDCL','$list_id','Y','$phone_code','$phone_number','$channel_group','1','$local_gmt','$VLcomments');"; + $stmtA = "INSERT INTO vicidial_list (entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,called_since_last_reset,phone_code,phone_number,security_phrase,called_count,gmt_offset_now,comments) values('$SQLdate','$tsSQLdate','INBND','$fronter','$vendor_id','VDCL','$list_id','Y','$phone_code','$phone_number','$channel_group','$called_count','$local_gmt','$VLcomments');"; $affected_rows = $dbhA->do($stmtA); $dbhP=$dbhA; $mysql_count='02007'; $MEL_aff_rows=$affected_rows; &mysql_error_logging; $cbc=0; @@ -1045,11 +1048,11 @@ if ($call_handle_method =~ /LOOKUP/) $cbc=0; if ($call_handle_method =~ /^VID/) { - $stmtA= "SELECT lead_id from vicidial_list where vendor_lead_code='$vendor_id' $listSQL order by last_local_call_time desc limit 1;"; + $stmtA= "SELECT lead_id,called_count from vicidial_list where vendor_lead_code='$vendor_id' $listSQL order by last_local_call_time desc limit 1;"; } else { - $stmtA= "SELECT lead_id from vicidial_list where phone_number='$phone_number' $listSQL order by last_local_call_time desc limit 1;"; + $stmtA= "SELECT lead_id,called_count from vicidial_list where phone_number='$phone_number' $listSQL order by last_local_call_time desc limit 1;"; } if ($AGILOG) {$agi_string = "VDAD vicidial_list search |$phone_number|$stmtA|"; &agi_output;} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; @@ -1061,7 +1064,8 @@ if ($call_handle_method =~ /LOOKUP/) while ($sthArows > $cbc) { @aryA = $sthA->fetchrow_array; - $insert_lead_id = $aryA[0]; + $insert_lead_id = $aryA[0]; + $called_count = $aryA[1]; $cbc++; } $sthA->finish(); @@ -1073,7 +1077,7 @@ if ($call_handle_method =~ /LOOKUP/) $VLfound=0; if ($call_handle_method =~ /ALT/) { - $stmtA= "SELECT lead_id from vicidial_list where alt_phone='$phone_number' $listSQL order by last_local_call_time desc limit 1;"; + $stmtA= "SELECT lead_id,called_count from vicidial_list where alt_phone='$phone_number' $listSQL order by last_local_call_time desc limit 1;"; if ($AGILOG) {$agi_string = "VDAD vicidial_list ALT search |$phone_number|$stmtA|"; &agi_output;} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -1082,7 +1086,8 @@ if ($call_handle_method =~ /LOOKUP/) if ($sthArows > 0) { @aryA = $sthA->fetchrow_array; - $insert_lead_id = $aryA[0]; + $insert_lead_id = $aryA[0]; + $called_count = $aryA[1]; $VLfound++; $sthA->finish(); if ($AGILOG) {$agi_string = "VDAD vicidial_list ALT found |$insert_lead_id|$stmtA|"; &agi_output;} @@ -1090,7 +1095,7 @@ if ($call_handle_method =~ /LOOKUP/) } if ( ($call_handle_method =~ /ADDR3/) && ($VLfound < 1) ) { - $stmtA= "SELECT lead_id from vicidial_list where address3='$phone_number' $listSQL order by last_local_call_time desc limit 1;"; + $stmtA= "SELECT lead_id,called_count from vicidial_list where address3='$phone_number' $listSQL order by last_local_call_time desc limit 1;"; if ($AGILOG) {$agi_string = "VDAD vicidial_list ADDR3 search |$phone_number|$stmtA|"; &agi_output;} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -1099,7 +1104,8 @@ if ($call_handle_method =~ /LOOKUP/) if ($sthArows > 0) { @aryA = $sthA->fetchrow_array; - $insert_lead_id = $aryA[0]; + $insert_lead_id = $aryA[0]; + $called_count = $aryA[1]; $VLfound++; $sthA->finish(); if ($AGILOG) {$agi_string = "VDAD vicidial_list ADDR3 found |$insert_lead_id|$stmtA|"; &agi_output;} @@ -1108,7 +1114,7 @@ if ($call_handle_method =~ /LOOKUP/) if ($VLfound < 1) { ### insert a record into the vicidial_list table - $stmtA = "INSERT INTO vicidial_list (entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,called_since_last_reset,phone_code,phone_number,security_phrase,called_count,gmt_offset_now,comments) values('$SQLdate','$tsSQLdate','INBND','$fronter','$vendor_id','VDCL','$list_id','Y','$phone_code','$phone_number','$channel_group','1','$local_gmt','$VLcomments');"; + $stmtA = "INSERT INTO vicidial_list (entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,called_since_last_reset,phone_code,phone_number,security_phrase,called_count,gmt_offset_now,comments) values('$SQLdate','$tsSQLdate','INBND','$fronter','$vendor_id','VDCL','$list_id','Y','$phone_code','$phone_number','$channel_group','$called_count','$local_gmt','$VLcomments');"; $affected_rows = $dbhA->do($stmtA); $dbhP=$dbhA; $mysql_count='02011'; $MEL_aff_rows=$affected_rows; &mysql_error_logging; $cbc=0; @@ -1160,7 +1166,7 @@ else { ### Grab call lead parameters from vicidial_list table $cbc=0; - $stmtA = "SELECT phone_number,phone_code,user,vendor_lead_code FROM vicidial_list where lead_id='$CIDlead_id' limit 1;"; + $stmtA = "SELECT phone_number,phone_code,user,vendor_lead_code,called_count FROM vicidial_list where lead_id='$CIDlead_id' limit 1;"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -1175,6 +1181,7 @@ else $insert_lead_id = $CIDlead_id; $fronter = $aryA[2]; $vendor_id = $aryA[3]; + $called_count = $aryA[4]; $cbc++; } $sthA->finish(); @@ -1183,7 +1190,7 @@ else else { ### insert a record into the vicidial_list table if no record was found above - $stmtA = "INSERT INTO vicidial_list (entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,called_since_last_reset,phone_code,phone_number,security_phrase,called_count,gmt_offset_now,comments) values('$SQLdate','$tsSQLdate','INBND','$fronter','$vendor_id','VDCL','$list_id','Y','$phone_code','$phone_number','$channel_group','1','-5.00','$VLcomments');"; + $stmtA = "INSERT INTO vicidial_list (entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,called_since_last_reset,phone_code,phone_number,security_phrase,called_count,gmt_offset_now,comments) values('$SQLdate','$tsSQLdate','INBND','$fronter','$vendor_id','VDCL','$list_id','Y','$phone_code','$phone_number','$channel_group','$called_count','-5.00','$VLcomments');"; $affected_rows = $dbhA->do($stmtA); $dbhP=$dbhA; $mysql_count='02014'; $MEL_aff_rows=$affected_rows; &mysql_error_logging; $cbc=0; @@ -1379,7 +1386,7 @@ if ( ( ( ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) ) && ($hm >= $c $AHterm = $MCterm; $AHcomments = $MCcomments; } - $stmtA = "INSERT INTO vicidial_closer_log set status='$AHstatus',start_epoch='$now_date_epoch',end_epoch='$now_date_epoch',length_in_sec='1',queue_seconds='0',lead_id = '$insert_lead_id',campaign_id='$channel_group',user='VDCL',list_id='$list_id',call_date='$now_date',phone_code='$phone_code',phone_number='$phone_number',comments='$AHcomments',term_reason='$AHterm',uniqueid='$uniqueid';"; + $stmtA = "INSERT INTO vicidial_closer_log set status='$AHstatus',start_epoch='$now_date_epoch',end_epoch='$now_date_epoch',length_in_sec='1',queue_seconds='0',lead_id = '$insert_lead_id',campaign_id='$channel_group',user='VDCL',list_id='$list_id',call_date='$now_date',phone_code='$phone_code',phone_number='$phone_number',comments='$AHcomments',term_reason='$AHterm',uniqueid='$uniqueid',called_count='$called_count';"; $affected_rows = $dbhA->do($stmtA); $dbhP=$dbhA; $mysql_count='02016'; $MEL_aff_rows=$affected_rows; &mysql_error_logging; $stmtB = "SELECT LAST_INSERT_ID() LIMIT 1;"; @@ -1607,7 +1614,7 @@ if ( ( ($no_agent_no_queue =~ /Y|NO_PAUSED/) || ($MCnanque_override > 0) ) && ($ $NQcomments = $MCcomments; } - $stmtA = "INSERT INTO vicidial_closer_log set status='$NQstatus',start_epoch='$now_date_epoch',end_epoch='$now_date_epoch',length_in_sec='1',queue_seconds='0',lead_id='$insert_lead_id',campaign_id='$channel_group',user='VDCL',list_id='$list_id',call_date='$now_date',phone_code='$phone_code',phone_number='$phone_number',comments='$NQcomments',term_reason='$NQterm',uniqueid='$uniqueid';"; + $stmtA = "INSERT INTO vicidial_closer_log set status='$NQstatus',start_epoch='$now_date_epoch',end_epoch='$now_date_epoch',length_in_sec='1',queue_seconds='0',lead_id='$insert_lead_id',campaign_id='$channel_group',user='VDCL',list_id='$list_id',call_date='$now_date',phone_code='$phone_code',phone_number='$phone_number',comments='$NQcomments',term_reason='$NQterm',uniqueid='$uniqueid',called_count='$called_count';"; $affected_rows = $dbhA->do($stmtA); $dbhP=$dbhA; $mysql_count='02105'; $MEL_aff_rows=$affected_rows; &mysql_error_logging; $stmtB = "SELECT LAST_INSERT_ID() LIMIT 1;"; @@ -2016,7 +2023,7 @@ $Uaffected_rows = $dbhA->do($stmtA); $dbhP=$dbhA; $mysql_count='02121'; $MEL_aff_rows=$Uaffected_rows; &mysql_error_logging; ### INSERT vicidial_closer_log record, call is entering the queue -$stmtA = "INSERT INTO vicidial_closer_log SET lead_id='$insert_lead_id', campaign_id='$channel_group', call_date='$SQLdate', start_epoch='$now_date_epoch', status='QUEUE', phone_code='$phone_code', phone_number='$phone_number', user='VDCL', processed='N', xfercallid='$insert_xfer_id', uniqueid='$uniqueid', queue_position='$queue_position' $adSQL;"; +$stmtA = "INSERT INTO vicidial_closer_log SET lead_id='$insert_lead_id', campaign_id='$channel_group', call_date='$SQLdate', start_epoch='$now_date_epoch', status='QUEUE', phone_code='$phone_code', phone_number='$phone_number', user='VDCL', processed='N', xfercallid='$insert_xfer_id', uniqueid='$uniqueid', queue_position='$queue_position',called_count='$called_count' $adSQL;"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $affected_rows = $dbhA->do($stmtA); $dbhP=$dbhA; $mysql_count='02031'; $MEL_aff_rows=$affected_rows; &mysql_error_logging; @@ -4060,7 +4067,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override if ( ( length($phone_number) > 6 ) && ( $phone_number > 0) ) { ### insert a record into the vicidial_list table - $stmtA = "INSERT INTO vicidial_list (entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,called_since_last_reset,phone_code,phone_number,security_phrase,called_count,gmt_offset_now,comments) values('$SQLdate','$tsSQLdate','INBND','$fronter','$vendor_id','VDCL','$wait_time_option_callback_list_id','N','$phone_code','$phone_number','$channel_group','1','$local_gmt','$VLcomments');"; + $stmtA = "INSERT INTO vicidial_list (entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,called_since_last_reset,phone_code,phone_number,security_phrase,called_count,gmt_offset_now,comments) values('$SQLdate','$tsSQLdate','INBND','$fronter','$vendor_id','VDCL','$wait_time_option_callback_list_id','N','$phone_code','$phone_number','$channel_group','$called_count','$local_gmt','$VLcomments');"; $affected_rows = $dbhA->do($stmtA); $dbhP=$dbhA; $mysql_count='02089'; $MEL_aff_rows=$affected_rows; &mysql_error_logging; $stmtB = "SELECT LAST_INSERT_ID() LIMIT 1;"; @@ -4485,7 +4492,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override if ( ( length($phone_number) > 6 ) && ( $phone_number > 0) ) { ### insert a record into the vicidial_list table - $stmtA = "INSERT INTO vicidial_list (entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,called_since_last_reset,phone_code,phone_number,security_phrase,called_count,gmt_offset_now,comments) values('$SQLdate','$tsSQLdate','INBND','$fronter','$vendor_id','VDCL','$hold_time_option_callback_list_id','N','$phone_code','$phone_number','$channel_group','1','$local_gmt','$VLcomments');"; + $stmtA = "INSERT INTO vicidial_list (entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,called_since_last_reset,phone_code,phone_number,security_phrase,called_count,gmt_offset_now,comments) values('$SQLdate','$tsSQLdate','INBND','$fronter','$vendor_id','VDCL','$hold_time_option_callback_list_id','N','$phone_code','$phone_number','$channel_group','$called_count','$local_gmt','$VLcomments');"; $affected_rows = $dbhA->do($stmtA); $dbhP=$dbhA; $mysql_count='02089'; $MEL_aff_rows=$affected_rows; &mysql_error_logging; $stmtB = "SELECT LAST_INSERT_ID() LIMIT 1;"; diff --git a/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi b/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi index 69c13446..5f1119eb 100644 --- a/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi +++ b/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# agi-VDAD_ALL_outbound.agi version 2.6 +# agi-VDAD_ALL_outbound.agi version 2.8 # # runs when an outbound call is answered. This script will # send the calls out to the agents that are logged in. @@ -105,6 +105,7 @@ # 130210-1013 - Added options for CALLMENU|INGROUP cpd_amd_actions # 130425-0049 - Added survey_wait_sec option and pre-process time logging # 130425-0657 - Added survey_no_response option to drop to campaign drop action +# 131209-1735 - Added called_count logging # $script = 'agi-VDAD_ALL_outbound.agi'; @@ -386,7 +387,8 @@ if ( ($channel =~ /Local/i) && ($AST_ver !~ /^1\.0\.8|^1\.0\.9/) ) if ($AGILOG) {$agi_string = "-- LRERR vicidial_list LRERR update: |$affected_rows|$uniqueid|$CIDlead_id|"; &agi_output;} $xCLlist_id=0; - $stmtA = "SELECT list_id,security_phrase from vicidial_list where lead_id='$CIDlead_id' limit 1;"; + $called_count=0; + $stmtA = "SELECT list_id,security_phrase,called_count from vicidial_list where lead_id='$CIDlead_id' limit 1;"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArowsLI=$sthA->rows; @@ -396,6 +398,7 @@ if ( ($channel =~ /Local/i) && ($AST_ver !~ /^1\.0\.8|^1\.0\.9/) ) @aryA = $sthA->fetchrow_array; $xCLlist_id = $aryA[0]; $security_phrase = $aryA[1]; + $called_count = $aryA[2]; } $sthA->finish(); @@ -417,7 +420,7 @@ if ( ($channel =~ /Local/i) && ($AST_ver !~ /^1\.0\.8|^1\.0\.9/) ) } $sthA->finish(); - $stmtA = "INSERT INTO vicidial_log (uniqueid,lead_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,processed,alt_dial,list_id) values('$uniqueid','$CIDlead_id','$VDADcampaign','$SQLdate','$now_date_epoch','LRERR','$VDADphone_code','$VDADphone','VDAD','N','$VDADalt_dial','$xCLlist_id')"; + $stmtA = "INSERT INTO vicidial_log (uniqueid,lead_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,processed,alt_dial,list_id,called_count) values('$uniqueid','$CIDlead_id','$VDADcampaign','$SQLdate','$now_date_epoch','LRERR','$VDADphone_code','$VDADphone','VDAD','N','$VDADalt_dial','$xCLlist_id','$called_count')"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $affected_rows = $dbhA->do($stmtA); $dbhP=$dbhA; $mysql_count='01103'; $MEL_aff_rows=$affected_rows; &mysql_error_logging; @@ -967,7 +970,8 @@ if ($VDACaffected_rows > 0) } $xCLlist_id=0; - $stmtA = "SELECT list_id,security_phrase from vicidial_list where lead_id='$CIDlead_id' limit 1;"; + $called_count=0; + $stmtA = "SELECT list_id,security_phrase,called_count from vicidial_list where lead_id='$CIDlead_id' limit 1;"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArowsLI=$sthA->rows; @@ -977,6 +981,7 @@ if ($VDACaffected_rows > 0) @aryA = $sthA->fetchrow_array; $xCLlist_id = $aryA[0]; $security_phrase = $aryA[1]; + $called_count = $aryA[2]; } $sthA->finish(); @@ -987,7 +992,7 @@ if ($VDACaffected_rows > 0) $RUN_time = sprintf("%.3f", $RUN_time); if ($AGILOG) {$agi_string = "Preprocess time: |$RUN_time ($END_time - $START_time)|"; &agi_output;} - $stmtA = "INSERT INTO vicidial_log (uniqueid,lead_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,processed,alt_dial,list_id,comments) values('$uniqueid','$CIDlead_id','$VDADcampaign','$SQLdate','$now_date_epoch','$vdlog_status','$VDADphone_code','$VDADphone','VDAD','N','$VDADalt_dial','$xCLlist_id','$RUN_time')"; + $stmtA = "INSERT INTO vicidial_log (uniqueid,lead_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,processed,alt_dial,list_id,comments,called_count) values('$uniqueid','$CIDlead_id','$VDADcampaign','$SQLdate','$now_date_epoch','$vdlog_status','$VDADphone_code','$VDADphone','VDAD','N','$VDADalt_dial','$xCLlist_id','$RUN_time','$called_count')"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $affected_rows = $dbhA->do($stmtA); $dbhP=$dbhA; $mysql_count='01008'; $MEL_aff_rows=$affected_rows; &mysql_error_logging; diff --git a/agc_2-X/trunk/bin/AST_VDauto_dial.pl b/agc_2-X/trunk/bin/AST_VDauto_dial.pl index 265eb51f..62dbf92c 100644 --- a/agc_2-X/trunk/bin/AST_VDauto_dial.pl +++ b/agc_2-X/trunk/bin/AST_VDauto_dial.pl @@ -115,6 +115,7 @@ # 130811-1403 - Fix for issue #690 # 131016-0659 - Fix for disable_auto_dial system option # 131122-1233 - Added several missing sthA->finish +# 131209-1557 - Added called_count logging # @@ -1537,7 +1538,8 @@ while($one_day_interval > 0) if ($insertVLcount < 1) { $xCLlist_id=0; - $stmtA="SELECT list_id from vicidial_list where lead_id='$CLlead_id' limit 1;"; + $called_count=0; + $stmtA="SELECT list_id,called_count from vicidial_list where lead_id='$CLlead_id' limit 1;"; if ($DB) {$event_string = "|$stmtA|"; &event_logger;} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -1546,10 +1548,11 @@ while($one_day_interval > 0) { @aryA = $sthA->fetchrow_array; $xCLlist_id = $aryA[0]; + $called_count = $aryA[1]; } $sthA->finish(); - $stmtA = "INSERT INTO vicidial_log (uniqueid,lead_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,processed,length_in_sec,end_epoch,alt_dial,list_id) values('$CLuniqueid','$CLlead_id','$CLcampaign_id','$SQLdate','$now_date_epoch','$CLnew_status','$CLphone_code','$CLphone_number','$insertVLuser','N','$CLstage','$end_epoch','$CLalt_dial','$xCLlist_id')"; + $stmtA = "INSERT INTO vicidial_log (uniqueid,lead_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,processed,length_in_sec,end_epoch,alt_dial,list_id,called_count) values('$CLuniqueid','$CLlead_id','$CLcampaign_id','$SQLdate','$now_date_epoch','$CLnew_status','$CLphone_code','$CLphone_number','$insertVLuser','N','$CLstage','$end_epoch','$CLalt_dial','$xCLlist_id','$called_count')"; if($M){print STDERR "\n|$stmtA|\n";} $affected_rows = $dbhA->do($stmtA); @@ -2329,7 +2332,8 @@ while($one_day_interval > 0) if ( ($affected_rows > 0) && ($CLlead_id > 0) ) { $xCLlist_id=0; - $stmtA="SELECT list_id from vicidial_list where lead_id='$CLlead_id' limit 1;"; + $called_count=0; + $stmtA="SELECT list_id,called_count from vicidial_list where lead_id='$CLlead_id' limit 1;"; if ($DB) {$event_string = "|$stmtA|"; &event_logger;} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -2338,6 +2342,7 @@ while($one_day_interval > 0) { @aryA = $sthA->fetchrow_array; $xCLlist_id = $aryA[0]; + $called_count = $aryA[1]; } $sthA->finish(); @@ -2348,7 +2353,7 @@ while($one_day_interval > 0) if ($CLstage < 0.25) {$CLstage=0;} $end_epoch = $now_date_epoch; - $stmtA = "INSERT INTO vicidial_log (uniqueid,lead_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,processed,length_in_sec,end_epoch,alt_dial,list_id) values('$CLuniqueid','$CLlead_id','$CLcampaign_id','$SQLdate','$now_date_epoch','DROP','$CLphone_code','$CLphone_number','VDAD','N','$CLstage','$end_epoch','$CLalt_dial','$xCLlist_id')"; + $stmtA = "INSERT INTO vicidial_log (uniqueid,lead_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,processed,length_in_sec,end_epoch,alt_dial,list_id,called_count) values('$CLuniqueid','$CLlead_id','$CLcampaign_id','$SQLdate','$now_date_epoch','DROP','$CLphone_code','$CLphone_number','VDAD','N','$CLstage','$end_epoch','$CLalt_dial','$xCLlist_id','$called_count')"; if($M){print STDERR "\n|$stmtA|\n";} $affected_rows = $dbhA->do($stmtA); diff --git a/agc_2-X/trunk/bin/FastAGI_log.pl b/agc_2-X/trunk/bin/FastAGI_log.pl index 14b3af9b..8bf3f7e3 100644 --- a/agc_2-X/trunk/bin/FastAGI_log.pl +++ b/agc_2-X/trunk/bin/FastAGI_log.pl @@ -68,6 +68,7 @@ # 130531-1619 - Fixed issue with busy agent login calls attempting to be logged # 130802-0739 - Added CAMPCUST dialplan variable definition for outbound calls # 130925-1820 - Added variable filter to prevent DID SQL injection attack +# 131209-1559 - Added called_count logging # # defaults for PreFork @@ -957,7 +958,8 @@ sub process_request if ($sthArows > 0) { - $stmtA = "SELECT list_id FROM vicidial_list where lead_id='$VD_lead_id' limit 1;"; + $called_count=0; + $stmtA = "SELECT list_id,called_count FROM vicidial_list where lead_id='$VD_lead_id' limit 1;"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -965,14 +967,15 @@ sub process_request if ($sthArowsVLd > 0) { @aryA = $sthA->fetchrow_array; - $VD_list_id = $aryA[0]; + $VD_list_id = $aryA[0]; + $called_count = $aryA[1]; } $sthA->finish(); $vl_commentsSQL = ''; if ($callerid =~ /^M\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d/) {$vl_commentsSQL=",comments='MANUAL'";} - $stmtA = "INSERT INTO vicidial_log SET uniqueid='$uniqueid',lead_id='$VD_lead_id',list_id='$VD_list_id',status='$VDL_status',campaign_id='$VD_campaign_id',call_date='$VD_call_time',start_epoch='$VD_start_epoch',phone_code='$VD_phone_code',phone_number='$VD_phone_number',user='VDAD',processed='N',length_in_sec='0',end_epoch='$VD_start_epoch',alt_dial='$VD_alt_dial' $vl_commentsSQL;"; + $stmtA = "INSERT INTO vicidial_log SET uniqueid='$uniqueid',lead_id='$VD_lead_id',list_id='$VD_list_id',status='$VDL_status',campaign_id='$VD_campaign_id',call_date='$VD_call_time',start_epoch='$VD_start_epoch',phone_code='$VD_phone_code',phone_number='$VD_phone_number',user='VDAD',processed='N',length_in_sec='0',end_epoch='$VD_start_epoch',alt_dial='$VD_alt_dial',called_count='$called_count' $vl_commentsSQL;"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $VDLIaffected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDAD vicidial_log insert: |$VDLIaffected_rows|$uniqueid|$CIDlead_id|$VDL_status|"; &agi_output;} @@ -1284,7 +1287,8 @@ sub process_request ### BEGIN if call answers but has not reached routing AGI, then log as a PDROP if ( ($callerid =~ /^V\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d/) && ($VD_status =~ /SENT/) ) { - $stmtA = "SELECT list_id FROM vicidial_list where lead_id='$VD_lead_id' limit 1;"; + $called_count = 0; + $stmtA = "SELECT list_id,called_count FROM vicidial_list where lead_id='$VD_lead_id' limit 1;"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -1292,7 +1296,8 @@ sub process_request if ($sthArowsVLd > 0) { @aryA = $sthA->fetchrow_array; - $VD_list_id = $aryA[0]; + $VD_list_id = $aryA[0]; + $called_count = $aryA[1]; } $sthA->finish(); @@ -1300,7 +1305,7 @@ sub process_request $VLPDaffected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- PDROP vicidial_list update: |$VLPDaffected_rows|$uniqueid|$CIDlead_id|$VDL_status|"; &agi_output;} - $stmtA = "INSERT INTO vicidial_log SET uniqueid='$uniqueid',lead_id='$VD_lead_id',list_id='$VD_list_id',status='PDROP',campaign_id='$VD_campaign_id',call_date='$VD_call_time',start_epoch='$VD_start_epoch',phone_code='$VD_phone_code',phone_number='$VD_phone_number',user='VDAD',processed='N',length_in_sec='0',end_epoch='$VD_start_epoch',alt_dial='$VD_alt_dial';"; + $stmtA = "INSERT INTO vicidial_log SET uniqueid='$uniqueid',lead_id='$VD_lead_id',list_id='$VD_list_id',status='PDROP',campaign_id='$VD_campaign_id',call_date='$VD_call_time',start_epoch='$VD_start_epoch',phone_code='$VD_phone_code',phone_number='$VD_phone_number',user='VDAD',processed='N',length_in_sec='0',end_epoch='$VD_start_epoch',alt_dial='$VD_alt_dial',called_count='$called_count';"; $VDLPDaffected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- PDROP vicidial_log insert: |$VDLPDaffected_rows|$uniqueid|$CIDlead_id|$VDL_status|"; &agi_output;} diff --git a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql index f0fcea7e..47cec00e 100644 --- a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql +++ b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql @@ -460,6 +460,7 @@ processed ENUM('Y','N'), user_group VARCHAR(20), term_reason ENUM('CALLER','AGENT','QUEUETIMEOUT','ABANDON','AFTERHOURS','NONE') default 'NONE', alt_dial VARCHAR(6) default 'NONE', +called_count SMALLINT(5) UNSIGNED default '0', index (lead_id), index (call_date) ) ENGINE=MyISAM; @@ -486,6 +487,7 @@ term_reason ENUM('CALLER','AGENT','QUEUETIMEOUT','ABANDON','AFTERHOURS','HOLDRE uniqueid VARCHAR(20) NOT NULL default '', agent_only VARCHAR(20) default '', queue_position SMALLINT(4) UNSIGNED default '1', +called_count SMALLINT(5) UNSIGNED default '0', index (lead_id), index (call_date), index (campaign_id), @@ -3223,4 +3225,4 @@ UPDATE vicidial_configuration set value='1766' where name='qc_database_version'; UPDATE system_settings set vdc_agent_api_active='1'; -UPDATE system_settings SET db_schema_version='1361',db_schema_update_date=NOW(); +UPDATE system_settings SET db_schema_version='1362',db_schema_update_date=NOW(); diff --git a/agc_2-X/trunk/extras/upgrade_2.8.sql b/agc_2-X/trunk/extras/upgrade_2.8.sql index a475a46c..3c124aa8 100644 --- a/agc_2-X/trunk/extras/upgrade_2.8.sql +++ b/agc_2-X/trunk/extras/upgrade_2.8.sql @@ -136,3 +136,10 @@ ALTER TABLE vicidial_campaigns ADD dispo_max_dispo VARCHAR(6) default 'DISMX'; ALTER TABLE vicidial_campaigns ADD pause_max SMALLINT(5) UNSIGNED default '0'; UPDATE system_settings SET db_schema_version='1361',db_schema_update_date=NOW() where db_schema_version < 1361; + +ALTER TABLE vicidial_closer_log ADD called_count SMALLINT(5) UNSIGNED default '0'; +ALTER TABLE vicidial_log ADD called_count SMALLINT(5) UNSIGNED default '0'; +ALTER TABLE vicidial_closer_log_archive ADD called_count SMALLINT(5) UNSIGNED default '0'; +ALTER TABLE vicidial_log_archive ADD called_count SMALLINT(5) UNSIGNED default '0'; + +UPDATE system_settings SET db_schema_version='1362',db_schema_update_date=NOW() where db_schema_version < 1362; diff --git a/agc_2-X/trunk/www/agc/vdc_db_query.php b/agc_2-X/trunk/www/agc/vdc_db_query.php index c7a0bcba..e2e4370f 100644 --- a/agc_2-X/trunk/www/agc/vdc_db_query.php +++ b/agc_2-X/trunk/www/agc/vdc_db_query.php @@ -337,10 +337,11 @@ # 130802-1039 - Changed to PHP mysqli functions # 130925-2108 - Fixed issue with List webform overrides # 131208-2157 - Added user log TIMEOUTLOGOUT event status +# 131209-1522 - Added called_count to log and closer log tables, fixed unanswered call logging issue # -$version = '2.8-235'; -$build = '131208-2157'; +$version = '2.8-236'; +$build = '131209-1522'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=533; $one_mysql_log=0; @@ -3803,7 +3804,7 @@ if ($stage == "start") $manualVLexists=0; $beginUNIQUEID = preg_replace("/\..*/","",$uniqueid); - $stmt="SELECT count(*) from vicidial_log where lead_id='$lead_id' and user='$user' and phone_number='$phone_number' and uniqueid LIKE \"$beginUNIQUEID%\";"; + $stmt="SELECT count(*) from vicidial_log where lead_id='$lead_id' and user='$user' and phone_number='$phone_number' and uniqueid LIKE \"$beginUNIQUEID%\" and called_count='$called_count';"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00223',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -3818,7 +3819,7 @@ if ($stage == "start") if ($manualVLexists < 1) { ##### insert log into vicidial_log for manual VICIDiaL call - $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group,alt_dial) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N','$user_group','$alt_dial');"; + $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group,alt_dial,called_count) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N','$user_group','$alt_dial','$called_count');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00279',$user,$server_ip,$session_name,$one_mysql_log);} @@ -3830,7 +3831,7 @@ if ($stage == "start") if ( ($manualVLexists > 0) or ($manualVLexistsDUP > 0) ) { ##### insert log into vicidial_log for manual VICIDiaL call - $stmt="UPDATE vicidial_log SET list_id='$list_id',comments='MANUAL',user_group='$user_group',alt_dial='$alt_dial' where lead_id='$lead_id' and user='$user' and phone_number='$phone_number' and uniqueid LIKE \"$beginUNIQUEID%\";"; + $stmt="UPDATE vicidial_log SET list_id='$list_id',comments='MANUAL',user_group='$user_group',alt_dial='$alt_dial' where lead_id='$lead_id' and user='$user' and phone_number='$phone_number' and uniqueid LIKE \"$beginUNIQUEID%\" and called_count='$called_count';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00224',$user,$server_ip,$session_name,$one_mysql_log);} @@ -3917,7 +3918,7 @@ if ($stage == "end") else { ##### look for the start epoch in the vicidial_log table - $stmt="SELECT start_epoch,term_reason,uniqueid,campaign_id,status FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id' order by call_date desc limit 1;"; + $stmt="SELECT start_epoch,term_reason,uniqueid,campaign_id,status FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id' and called_count='$called_count' order by call_date desc limit 1;"; $VDIDselect = "VDL_UIDLID $uniqueid $lead_id"; } $rslt=mysql_to_mysqli($stmt, $link); @@ -3946,7 +3947,7 @@ if ($stage == "end") fclose($fp); ##### start epoch in the vicidial_log table, couldn't find one in vicidial_closer_log - $stmt="SELECT start_epoch,term_reason,campaign_id,status FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id' order by call_date desc limit 1;"; + $stmt="SELECT start_epoch,term_reason,campaign_id,status FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id' and called_count='$called_count' order by call_date desc limit 1;"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00061',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -4587,7 +4588,7 @@ if ($stage == "end") ### check to see if the vicidial_log record exists, if not, insert it $manualVLexists=0; $beginUNIQUEID = preg_replace("/\..*/","",$uniqueid); - $stmt="SELECT status from vicidial_log where lead_id='$lead_id' and user='$user' and phone_number='$phone_number' and uniqueid LIKE \"$beginUNIQUEID%\";"; + $stmt="SELECT status from vicidial_log where lead_id='$lead_id' and user='$user' and phone_number='$phone_number' and uniqueid LIKE \"$beginUNIQUEID%\" and called_count='$called_count';"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00223',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -4601,7 +4602,7 @@ if ($stage == "end") if ($manualVLexists < 1) { ##### insert log into vicidial_log for manual VICIDiaL call - $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group,alt_dial) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','DONEM','$phone_code','$phone_number','$user','MANUAL','N','$user_group','$alt_dial');"; + $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group,alt_dial,called_count) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','DONEM','$phone_code','$phone_number','$user','MANUAL','N','$user_group','$alt_dial','$called_count');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00280',$user,$server_ip,$session_name,$one_mysql_log);} @@ -4619,7 +4620,7 @@ if ($stage == "end") } else { - $stmt="UPDATE vicidial_log SET uniqueid='$uniqueid' where lead_id='$lead_id' and user='$user' and phone_number='$phone_number' and uniqueid LIKE \"$beginUNIQUEID%\";"; + $stmt="UPDATE vicidial_log SET uniqueid='$uniqueid' where lead_id='$lead_id' and user='$user' and phone_number='$phone_number' and uniqueid LIKE \"$beginUNIQUEID%\" and called_count='$called_count';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00057',$user,$server_ip,$session_name,$one_mysql_log);} @@ -4628,7 +4629,7 @@ if ($stage == "end") ##### update the duration and end time in the vicidial_log table if ($VDstatus == 'INCALL') {$vl_statusSQL = ",status='$status_dispo'";} - $stmt="UPDATE vicidial_log set $SQLterm end_epoch='$StarTtime', length_in_sec='$length_in_sec' $vl_statusSQL where uniqueid='$uniqueid' and lead_id='$lead_id' and user='$user' order by call_date desc limit 1;"; + $stmt="UPDATE vicidial_log set $SQLterm end_epoch='$StarTtime', length_in_sec='$length_in_sec' $vl_statusSQL where uniqueid='$uniqueid' and lead_id='$lead_id' and user='$user' and called_count='$called_count' order by call_date desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00090',$user,$server_ip,$session_name,$one_mysql_log);} @@ -8221,12 +8222,13 @@ if ($ACTION == 'updateDISPO') audit_comments($lead_id,$list_id,$format,$user,$mel,$NOW_TIME,$link,$server_ip,$session_name,$one_mysql_log,$campaign); // JOEJ - Email feature - may not be necessary if vicidial_email_list doesn't need a status column. - if ($email_enabled>0) { + if ($email_enabled>0) + { $stmt="UPDATE vicidial_email_list set status='$dispo_choice', user='$user' where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00142',$user,$server_ip,$session_name,$one_mysql_log);} - } + } # $fp = fopen ("./vicidial_debug.txt", "a"); # fwrite ($fp, "$NOW_TIME|DISPO_CALL |$MDnextCID|$stage|$campaign|$lead_id|$dispo_choice|$user|$uniqueid|$auto_dial_level|$agent_log_id|\n"); @@ -8271,14 +8273,14 @@ if ($ACTION == 'updateDISPO') if ( ($auto_dial_level < 1) or (preg_match('/^M/',$MDnextCID)) ) { - $stmt = "SELECT count(*) from vicidial_log where lead_id='$lead_id' and call_date > \"$four_hours_ago\" and ( (user='$user') or ( (comments='MANUAL') and status IN('AB','ADC','ADCT') ) );"; + $stmt = "SELECT count(*) from vicidial_log where lead_id='$lead_id' and call_date > \"$four_hours_ago\" and called_count='$called_count';"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00213',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysqli_fetch_row($rslt); if ($row[0] > 0) { - $stmt="UPDATE vicidial_log set status='$log_dispo_choice',user='$user' where lead_id='$lead_id' and call_date > \"$four_hours_ago\" and ( (user='$user') or ( (comments='MANUAL') and status IN('AB','ADC','ADCT') ) ) order by uniqueid desc limit 1;"; + $stmt="UPDATE vicidial_log set status='$log_dispo_choice',user='$user' where lead_id='$lead_id' and call_date > \"$four_hours_ago\" and called_count='$called_count' order by uniqueid desc limit 1;"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00145',$user,$server_ip,$session_name,$one_mysql_log);} @@ -8305,13 +8307,13 @@ if ($ACTION == 'updateDISPO') if ($VLinfo_ct > 0) { $row=mysqli_fetch_row($rslt); - $VLlist_id = "$row[0]"; + $VLlist_id = $row[0]; if (strlen($phone_number)<6) { - $VLphone_number = "$row[1]"; + $VLphone_number = $row[1]; $VLalt = 'MAIN'; - $VLalt_phone = "$row[3]"; - $VLaddress3 = "$row[4]"; + $VLalt_phone = $row[3]; + $VLaddress3 = $row[4]; } else { @@ -8369,7 +8371,7 @@ if ($ACTION == 'updateDISPO') $PADlead_id = sprintf("%010s", $lead_id); while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 1);} $FAKEcall_id = "$StarTtime.$PADlead_id"; - $stmt = "INSERT INTO vicidial_log set uniqueid='$FAKEcall_id',lead_id='$lead_id',list_id='$VLlist_id',campaign_id='$campaign',call_date='$NOW_TIME',start_epoch='$StarTtime',end_epoch='$StarTtime',length_in_sec='0',status='$log_dispo_choice',phone_code='$VLphone_code',phone_number='$VLphone_number',user='$user',comments='MANUAL',processed='N',user_group='$user_group',term_reason='AGENT',alt_dial='$VLalt';"; + $stmt = "INSERT INTO vicidial_log set uniqueid='$FAKEcall_id',lead_id='$lead_id',list_id='$VLlist_id',campaign_id='$campaign',call_date='$NOW_TIME',start_epoch='$StarTtime',end_epoch='$StarTtime',length_in_sec='0',status='$log_dispo_choice',phone_code='$VLphone_code',phone_number='$VLphone_number',user='$user',comments='MANUAL',processed='N',user_group='$user_group',term_reason='AGENT',alt_dial='$VLalt',called_count='$called_count';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00215',$user,$server_ip,$session_name,$one_mysql_log);} diff --git a/agc_2-X/trunk/www/agc/vicidial.php b/agc_2-X/trunk/www/agc/vicidial.php index 75d2f279..6fd8e1b0 100644 --- a/agc_2-X/trunk/www/agc/vicidial.php +++ b/agc_2-X/trunk/www/agc/vicidial.php @@ -414,10 +414,11 @@ # 131007-1348 - Added mrglock_ig_select_ct options.php setting # 131010-2149 - Added option to allow manual dial by lead_id # 131208-2331 - Added campaign options for max dead, dispo and pause time. Changed CB blink to CSS +# 131209-1604 - Addded called_count logging # -$version = '2.8-383c'; -$build = '131208-2331'; +$version = '2.8-384c'; +$build = '131209-1604'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=79; $one_mysql_log=0; @@ -5758,7 +5759,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection) "&list_id=" + document.vicidial_form.list_id.value + "&length_in_sec=0&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + lead_dial_number + - "&exten=" + extension + "&channel=" + lastcustchannel + "&start_epoch=" + MDlogEPOCH + "&auto_dial_level=" + auto_dial_level + "&VDstop_rec_after_each_call=" + VDstop_rec_after_each_call + "&conf_silent_prefix=" + conf_silent_prefix + "&protocol=" + protocol + "&extension=" + extension + "&ext_context=" + ext_context + "&conf_exten=" + session_id + "&user_abb=" + user_abb + "&agent_log_id=" + agent_log_id + "&MDnextCID=" + LasTCID + "&inOUT=" + inOUT + "&alt_dial=" + dialed_label + "&DB=0" + "&agentchannel=" + agentchannel + "&conf_dialed=" + conf_dialed + "&leaving_threeway=" + leaving_threeway + "&hangup_all_non_reserved=" + hangup_all_non_reserved + "&blind_transfer=" + blind_transfer + "&dial_method" + dial_method + "&nodeletevdac=" + nodeletevdac + "&alt_num_status=" + alt_num_status + "&qm_extension=" + qm_extension; + "&exten=" + extension + "&channel=" + lastcustchannel + "&start_epoch=" + MDlogEPOCH + "&auto_dial_level=" + auto_dial_level + "&VDstop_rec_after_each_call=" + VDstop_rec_after_each_call + "&conf_silent_prefix=" + conf_silent_prefix + "&protocol=" + protocol + "&extension=" + extension + "&ext_context=" + ext_context + "&conf_exten=" + session_id + "&user_abb=" + user_abb + "&agent_log_id=" + agent_log_id + "&MDnextCID=" + LasTCID + "&inOUT=" + inOUT + "&alt_dial=" + dialed_label + "&DB=0" + "&agentchannel=" + agentchannel + "&conf_dialed=" + conf_dialed + "&leaving_threeway=" + leaving_threeway + "&hangup_all_non_reserved=" + hangup_all_non_reserved + "&blind_transfer=" + blind_transfer + "&dial_method" + dial_method + "&nodeletevdac=" + nodeletevdac + "&alt_num_status=" + alt_num_status + "&qm_extension=" + qm_extension + "&called_count=" + document.vicidial_form.called_count.value; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); // document.getElementById("busycallsdebug").innerHTML = "vdc_db_query.php?" + manDiaLlog_query; @@ -10425,7 +10426,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection) } if (xmlhttp) { - DSupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=updateDISPO&format=text&user=" + user + "&pass=" + pass + "&orig_pass=" + orig_pass + "&dispo_choice=" + DispoChoice + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign + "&auto_dial_level=" + auto_dial_level + "&agent_log_id=" + agent_log_id + "&CallBackDatETimE=" + CallBackDatETimE + "&list_id=" + document.vicidial_form.list_id.value + "&recipient=" + CallBackrecipient + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&MDnextCID=" + LasTCID + "&stage=" + group + "&vtiger_callback_id=" + vtiger_callback_id + "&phone_number=" + document.vicidial_form.phone_number.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&dial_method" + dial_method + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&CallBackLeadStatus=" + CallBackLeadStatus + "&comments=" + encodeURIComponent(CallBackCommenTs) + "&custom_field_names=" + custom_field_names + "&call_notes=" + encodeURIComponent(document.vicidial_form.call_notes_dispo.value) + "&qm_dispo_code=" + DispoQMcsCODE + "&email_enabled=" + email_enabled + "&recording_id=" + VDDCU_recording_id + "&recording_filename=" + VDDCU_recording_filename; + DSupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=updateDISPO&format=text&user=" + user + "&pass=" + pass + "&orig_pass=" + orig_pass + "&dispo_choice=" + DispoChoice + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign + "&auto_dial_level=" + auto_dial_level + "&agent_log_id=" + agent_log_id + "&CallBackDatETimE=" + CallBackDatETimE + "&list_id=" + document.vicidial_form.list_id.value + "&recipient=" + CallBackrecipient + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&MDnextCID=" + LasTCID + "&stage=" + group + "&vtiger_callback_id=" + vtiger_callback_id + "&phone_number=" + document.vicidial_form.phone_number.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&dial_method" + dial_method + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&CallBackLeadStatus=" + CallBackLeadStatus + "&comments=" + encodeURIComponent(CallBackCommenTs) + "&custom_field_names=" + custom_field_names + "&call_notes=" + encodeURIComponent(document.vicidial_form.call_notes_dispo.value) + "&qm_dispo_code=" + DispoQMcsCODE + "&email_enabled=" + email_enabled + "&recording_id=" + VDDCU_recording_id + "&recording_filename=" + VDDCU_recording_filename + "&called_count=" + document.vicidial_form.called_count.value; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(DSupdate_query);