diff --git a/agc_2-X/trunk/UPGRADE b/agc_2-X/trunk/UPGRADE index 679dab36..a8a484e7 100644 --- a/agc_2-X/trunk/UPGRADE +++ b/agc_2-X/trunk/UPGRADE @@ -804,6 +804,17 @@ OTHER CHANGES: vicidial-auto-internal vicidial-auto-phones +183. Added Remote-Agent daily stats to the remote agent modification screen that + shows total calls and maximum number of concurrent calls per day. + +184. Added 'Hopper VLC Dup Check' campaign option that will check for duplicates + by vendor_lead_code before inserting leads into the hopper to be dialed. + This option is only recommended for some campaigns that are using the + MULTI_LEAD option of Auto-Alt-Dial. + *It is recommended that if you want to enable this feature you should + index the vendor_lead_code field in the vicidial_list table: + CREATE INDEX vendor_lead_code on vicidial_list (vendor_lead_code); + diff --git a/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl b/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl index 6c54e600..33c9e9fb 100644 --- a/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl +++ b/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl @@ -70,6 +70,7 @@ # 111221-1454 - Added resetting of max stats records at timeclock end of day # 120124-1032 - Added Answer to all call menus at the top # 120209-1525 - Separated all vicidial-auto dialplan contexts into their own contexts to allow for more control of dialing access through phones +# 120213-1405 - Added vicidial_daily_ra_stats rolling # $DB=0; # Debug flag @@ -898,8 +899,23 @@ if ($timeclock_end_of_day_NOW > 0) if ($DB) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";} $sthA->finish(); + $stmtA = "optimize table vicidial_daily_max_stats;"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + @aryA = $sthA->fetchrow_array; + if ($DB) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";} + $sthA->finish(); - + $stmtA = "optimize table vicidial_daily_ra_stats;"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + @aryA = $sthA->fetchrow_array; + if ($DB) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";} + $sthA->finish(); @@ -1040,6 +1056,44 @@ if ($timeclock_end_of_day_NOW > 0) ##### END max stats end of day process ##### + + ##### BEGIN ra stats end of day process ##### + # set OPEN ra stats records to CLOSING for processing + $stmtA = "UPDATE vicidial_daily_ra_stats SET stats_flag='CLOSING' where stats_flag='OPEN';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $affected_rows = $dbhA->do($stmtA); + if($DB){print STDERR "\n|$affected_rows Daily RA Stats Closing Process Started|\n";} + + # gather data from CLOSING ra stats records + $stmtA = "SELECT stats_date,stats_flag,user,update_time,closed_time,max_calls,total_calls from vicidial_daily_ra_stats where stats_flag='CLOSING';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArowsDMS=$sthA->rows; + $i=0; + while ($sthArowsDMS > $i) + { + @aryA = $sthA->fetchrow_array; + $Astats_date[$i] = $aryA[0]; + $Astats_flag[$i] = $aryA[1]; + $Auser[$i] = $aryA[2]; + $Aupdate_time[$i] = $aryA[3]; + $Aclosed_time[$i] = $aryA[4]; + $Amax_calls[$i] = $aryA[5]; + $Atotal_calls[$i] = $aryA[6]; + + if($DBXXX){print STDERR "\nMAX STATS: |$i|$Astats_date[$i]|$Astats_flag[$i]|$Auser[$i]|$Aupdate_time[$i]|$Aclosed_time[$i]|$Amax_calls[$i]|$Atotal_calls[$i]|\n";} + $i++; + } + $sthA->finish(); + + $stmtA = "UPDATE vicidial_daily_ra_stats SET stats_flag='CLOSED' where stats_flag='CLOSING';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $affected_rows = $dbhA->do($stmtA); + if($DB){print STDERR "\n|$affected_rows Daily RA Stats Closed Cleanup|\n";} + ##### END ra stats end of day process ##### + + + $dbhC = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_custom_user", "$VARDB_custom_pass") or die "Couldn't connect to database: " . DBI->errstr; diff --git a/agc_2-X/trunk/bin/AST_VDhopper.pl b/agc_2-X/trunk/bin/AST_VDhopper.pl index d5428153..4d1ef532 100644 --- a/agc_2-X/trunk/bin/AST_VDhopper.pl +++ b/agc_2-X/trunk/bin/AST_VDhopper.pl @@ -21,7 +21,7 @@ # - R = Recycled leads # - S = Standard hopper load # -# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGELOG # 50810-1613 - Added database server variable definitions lookup @@ -69,6 +69,7 @@ # 110214-2319 - Added lead_order_secondary option # 111006-1416 - Added call_count_limit option # 120109-1510 - Fixed list mix bug +# 120210-1735 - Added vendor_lead_code duplication check per campaign option # # constants @@ -364,7 +365,7 @@ if ($inactive_lists_count > 0) } -### BEGIN Change CBHOLD status leads to CALLBK if their vicidial_callbacks time has passed +##### BEGIN Change CBHOLD status leads to CALLBK if their vicidial_callbacks time has passed $stmtA = "SELECT count(*) FROM vicidial_callbacks where callback_time <= '$now_date' and status='ACTIVE';"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -378,7 +379,7 @@ if ($CBHOLD_count > 0) $update_leads=''; $cbc=0; $cba=0; - $stmtA = "SELECT vicidial_callbacks.lead_id,recipient,campaign_id,vicidial_callbacks.list_id,gmt_offset_now,state,vicidial_callbacks.lead_status FROM vicidial_callbacks,vicidial_list where callback_time <= '$now_date' and vicidial_callbacks.status='ACTIVE' and vicidial_callbacks.lead_id=vicidial_list.lead_id;"; + $stmtA = "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;"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -390,12 +391,13 @@ if ($CBHOLD_count > 0) $update_leads .= "'$lead_ids[$cbc]',"; if ($recipient =~ /ANYONE/) { - $CA_lead_id[$cba] = $aryA[0]; - $CA_campaign_id[$cba] = $aryA[2]; - $CA_list_id[$cba] = $aryA[3]; - $CA_gmt_offset_now[$cba] = $aryA[4]; - $CA_state[$cba] = $aryA[5]; - $CA_status[$cba] = $aryA[6]; + $CA_lead_id[$cba] = $aryA[0]; + $CA_campaign_id[$cba] = $aryA[2]; + $CA_list_id[$cba] = $aryA[3]; + $CA_gmt_offset_now[$cba] = $aryA[4]; + $CA_state[$cba] = $aryA[5]; + $CA_status[$cba] = $aryA[6]; + $CA_vendor_lead_code[$cba] = $aryA[7]; $cba++; } $cbc++; @@ -426,17 +428,17 @@ if ($CBHOLD_count > 0) $event_string = "|CALLBACKS LISTACT|$affected_rows|"; &event_logger; - $stmtA = "INSERT INTO $vicidial_hopper SET lead_id='$CA_lead_id[$CAu]',campaign_id='$CA_campaign_id[$CAu]',list_id='$CA_list_id[$CAu]',gmt_offset_now='$CA_gmt_offset_now[$CAu]',user='',state='$CA_state[$CAu]',priority='50',source='C';"; + $stmtA = "INSERT INTO $vicidial_hopper SET lead_id='$CA_lead_id[$CAu]',campaign_id='$CA_campaign_id[$CAu]',list_id='$CA_list_id[$CAu]',gmt_offset_now='$CA_gmt_offset_now[$CAu]',user='',state='$CA_state[$CAu]',priority='50',source='C',vendor_lead_code='$CA_vendor_lead_code[$cba]';"; $affected_rows = $dbhA->do($stmtA); if ($DB) {print "ANYONE Scheduled Callback Inserted into hopper: $affected_rows|$CA_lead_id[$CAu]\n";} $CAu++; } } } -### END Change CBHOLD status leads to CALLBK if their vicidial_callbacks time has passed +##### END Change CBHOLD status leads to CALLBK if their vicidial_callbacks time has passed -### BEGIN Auto-Alt-Dial DNC check and update or delete +##### BEGIN Auto-Alt-Dial DNC check and update or delete ### Find out how many leads in the hopper are set to DNC status $hopper_dnc_count=0; $stmtA = "SELECT count(*) from $vicidial_hopper where status='DNC';"; @@ -791,23 +793,23 @@ if ($hopper_dnc_count > 0) if ($DB) {$event_string = "-- VDH record DNC deleted: |$affected_rows| |$stmtA|X$Xlast|$VD_altdial_id|"; &event_logger;} } - $aad++; } } -### END Auto-Alt-Dial DNC check and update or delete - +##### END Auto-Alt-Dial DNC check and update or delete +##### BEGIN check for active campaigns that need the hopper run for them @campaign_id=@MT; +$ANY_hopper_vlc_dup_check='N'; if ($CLIcampaign) { - $stmtA = "SELECT campaign_id,lead_order,hopper_level,auto_dial_level,local_call_time,lead_filter_id,use_internal_dnc,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,dial_statuses,list_order_mix,use_campaign_dnc,drop_lockout_time,no_hopper_dialing,auto_alt_dial_statuses,dial_timeout,auto_hopper_multi,use_auto_hopper,auto_trim_hopper,lead_order_randomize,lead_order_secondary,call_count_limit from vicidial_campaigns where campaign_id='$CLIcampaign';"; + $stmtA = "SELECT campaign_id,lead_order,hopper_level,auto_dial_level,local_call_time,lead_filter_id,use_internal_dnc,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,dial_statuses,list_order_mix,use_campaign_dnc,drop_lockout_time,no_hopper_dialing,auto_alt_dial_statuses,dial_timeout,auto_hopper_multi,use_auto_hopper,auto_trim_hopper,lead_order_randomize,lead_order_secondary,call_count_limit,hopper_vlc_dup_check from vicidial_campaigns where campaign_id='$CLIcampaign';"; } else { - $stmtA = "SELECT campaign_id,lead_order,hopper_level,auto_dial_level,local_call_time,lead_filter_id,use_internal_dnc,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,dial_statuses,list_order_mix,use_campaign_dnc,drop_lockout_time,no_hopper_dialing,auto_alt_dial_statuses,dial_timeout,auto_hopper_multi,use_auto_hopper,auto_trim_hopper,lead_order_randomize,lead_order_secondary,call_count_limit from vicidial_campaigns where active='Y';"; + $stmtA = "SELECT campaign_id,lead_order,hopper_level,auto_dial_level,local_call_time,lead_filter_id,use_internal_dnc,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,dial_statuses,list_order_mix,use_campaign_dnc,drop_lockout_time,no_hopper_dialing,auto_alt_dial_statuses,dial_timeout,auto_hopper_multi,use_auto_hopper,auto_trim_hopper,lead_order_randomize,lead_order_secondary,call_count_limit,hopper_vlc_dup_check from vicidial_campaigns where active='Y';"; } $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -843,6 +845,10 @@ while ($sthArows > $rec_count) $lead_order_randomize[$rec_count] = $aryA[21]; $lead_order_secondary[$rec_count] = $aryA[22]; $call_count_limit[$rec_count] = $aryA[23]; + $hopper_vlc_dup_check[$rec_count] = $aryA[24]; + + if ($hopper_vlc_dup_check[$rec_count] =~ /Y/) + {$ANY_hopper_vlc_dup_check = 'Y';} ### Auto Hopper Level if ( $use_auto_hopper[$rec_count] =~ /Y/) @@ -937,6 +943,59 @@ while ($sthArows > $rec_count) } $sthA->finish(); if ($DB) {print "CAMPAIGNS TO PROCESSES HOPPER FOR: $rec_count|$#campaign_id\n";} +##### END check for active campaigns that need the hopper run for them + + +##### BEGIN if vendor_lead_code duplicate check, grab the vlc of all vicidial_auto_calls and vicidial_live_agent sessions +if ($ANY_hopper_vlc_dup_check =~ /Y/) + { + $live_leads=''; + $live_vlc=''; + $vacLIVE=0; + $vlaLIVE=0; + $vlLIVE=0; + $stmtA = "SELECT lead_id FROM vicidial_auto_calls where lead_id NOT IN('0');"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + while ($sthArows > $vacLIVE) + { + @aryA = $sthA->fetchrow_array; + $live_leads .= "'$aryA[0]',"; + $vacLIVE++; + } + chop($live_leads); + if (length($live_leads) < 2) {$live_leads = "''";} + $sthA->finish(); + $stmtA = "SELECT lead_id FROM vicidial_live_agents where lead_id NOT IN('0',$live_leads);"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + while ($sthArows > $vlaLIVE) + { + @aryA = $sthA->fetchrow_array; + $live_leads .= ",'$aryA[0]'"; + $vlaLIVE++; + } + $sthA->finish(); + + $stmtA = "SELECT vendor_lead_code FROM vicidial_list where lead_id IN($live_leads) and vendor_lead_code!='';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + while ($sthArows > $vlLIVE) + { + @aryA = $sthA->fetchrow_array; + if ( (length($aryA[0]) > 0) && ($aryA[0] !~ /^NULL/) ) + {$live_vlc .= "'$aryA[0]',";} + $vlLIVE++; + } + $sthA->finish(); + + if ($DB) {print "VLC Dup Check Live Calls: $vacLIVE|$vlaLIVE|$vlLIVE\n";} + if ($DBX) {print " $live_leads|$live_vlc\n";} + } +##### END if vendor_lead_code duplicate check, grab the vlc of all vicidial_auto_calls and vicidial_live_agent sessions ##### LOOP THROUGH EACH CAMPAIGN AND PROCESS THE HOPPER ##### @@ -1828,21 +1887,25 @@ foreach(@campaign_id) { if ($DB) {print " Getting Leads to add to hopper\n";} ### grab leads already in hopper so we don't duplicate - $stmtA = "SELECT lead_id FROM $vicidial_hopper where campaign_id='$campaign_id[$i]';"; + $stmtA = "SELECT lead_id,vendor_lead_code FROM $vicidial_hopper where campaign_id='$campaign_id[$i]';"; if ($DBX) {print " |$stmtA|\n";} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; $lead_id_lists = ''; + $vlc_lists = ''; $rec_countLISTS=0; while ($sthArows > $rec_countLISTS) { @aryA = $sthA->fetchrow_array; $lead_id_lists .= "'$aryA[0]',"; + if (length($aryA[1]) > 0) + {$vlc_lists .= "'$aryA[1]',";} $rec_countLISTS++; } $sthA->finish(); $lead_id_lists .= "'0'"; + $vlc_lists .= "'--99999999987654321--'"; $order_stmt=''; $NEW_count = 0; $NEW_level = 0; @@ -1892,12 +1955,16 @@ foreach(@campaign_id) @REC_status_to_hopper=@MT; @REC_modify_to_hopper=@MT; @REC_user_to_hopper=@MT; + @REC_vlc_to_hopper=@MT; @REC_source_to_hopper=@MT; if ($rec_ct[$i] > 0) { if ($DB) {print " looking for RECYCLE leads, maximum of $hopper_level[$i]\n";} + $vlc_dup_check_SQL=''; + if ($hopper_vlc_dup_check[$i] =~ /Y/) + {$vlc_dup_check_SQL = "and vendor_lead_code NOT IN($live_vlc$vlc_lists)";} - $stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state,status,modify_date,user FROM vicidial_list where $recycle_SQL[$i] and list_id IN($camp_lists[$i]) and lead_id NOT IN($lead_id_lists) and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $DLTsql[$i] $order_stmt limit $hopper_level[$i];"; + $stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state,status,modify_date,user,vendor_lead_code FROM vicidial_list where $recycle_SQL[$i] and list_id IN($camp_lists[$i]) and lead_id NOT IN($lead_id_lists) $vlc_dup_check_SQL and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $DLTsql[$i] $order_stmt limit $hopper_level[$i];"; if ($DBX) {print " |$stmtA|\n";} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -1915,9 +1982,13 @@ foreach(@campaign_id) $REC_status_to_hopper[$REC_rec_countLEADS] = $aryA[5]; $REC_modify_to_hopper[$REC_rec_countLEADS] = $aryA[6]; $REC_user_to_hopper[$REC_rec_countLEADS] = $aryA[7]; + $REC_vlc_to_hopper[$REC_rec_countLEADS] = $aryA[8]; $REC_source_to_hopper[$REC_rec_countLEADS] = 'R'; if ($DB_show_offset) {print "LEAD_ADD: $aryA[2] $aryA[3] $aryA[4]\n";} $REC_rec_countLEADS++; + + if (length($aryA[8]) > 0) + {$vlc_lists .= ",'$aryA[8]'";} } $sthA->finish(); } @@ -1938,14 +2009,18 @@ foreach(@campaign_id) @NEW_status_to_hopper=@MT; @NEW_modify_to_hopper=@MT; @NEW_user_to_hopper=@MT; + @NEW_vlc_to_hopper=@MT; @NEW_source_to_hopper=@MT; if ( ($NEW_count > 0) && ($list_order_mix[$i] =~ /DISABLED/) ) { $NEW_level = int($hopper_level[$i] / $NEW_count); $OTHER_level = ($hopper_level[$i] - $NEW_level); if ($DB) {print " looking for $NEW_level NEW leads mixed in with $OTHER_level other leads\n";} + $vlc_dup_check_SQL=''; + if ($hopper_vlc_dup_check[$i] =~ /Y/) + {$vlc_dup_check_SQL = "and vendor_lead_code NOT IN($live_vlc$vlc_lists)";} - $stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state,status,modify_date,user FROM vicidial_list where called_since_last_reset='N' and status IN('NEW') and list_id IN($camp_lists[$i]) and lead_id NOT IN($lead_id_lists) and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $DLTsql[$i] $order_stmt limit $NEW_level;"; + $stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state,status,modify_date,user,vendor_lead_code FROM vicidial_list where called_since_last_reset='N' and status IN('NEW') and list_id IN($camp_lists[$i]) and lead_id NOT IN($lead_id_lists) $vlc_dup_check_SQL and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $DLTsql[$i] $order_stmt limit $NEW_level;"; if ($DBX) {print " |$stmtA|\n";} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -1961,9 +2036,13 @@ foreach(@campaign_id) $NEW_status_to_hopper[$NEW_rec_countLEADS] = $aryA[5]; $NEW_modify_to_hopper[$NEW_rec_countLEADS] = $aryA[6]; $NEW_user_to_hopper[$NEW_rec_countLEADS] = $aryA[7]; + $NEW_vlc_to_hopper[$NEW_rec_countLEADS] = $aryA[8]; $NEW_source_to_hopper[$NEW_rec_countLEADS] = 'N'; if ($DB_show_offset) {print "LEAD_ADD: $aryA[2] $aryA[3] $aryA[4]\n";} $NEW_rec_countLEADS++; + + if (length($aryA[8]) > 0) + {$vlc_lists .= ",'$aryA[8]'";} } $OTHER_level = ($hopper_level[$i] - $NEW_rec_countLEADS); $sthA->finish(); @@ -1983,14 +2062,18 @@ foreach(@campaign_id) @status_to_hopper=@MT; @modify_to_hopper=@MT; @user_to_hopper=@MT; + @vlc_to_hopper=@MT; @source_to_hopper=@MT; if ($campaign_leads_to_call[$i] > 0) { if ($DB) {print " lead call order: $order_stmt\n";} + $vlc_dup_check_SQL=''; + if ($hopper_vlc_dup_check[$i] =~ /Y/) + {$vlc_dup_check_SQL = "and vendor_lead_code NOT IN($live_vlc$vlc_lists)";} if ($list_order_mix[$i] =~ /DISABLED/) { - $stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state,status,modify_date,user FROM vicidial_list where called_since_last_reset='N' and status IN($STATUSsql[$i]) and list_id IN($camp_lists[$i]) and lead_id NOT IN($lead_id_lists) and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $DLTsql[$i] $order_stmt limit $OTHER_level;"; + $stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state,status,modify_date,user,vendor_lead_code FROM vicidial_list where called_since_last_reset='N' and status IN($STATUSsql[$i]) and list_id IN($camp_lists[$i]) and lead_id NOT IN($lead_id_lists) $vlc_dup_check_SQL and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $DLTsql[$i] $order_stmt limit $OTHER_level;"; if ($DBX) {print " |$stmtA|\n";} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -2015,6 +2098,7 @@ foreach(@campaign_id) $status_to_hopper[$rec_countLEADS] = $NEW_status_to_hopper[$NEW_in]; $modify_to_hopper[$rec_countLEADS] = $NEW_modify_to_hopper[$NEW_in]; $user_to_hopper[$rec_countLEADS] = $NEW_user_to_hopper[$NEW_in]; + $vlc_to_hopper[$rec_countLEADS] = $NEW_vlc_to_hopper[$NEW_in]; $source_to_hopper[$rec_countLEADS] = $NEW_source_to_hopper[$NEW_in]; if ($DB_show_offset) {print "LEAD_ADD: $NEW_leads_to_hopper[$NEW_in] $NEW_phone_to_hopper[$NEW_in]\n";} $rec_countLEADS++; @@ -2032,6 +2116,7 @@ foreach(@campaign_id) $status_to_hopper[$rec_countLEADS] = $REC_status_to_hopper[$REC_insert_count]; $modify_to_hopper[$rec_countLEADS] = $REC_modify_to_hopper[$REC_insert_count]; $user_to_hopper[$rec_countLEADS] = $REC_user_to_hopper[$REC_insert_count]; + $vlc_to_hopper[$rec_countLEADS] = $REC_vlc_to_hopper[$REC_insert_count]; $source_to_hopper[$rec_countLEADS] = $REC_source_to_hopper[$REC_insert_count]; $rec_countLEADS++; $REC_insert_count++; @@ -2044,10 +2129,14 @@ foreach(@campaign_id) $status_to_hopper[$rec_countLEADS] = $aryA[5]; $modify_to_hopper[$rec_countLEADS] = $aryA[6]; $user_to_hopper[$rec_countLEADS] = $aryA[7]; + $vlc_to_hopper[$rec_countLEADS] = $aryA[8]; $source_to_hopper[$rec_countLEADS] = 'S'; if ($DB_show_offset) {print "LEAD_ADD: $aryA[2] $aryA[3] $aryA[4]\n";} $rec_countLEADS++; $rec_count++; + + if (length($aryA[8]) > 0) + {$vlc_lists .= ",'$aryA[8]'";} } $sthA->finish(); } @@ -2083,8 +2172,11 @@ foreach(@campaign_id) {$list_mix_stepARY[3] = "$list_mix_stepARY[3]'";} if ($DBX) {print " LM $x |$list_mix_stepARY[0]|$list_mix_stepARY[2]|$LM_step_goal[$x]|$list_mix_stepARY[3]|\n";} $list_mix_dialableSQL = "(list_id='$list_mix_stepARY[0]' and status IN($list_mix_stepARY[3]))"; + $vlc_dup_check_SQL=''; + if ($hopper_vlc_dup_check[$i] =~ /Y/) + {$vlc_dup_check_SQL = "and vendor_lead_code NOT IN($live_vlc$vlc_lists)";} - $stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state,status,modify_date,user FROM vicidial_list where called_since_last_reset='N' and $list_mix_dialableSQL and lead_id NOT IN($lead_id_lists) and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $DLTsql[$i] $order_stmt limit $LM_step_goal[$x];"; + $stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state,status,modify_date,user,vendor_lead_code FROM vicidial_list where called_since_last_reset='N' and $list_mix_dialableSQL and lead_id NOT IN($lead_id_lists) $vlc_dup_check_SQL and ($all_gmtSQL[$i]) $lead_filter_sql[$i] $DLTsql[$i] $order_stmt limit $LM_step_goal[$x];"; if ($DBX) {print " |$stmtA|\n";} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -2107,7 +2199,7 @@ foreach(@campaign_id) $order = ( ($x * 1000000) + $rec_count); } } - $LM_results[$z] = "$order$USX$aryA[0]$USX$aryA[1]$USX$aryA[2]$USX$aryA[3]$USX$aryA[4]$USX$aryA[5]$USX$aryA[6]$USX$aryA[7]"; + $LM_results[$z] = "$order$USX$aryA[0]$USX$aryA[1]$USX$aryA[2]$USX$aryA[3]$USX$aryA[4]$USX$aryA[5]$USX$aryA[6]$USX$aryA[7]$USX$aryA[8]"; # if ($DBX) {print " $z|$LM_results[$z]\n";} $rec_count++; @@ -2134,6 +2226,7 @@ foreach(@campaign_id) $status_to_hopper[$rec_countLEADS] = $REC_status_to_hopper[$REC_insert_count]; $modify_to_hopper[$rec_countLEADS] = $REC_modify_to_hopper[$REC_insert_count]; $user_to_hopper[$rec_countLEADS] = $REC_user_to_hopper[$REC_insert_count]; + $vlc_to_hopper[$rec_countLEADS] = $REC_vlc_to_hopper[$REC_insert_count]; $source_to_hopper[$rec_countLEADS] = $REC_source_to_hopper[$REC_insert_count]; $rec_countLEADS++; $REC_insert_count++; @@ -2146,11 +2239,15 @@ foreach(@campaign_id) $status_to_hopper[$rec_countLEADS] = $aryA[6]; $modify_to_hopper[$rec_countLEADS] = $aryA[7]; $user_to_hopper[$rec_countLEADS] = $aryA[8]; + $vlc_to_hopper[$rec_countLEADS] = $aryA[9]; $source_to_hopper[$rec_countLEADS] = 'S'; if ($DB_show_offset) {print "LEAD_ADD: $aryA[3] $aryA[4] $aryA[5]\n";} if ($DBX) {print " $w|$LM_results[$w]\n";} $rec_countLEADS++; $w++; + + if (length($aryA[9]) > 0) + {$vlc_lists .= ",'$aryA[9]'";} } } } @@ -2165,6 +2262,7 @@ foreach(@campaign_id) $status_to_hopper[$rec_countLEADS] = $REC_status_to_hopper[$REC_insert_count]; $modify_to_hopper[$rec_countLEADS] = $REC_modify_to_hopper[$REC_insert_count]; $user_to_hopper[$rec_countLEADS] = $REC_user_to_hopper[$REC_insert_count]; + $vlc_to_hopper[$rec_countLEADS] = $REC_vlc_to_hopper[$REC_insert_count]; $source_to_hopper[$rec_countLEADS] = $REC_source_to_hopper[$REC_insert_count]; $rec_countLEADS++; $REC_insert_count++; @@ -2263,38 +2361,61 @@ foreach(@campaign_id) } $sthA->finish(); + $VLC_exist=0; + if ( ($hopper_vlc_dup_check[$i] =~ /Y/) && (length($vlc_to_hopper[$h]) > 0) ) + { + $stmtA="SELECT count(*) FROM $vicidial_hopper where vendor_lead_code='$vlc_to_hopper[$h]';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $VLC_exist = $aryA[0]; + } + $sthA->finish(); + } + if ( ($VAC_exist > 0) || ($VLA_exist > 0) ) { - $detail_string = "LIVE CALL SKIPPING |$VAC_exist|$VLA_exist| |$campaign_id[$i]|$leads_to_hopper[$h]|$phone_to_hopper[$h]|$state_to_hopper[$h]|$gmt_to_hopper[$h]|$status_to_hopper[$h]|$modify_to_hopper[$h]|$user_to_hopper[$h]|"; + $detail_string = "LIVE CALL SKIPPING |$VAC_exist|$VLA_exist| |$campaign_id[$i]|$leads_to_hopper[$h]|$phone_to_hopper[$h]|$state_to_hopper[$h]|$gmt_to_hopper[$h]|$status_to_hopper[$h]|$modify_to_hopper[$h]|$user_to_hopper[$h]|$vlc_to_hopper[$h]|"; &detail_logger; } else { - if ($DNClead == '0') + if ( ($VLC_exist > 0) && ($hopper_vlc_dup_check[$i] =~ /Y/) ) { - $stmtA = "INSERT INTO $vicidial_hopper (lead_id,campaign_id,status,user,list_id,gmt_offset_now,state,priority,source) values('$leads_to_hopper[$h]','$campaign_id[$i]','READY','','$lists_to_hopper[$h]','$gmt_to_hopper[$h]','$state_to_hopper[$h]','0','$source_to_hopper[$h]');"; - $affected_rows = $dbhA->do($stmtA); - if ($DBX) {print "LEAD INSERTED: $affected_rows|$leads_to_hopper[$h]|\n";} - if ($DB_detail) - { - $detail_string = "|$campaign_id[$i]|$leads_to_hopper[$h]|$phone_to_hopper[$h]|$state_to_hopper[$h]|$gmt_to_hopper[$h]|$status_to_hopper[$h]|$modify_to_hopper[$h]|$user_to_hopper[$h]|$source_to_hopper[$h]|"; - &detail_logger; - } + $detail_string = "VLC CALL SKIPPING |$VLC_exist|$hopper_vlc_dup_check[$i]| |$campaign_id[$i]|$leads_to_hopper[$h]|$phone_to_hopper[$h]|$state_to_hopper[$h]|$gmt_to_hopper[$h]|$status_to_hopper[$h]|$modify_to_hopper[$h]|$user_to_hopper[$h]|$vlc_to_hopper[$h]|"; + &detail_logger; } else { - ##### Auto-Alt-Dial if DNCC or DNCL are set to campaign auto-alt-dial statuses, insert lead into hopper as DNC status - if ( ( ($auto_alt_dial_statuses[$i] =~ / DNCC /) && ($DNCC > 0) ) || ( ($auto_alt_dial_statuses[$i] =~ / DNCL /) && ($DNCL > 0) ) ) + if ($DNClead == '0') { - $stmtA = "INSERT INTO $vicidial_hopper (lead_id,campaign_id,status,user,list_id,gmt_offset_now,state,priority,source) values('$leads_to_hopper[$h]','$campaign_id[$i]','DNC','','$lists_to_hopper[$h]','$gmt_to_hopper[$h]','$state_to_hopper[$h]','0','$source_to_hopper[$h]');"; + $stmtA = "INSERT INTO $vicidial_hopper (lead_id,campaign_id,status,user,list_id,gmt_offset_now,state,priority,source,vendor_lead_code) values('$leads_to_hopper[$h]','$campaign_id[$i]','READY','','$lists_to_hopper[$h]','$gmt_to_hopper[$h]','$state_to_hopper[$h]','0','$source_to_hopper[$h]','$vlc_to_hopper[$h]');"; $affected_rows = $dbhA->do($stmtA); - if ($DBX) {print "LEAD INSERTED AS DNC: $affected_rows|$leads_to_hopper[$h]|\n";} + if ($DBX) {print "LEAD INSERTED: $affected_rows|$leads_to_hopper[$h]|\n";} if ($DB_detail) { - $detail_string = "|$campaign_id[$i]|$leads_to_hopper[$h]|$phone_to_hopper[$h]|$state_to_hopper[$h]|$gmt_to_hopper[$h]|$status_to_hopper[$h]|$modify_to_hopper[$h]|$user_to_hopper[$h]|$source_to_hopper[$h]|"; + $detail_string = "|$campaign_id[$i]|$leads_to_hopper[$h]|$phone_to_hopper[$h]|$state_to_hopper[$h]|$gmt_to_hopper[$h]|$status_to_hopper[$h]|$modify_to_hopper[$h]|$user_to_hopper[$h]|$vlc_to_hopper[$h]|$source_to_hopper[$h]|"; &detail_logger; } } + else + { + ##### Auto-Alt-Dial if DNCC or DNCL are set to campaign auto-alt-dial statuses, insert lead into hopper as DNC status + if ( ( ($auto_alt_dial_statuses[$i] =~ / DNCC /) && ($DNCC > 0) ) || ( ($auto_alt_dial_statuses[$i] =~ / DNCL /) && ($DNCL > 0) ) ) + { + $stmtA = "INSERT INTO $vicidial_hopper (lead_id,campaign_id,status,user,list_id,gmt_offset_now,state,priority,source,vendor_lead_code) values('$leads_to_hopper[$h]','$campaign_id[$i]','DNC','','$lists_to_hopper[$h]','$gmt_to_hopper[$h]','$state_to_hopper[$h]','0','$source_to_hopper[$h]','$vlc_to_hopper[$h]');"; + $affected_rows = $dbhA->do($stmtA); + if ($DBX) {print "LEAD INSERTED AS DNC: $affected_rows|$leads_to_hopper[$h]|\n";} + if ($DB_detail) + { + $detail_string = "|$campaign_id[$i]|$leads_to_hopper[$h]|$phone_to_hopper[$h]|$state_to_hopper[$h]|$gmt_to_hopper[$h]|$status_to_hopper[$h]|$modify_to_hopper[$h]|$user_to_hopper[$h]|$vlc_to_hopper[$h]|$source_to_hopper[$h]|"; + &detail_logger; + } + } + } } } } @@ -2324,11 +2445,10 @@ if($DB) if (!$q) {print "DONE. Script execution time in seconds: $secZ\n";} } - exit; - +##### SUBROUTINES ##### sub event_logger { if ($SYSLOG) diff --git a/agc_2-X/trunk/bin/AST_VDremote_agents.pl b/agc_2-X/trunk/bin/AST_VDremote_agents.pl index cb7008ac..c3e8c5a2 100644 --- a/agc_2-X/trunk/bin/AST_VDremote_agents.pl +++ b/agc_2-X/trunk/bin/AST_VDremote_agents.pl @@ -11,7 +11,7 @@ # agents that should appear to be logged in so that the calls can be transferred # out to them properly. # -# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGELOG: # 50215-0954 - First version of script @@ -43,6 +43,7 @@ # 110626-0030 - Added queuemetrics_pe_phone_append # 110707-1342 - Added last_inbound_call_time to next agent call options for inbound # 111201-1428 - Added grade-random next-agent-call option for inbound +# 120213-1701 - Added remote-agent daily stats # ### begin parsing run-time options ### @@ -284,8 +285,9 @@ while($one_day_interval > 0) @QHcampaign_id=@MT; @QHphone_number=@MT; @QHalt_dial=@MT; + @QHra_user=@MT; ##### grab number of QUEUE calls right now and update - $stmtA = "SELECT vla.live_agent_id,vla.lead_id,vla.uniqueid,vla.user,vac.call_type,vac.campaign_id,vac.phone_number,vac.alt_dial,vac.callerid FROM vicidial_live_agents vla,vicidial_auto_calls vac where vla.server_ip='$server_ip' and vla.status IN('QUEUE') and vla.extension LIKE \"R/%\" and vla.uniqueid=vac.uniqueid and vla.channel=vac.channel;"; + $stmtA = "SELECT vla.live_agent_id,vla.lead_id,vla.uniqueid,vla.user,vac.call_type,vac.campaign_id,vac.phone_number,vac.alt_dial,vac.callerid,vla.ra_user FROM vicidial_live_agents vla,vicidial_auto_calls vac where vla.server_ip='$server_ip' and vla.status IN('QUEUE') and vla.extension LIKE \"R/%\" and vla.uniqueid=vac.uniqueid and vla.channel=vac.channel;"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $vla_qh_ct=$sthA->rows; @@ -302,6 +304,7 @@ while($one_day_interval > 0) $QHphone_number[$w] = $aryA[6]; $QHalt_dial[$w] = $aryA[7]; $QHcall_id[$w] = $aryA[8]; + $QHra_user[$w] = $aryA[9]; if (length($QHalt_dial[$w]) < 1) {$QHalt_dial[$w] = 'MAIN';} $w++; } @@ -355,6 +358,53 @@ while($one_day_interval > 0) } $sthA->finish(); + + ##### BEGIN remote agent concurrent call calculation and updating + $concurrent_calls=0; + $incalls_count=0; + + ### Get count of concurrent calls for this in-group + $stmtA = "SELECT count(*) FROM vicidial_live_agents where ra_user='$QHra_user[$w]' and extension LIKE \"R/%\" and status IN('QUEUE','INCALL','DONE');"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $concurrent_calls = $aryA[0]; + $incalls_count = $aryA[0]; + # $incalls_count++; + } + $sthA->finish(); + + $STATSmax_ra=0; + $stmtA = "SELECT max_calls from vicidial_daily_ra_stats where user='$QHra_user[$w]' and stats_flag='OPEN' order by update_time desc limit 1;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $STATSmax_ra = $aryA[0]; + $sthA->finish(); + + $update_SQL=''; + if ($STATSmax_ra < $incalls_count) + {$update_SQL .= ",max_calls='$incalls_count'";} + + $stmtA = "UPDATE vicidial_daily_ra_stats SET update_time=NOW(),total_calls=(total_calls + 1)$update_SQL where user='$QHra_user[$w]' and stats_flag='OPEN';"; + $affected_rows = $dbhA->do($stmtA); + if ($AGILOG) {$agi_string = "DAILY STATS UPDATE $channel_group|$affected_rows|$stmtA|\n"; &agi_output;} + } + else + { + $stmtA = "INSERT INTO vicidial_daily_ra_stats SET stats_date='$YMD',update_time=NOW(),max_calls='$incalls_count',user='$QHra_user[$w]',stats_flag='OPEN',total_calls=1;"; + $affected_rows = $dbhA->do($stmtA); + if ($AGILOG) {$agi_string = "DAILY STATS INSERT $channel_group|$affected_rows|$stmtA|"; &agi_output;} + } + ##### END remote agent concurrent call calculation and updating + + ### This is where the call to the start_call_url launch goes if (length($start_call_url) > 5) @@ -1067,6 +1117,7 @@ sub get_time_now #get the current date and time and epoch for logging call lengt $tsSQLdate = "$year$mon$mday$hour$min$sec"; $SQLdate = "$year-$mon-$mday $hour:$min:$sec"; $filedate = "$year-$mon-$mday"; + $YMD = "$year-$mon-$mday"; $FDtarget = ($secX + 10); ($Fsec,$Fmin,$Fhour,$Fmday,$Fmon,$Fyear,$Fwday,$Fyday,$Fisdst) = localtime($FDtarget); diff --git a/agc_2-X/trunk/docs/NON-AGENT_API.txt b/agc_2-X/trunk/docs/NON-AGENT_API.txt index 91809e86..bfe6772a 100644 --- a/agc_2-X/trunk/docs/NON-AGENT_API.txt +++ b/agc_2-X/trunk/docs/NON-AGENT_API.txt @@ -1,4 +1,4 @@ -NON-AGENT API DOCUMENT Started: 2008-07-24 Updated: 2012-01-30 +NON-AGENT API DOCUMENT Started: 2008-07-24 Updated: 2012-02-13 This document describes the functions of an API(Application Programming Interface) for all functions NOT directly relating to the VICIDIAL Agent screen. @@ -67,6 +67,8 @@ Changes: 110928-2110 - Added callback options to add_lead and update_lead 111106-0959 - Added user_group restrictions to some functions 120127-1331 - Small fix for plus replacement in custom fields strings for add/update_lead functions +120210-1215 - Small change for hopper adding vendor_lead_code +120213-1613 - Added optional logging of all non-admin.php requests, enabled in options.php 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 51db931a..b2993fcf 100644 --- a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql +++ b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql @@ -343,6 +343,7 @@ state VARCHAR(2) default '', alt_dial VARCHAR(6) default 'NONE', priority TINYINT(2) default '0', source VARCHAR(1) default '', +vendor_lead_code VARCHAR(20) default '', index (lead_id) ); @@ -847,7 +848,8 @@ call_count_limit SMALLINT(5) UNSIGNED default '0', call_count_target SMALLINT(5) UNSIGNED default '3', callback_hours_block TINYINT(2) default '0', callback_list_calltime ENUM('ENABLED','DISABLED') default 'DISABLED', -user_group VARCHAR(20) default '---ALL---' +user_group VARCHAR(20) default '---ALL---', +hopper_vlc_dup_check ENUM('Y','N') default 'N' ); CREATE TABLE vicidial_lists ( @@ -2625,6 +2627,19 @@ index (stats_flag), index (campaign_id) ); +CREATE TABLE vicidial_daily_ra_stats ( +stats_date DATE NOT NULL, +stats_flag ENUM('OPEN','CLOSED','CLOSING') default 'CLOSED', +user VARCHAR(20) default '', +update_time TIMESTAMP, +closed_time DATETIME, +max_calls MEDIUMINT(8) UNSIGNED default '0', +total_calls INT(9) UNSIGNED default '0', +index (stats_date), +index (stats_flag), +index (user) +); + ALTER TABLE vicidial_campaign_server_stats ENGINE=MEMORY; @@ -2779,7 +2794,7 @@ CREATE TABLE vicidial_log_noanswer_archive LIKE vicidial_log_noanswer; CREATE TABLE vicidial_did_agent_log_archive LIKE vicidial_did_agent_log; CREATE UNIQUE INDEX vdala on vicidial_did_agent_log_archive (uniqueid,call_date,did_route); -UPDATE system_settings SET db_schema_version='1312',db_schema_update_date=NOW(); +UPDATE system_settings SET db_schema_version='1313',db_schema_update_date=NOW(); GRANT RELOAD ON *.* TO cron@'%'; GRANT RELOAD ON *.* TO cron@localhost; diff --git a/agc_2-X/trunk/extras/upgrade_2.4.sql b/agc_2-X/trunk/extras/upgrade_2.4.sql index 2f28aaba..e58dda8d 100644 --- a/agc_2-X/trunk/extras/upgrade_2.4.sql +++ b/agc_2-X/trunk/extras/upgrade_2.4.sql @@ -1243,3 +1243,21 @@ ALTER TABLE vicidial_campaigns MODIFY timer_action VARCHAR(20) default 'NONE'; ALTER TABLE vicidial_inbound_groups MODIFY timer_action VARCHAR(20) default 'NONE'; UPDATE system_settings SET db_schema_version='1312',db_schema_update_date=NOW() where db_schema_version < 1312; + +ALTER TABLE vicidial_campaigns ADD hopper_vlc_dup_check ENUM('Y','N') default 'N'; +ALTER TABLE vicidial_hopper ADD vendor_lead_code VARCHAR(20) default ''; + +CREATE TABLE vicidial_daily_ra_stats ( +stats_date DATE NOT NULL, +stats_flag ENUM('OPEN','CLOSED','CLOSING') default 'CLOSED', +user VARCHAR(20) default '', +update_time TIMESTAMP, +closed_time DATETIME, +max_calls MEDIUMINT(8) UNSIGNED default '0', +total_calls INT(9) UNSIGNED default '0', +index (stats_date), +index (stats_flag), +index (user) +); + +UPDATE system_settings SET db_schema_version='1313',db_schema_update_date=NOW() where db_schema_version < 1313; diff --git a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt index 79e9d608..baa6d94b 100644 --- a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt +++ b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt @@ -475,11 +475,11 @@ This option if set to 1 will generate ADDMEMBER2 and REMOVEMEMBER entries in que Minimum Hopper Level|| This is the minimum number of leads the VDhopper script tries to keep in the vicidial_hopper table for this campaign. If running VDhopper script every minute, make this slightly greater than the number of leads you go through in a minute|| Automatic Hopper Level|| -Setting thing to Y will allow Vicidial to automatically adjust the hopper based off the settings you have in your campaign. The formula it uses to do this is|| +Setting this to Y will allow Vicidial to automatically adjust the hopper based off the settings you have in your campaign. The formula it uses to do this is|| Automatic Hopper Multiplier|| This is multiplier for the Auto Hopper. Setting this less than 1 will cause the Auto Hopper algorithm to load less leads than it normally would. Setting this greater than 1 will cause the Auto Hopper algorithm to load more leads than it normally would. Default is 1|| Auto Trim Hopper|| -Setting thing to Y will allow Vicidial to automatically remove excess leads from the hopper. Default is Y|| +Setting this to Y will allow Vicidial to automatically remove excess leads from the hopper. Default is Y|| Manual Dial API|| This option allows you to set the Agent API to make either one call at a time, STANDARD, or the ability to queue up manual dial calls and have them dial automatically once the agent goes on pause or is available to take their next call with the option to disable the automatic dialing of these calls, QUEUE, or QUEUE_AND_AUTOCALL which is the same as QUEUE but without the option to disable the automatic dialing of these calls. If an agent has more than one call queued up for them they will see the count of how many manual dial calls are in queue right below the Pause button, or Dial Next Number button. We suggest that if QUEUE is used that you send API actions using the preview=YES option so you are not repeatedly dialing calls for the agent without notice. Also, if using QUEUE and heavily using manual dial calls in a non MANUAL dial method, we would recommend setting the Agent Pause After Each Call option to Y. Default is STANDARD|| Manual Call Time Check|| @@ -830,6 +830,8 @@ These are statistics that are generated by the system each day throughout the da Add or Remove In-Group Selected For Active Users in This User Group|| Maximum System Stats Reports|| These statistics are cached totals that are stored throughout each day in real-time through back-end processes. For inbound calls, the total calls per in-group are calculated for each call that enters the process that calculates. For the whole system counts, the totals are generated from log entries as well as other in-group and campaign totals. These totals may not add up due to the settings that you have in your system as well as when the call is hung up|| +Hopper VLC Dup Check|| +Setting this to Y will result in every lead being inserted into the hopper being checked by vendor_lead_code to make sure there are no duplicate leads inserted with the same vendor_lead_code. This is most useful when Auto-Alt-Dialing with MULTI_LEAD. Default is N|| lead_report_export.php diff --git a/agc_2-X/trunk/www/agc/functions.php b/agc_2-X/trunk/www/agc/functions.php index 50082168..cc866913 100644 --- a/agc_2-X/trunk/www/agc/functions.php +++ b/agc_2-X/trunk/www/agc/functions.php @@ -4,7 +4,7 @@ # # functions for agent scripts # -# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # # CHANGES: @@ -13,6 +13,7 @@ # 110630-0026 - Added HIDDEN and READONLY field types # 110719-0858 - Added HIDEBLOB field type # 110730-2336 - Added call_id variable +# 120213-1709 - Commented out default of READONLY fields since they cannot change # @@ -243,8 +244,8 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user) } if ($A_field_type[$o]=='READONLY') { - if (strlen($A_field_value[$o]) < 1) {$A_field_value[$o] = $A_field_default[$o];} if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + # if (strlen($A_field_value[$o]) < 1) {$A_field_value[$o] = $A_field_default[$o];} $field_HTML .= " $A_field_value[$o]\n"; } if ( ($A_field_type[$o]=='HIDDEN') or ($A_field_type[$o]=='HIDEBLOB') ) 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 c5424c93..9ab690a9 100644 --- a/agc_2-X/trunk/www/agc/vdc_db_query.php +++ b/agc_2-X/trunk/www/agc/vdc_db_query.php @@ -302,10 +302,11 @@ # 111114-0035 - Added qm-dispo-code field to updatedispo function # 111201-1443 - Added group_grade option # 120104-2031 - Fixed missing fullname variable before dispo and start URLs +# 120213-1700 - Added vendor_lead_code to all vicidial_hopper inserts # -$version = '2.4-202'; -$build = '120104-2031'; +$version = '2.4-203'; +$build = '120213-1700'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=438; $one_mysql_log=0; @@ -2052,7 +2053,7 @@ if ($ACTION == 'manDiaLnextCaLL') if ($affected_rows > 0) { - $stmt="SELECT lead_id,list_id,gmt_offset_now,state,entry_list_id FROM vicidial_list where user='QUEUE$user' order by modify_date desc LIMIT 1;"; + $stmt="SELECT lead_id,list_id,gmt_offset_now,state,entry_list_id,vendor_lead_code FROM vicidial_list where user='QUEUE$user' order by modify_date desc LIMIT 1;"; $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00243',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -2065,8 +2066,9 @@ if ($ACTION == 'manDiaLnextCaLL') $gmt_offset_now = $row[2]; $state = $row[3]; $entry_list_id = $row[4]; + $vendor_lead_code = $row[5]; - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='QUEUE',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='MAIN',user='$user',priority='0',source='Q';"; + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='QUEUE',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='MAIN',user='$user',priority='0',source='Q',vendor_lead_code='$vendor_lead_code';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00244',$user,$server_ip,$session_name,$one_mysql_log);} @@ -3669,7 +3671,7 @@ if ($stage == "end") if ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("(ALT_ONLY|ALT_AND_ADDR3|ALT_AND_EXTENDED)",$auto_alt_dial)) ) { $alt_dial_skip=0; - $stmt="SELECT alt_phone,gmt_offset_now,state FROM vicidial_list where lead_id='$lead_id';"; + $stmt="SELECT alt_phone,gmt_offset_now,state,vendor_lead_code FROM vicidial_list where lead_id='$lead_id';"; $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00065',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -3681,6 +3683,7 @@ if ($stage == "end") $alt_phone = eregi_replace("[^0-9]","",$alt_phone); $gmt_offset_now = $row[1]; $state = $row[2]; + $vendor_lead_code = $row[3]; } else {$alt_phone = '';} if (strlen($alt_phone)>5) @@ -3729,7 +3732,7 @@ if ($stage == "end") if ($VD_alt_dnc_count < 1) { ### insert record into vicidial_hopper for alt_phone call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='',priority='25',source='A';"; + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='',priority='25',source='A',vendor_lead_code='$vendor_lead_code';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00068',$user,$server_ip,$session_name,$one_mysql_log);} @@ -3746,7 +3749,7 @@ if ($stage == "end") if ( ( (eregi("(ALT)",$alt_dial)) and (eregi("ALT_AND_ADDR3",$auto_alt_dial)) ) or ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("ADDR3_ONLY",$auto_alt_dial)) ) ) { $addr3_dial_skip=0; - $stmt="SELECT address3,gmt_offset_now,state FROM vicidial_list where lead_id='$lead_id';"; + $stmt="SELECT address3,gmt_offset_now,state,vendor_lead_code FROM vicidial_list where lead_id='$lead_id';"; $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00069',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -3758,6 +3761,7 @@ if ($stage == "end") $address3 = eregi_replace("[^0-9]","",$address3); $gmt_offset_now = $row[1]; $state = $row[2]; + $vendor_lead_code = $row[3]; } else {$address3 = '';} if (strlen($address3)>5) @@ -3806,7 +3810,7 @@ if ($stage == "end") if ($VD_alt_dnc_count < 1) { ### insert record into vicidial_hopper for address3 call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='',priority='20',source='A';"; + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='',priority='20',source='A',vendor_lead_code='$vendor_lead_code';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00072',$user,$server_ip,$session_name,$one_mysql_log);} @@ -3833,7 +3837,7 @@ if ($stage == "end") {$Xlast=0;} $VD_altdialx=''; - $stmt="SELECT gmt_offset_now,state,list_id,entry_list_id FROM vicidial_list where lead_id='$lead_id';"; + $stmt="SELECT gmt_offset_now,state,list_id,entry_list_id,vendor_lead_code FROM vicidial_list where lead_id='$lead_id';"; $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00073',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -3845,6 +3849,7 @@ if ($stage == "end") $EA_state = $row[1]; $EA_list_id = $row[2]; $EA_entry_list_id = $row[3]; + $EA_vendor_lead_code = $row[4]; } $alt_dial_phones_count=0; $stmt="SELECT count(*) FROM vicidial_list_alt_phones where lead_id='$lead_id';"; @@ -3922,7 +3927,7 @@ if ($stage == "end") { if ($alt_dial_phones_count == $Xlast) {$Xlast = 'LAST';} - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$EA_list_id',gmt_offset_now='$EA_gmt_offset_now',state='$EA_state',alt_dial='X$Xlast',user='',priority='15',source='A';"; + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$EA_list_id',gmt_offset_now='$EA_gmt_offset_now',state='$EA_state',alt_dial='X$Xlast',user='',priority='15',source='A',vendor_lead_code='$EA_vendor_lead_code';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00078',$user,$server_ip,$session_name,$one_mysql_log);} diff --git a/agc_2-X/trunk/www/vicidial/AST_VICIDIAL_hopperlist.php b/agc_2-X/trunk/www/vicidial/AST_VICIDIAL_hopperlist.php index fd39990a..5ad077a9 100644 --- a/agc_2-X/trunk/www/vicidial/AST_VICIDIAL_hopperlist.php +++ b/agc_2-X/trunk/www/vicidial/AST_VICIDIAL_hopperlist.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -14,6 +14,7 @@ # 91023-1540 - Changed to only show hopper status of READY # 101111-1253 - Added source field # 111103-1207 - Added admin_hide_phone_data and admin_hide_lead_data options +# 120210-1218 - Added vendor_lead_code to output # require("dbconnect.php"); @@ -141,11 +142,11 @@ else echo "\n"; echo "---------- LEADS IN HOPPER\n"; - echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+-------+\n"; - echo "|ORDER |PRIORITY| LEAD ID | LIST ID | PHONE NUM | STATE | STATUS | COUNT | GMT | ALT | SOURCE|\n"; - echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+-------+\n"; + echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+-------+----------------------+\n"; + echo "|ORDER |PRIORITY| LEAD ID | LIST ID | PHONE NUM | STATE | STATUS | COUNT | GMT | ALT | SOURCE| VENDOR LEAD CODE |\n"; + echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+-------+----------------------+\n"; - $stmt="select vicidial_hopper.lead_id,phone_number,vicidial_hopper.state,vicidial_list.status,called_count,vicidial_hopper.gmt_offset_now,hopper_id,alt_dial,vicidial_hopper.list_id,vicidial_hopper.priority,vicidial_hopper.source from vicidial_hopper,vicidial_list where vicidial_hopper.campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_hopper.status='READY' and vicidial_hopper.lead_id=vicidial_list.lead_id order by priority desc,hopper_id limit 5000;"; + $stmt="select vicidial_hopper.lead_id,phone_number,vicidial_hopper.state,vicidial_list.status,called_count,vicidial_hopper.gmt_offset_now,hopper_id,alt_dial,vicidial_hopper.list_id,vicidial_hopper.priority,vicidial_hopper.source,vicidial_hopper.vendor_lead_code from vicidial_hopper,vicidial_list where vicidial_hopper.campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_hopper.status='READY' and vicidial_hopper.lead_id=vicidial_list.lead_id order by priority desc,hopper_id limit 5000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $users_to_print = mysql_num_rows($rslt); @@ -189,14 +190,15 @@ else $list_id = sprintf("%-10s", $row[8]); $priority = sprintf("%-6s", $row[9]); $source = sprintf("%-5s", $row[10]); + $vendor_lead_code = sprintf("%-20s", $row[11]); if ($DB) {echo "| $FMT_i | $priority | $lead_id | $list_id | $phone_number | $state | $status | $count | $gmt | $hopper_id |\n";} - else {echo "| $FMT_i | $priority | $lead_id | $list_id | $phone_number | $state | $status | $count | $gmt | $alt_dial | $source |\n";} + else {echo "| $FMT_i | $priority | $lead_id | $list_id | $phone_number | $state | $status | $count | $gmt | $alt_dial | $source | $vendor_lead_code |\n";} $i++; } - echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+-------+\n"; + echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+-------+----------------------+\n"; } diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index 2e2c66aa..beba9fb6 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -1722,6 +1722,8 @@ if (isset($_GET["max_calls_action"])) {$max_calls_action=$_GET["max_calls_acti elseif (isset($_POST["max_calls_action"])) {$max_calls_action=$_POST["max_calls_action"];} if (isset($_GET["territory_reset"])) {$territory_reset=$_GET["territory_reset"];} elseif (isset($_POST["territory_reset"])) {$territory_reset=$_POST["territory_reset"];} +if (isset($_GET["hopper_vlc_dup_check"])) {$hopper_vlc_dup_check=$_GET["hopper_vlc_dup_check"];} + elseif (isset($_POST["hopper_vlc_dup_check"])) {$hopper_vlc_dup_check=$_POST["hopper_vlc_dup_check"];} if (isset($script_id)) {$script_id= strtoupper($script_id);} @@ -2104,6 +2106,7 @@ if ($non_latin < 1) $did_agent_log = ereg_replace("[^NY]","",$did_agent_log); $completed = ereg_replace("[^NY]","",$completed); $report_option = ereg_replace("[^NY]","",$report_option); + $hopper_vlc_dup_check = ereg_replace("[^NY]","",$hopper_vlc_dup_check); $qc_enabled = ereg_replace("[^0-9NY]","",$qc_enabled); $active = ereg_replace("[^0-9NY]","",$active); @@ -3030,12 +3033,13 @@ else # 120125-1234 - Added Maximum System Stats report and permissions for it and Max Stats Detail report # 120125-2107 - Added User Group Active User In-Group Select function to User Group page # 120207-1955 - Added List territory reset function +# 120213-1512 - Added remote agent max stats display and campaign VLC hopper dup check option # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time -$admin_version = '2.4-358a'; -$build = '120207-1955'; +$admin_version = '2.4-359a'; +$build = '120213-1512'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -4757,7 +4761,7 @@ if ($ADD==99999)

- Automatic Hopper Level - Setting thing to Y will allow Vicidial to automatically adjust the hopper based off the settings you have in your campaign. The formula it uses to do this is:
Number of Active Agents * Auto Dial Level * ( 60 seconds / Dial Timeout ) * Auto Hopper Multiplier
Default is Y. + Automatic Hopper Level - Setting this to Y will allow Vicidial to automatically adjust the hopper based off the settings you have in your campaign. The formula it uses to do this is:
Number of Active Agents * Auto Dial Level * ( 60 seconds / Dial Timeout ) * Auto Hopper Multiplier
Default is Y.
@@ -4767,7 +4771,12 @@ if ($ADD==99999)

- Auto Trim Hopper - Setting thing to Y will allow Vicidial to automatically remove excess leads from the hopper. Default is Y. + Auto Trim Hopper - Setting this to Y will allow Vicidial to automatically remove excess leads from the hopper. Default is Y. + +
+
+
+ Hopper VLC Dup Check - Setting this to Y will result in every lead being inserted into the hopper being checked by vendor_lead_code to make sure there are no duplicate leads inserted with the same vendor_lead_code. This is most useful when Auto-Alt-Dialing with MULTI_LEAD. Default is N.
@@ -11513,7 +11522,7 @@ if ($ADD==20) $rslt=mysql_query($stmt, $link); } - $stmt="INSERT INTO vicidial_campaigns (campaign_name,campaign_id,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats,use_auto_hopper,auto_hopper_multi,auto_trim_hopper,api_manual_dial,manual_dial_call_time_check,display_leads_count,lead_order_randomize,lead_order_secondary,per_call_notes,my_callback_option,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment,auto_pause_precall,auto_resume_precall,auto_pause_precall_code,manual_dial_cid,post_phone_time_diff_alert,custom_3way_button_transfer,available_only_tally_threshold,available_only_tally_threshold_agents,dial_level_threshold,dial_level_threshold_agents,safe_harbor_audio,safe_harbor_menu_id,survey_menu_id,callback_days_limit,dl_diff_target_method,disable_dispo_screen,disable_dispo_status,screen_labels,status_display_fields,na_call_url,survey_recording,pllb_grouping,pllb_grouping_limit,call_count_limit,call_count_target,callback_hours_block,callback_list_calltime,user_group) SELECT \"$campaign_name\",\"$campaign_id\",\"N\",dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,\"DISABLED\",campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats,use_auto_hopper,auto_hopper_multi,auto_trim_hopper,api_manual_dial,manual_dial_call_time_check,display_leads_count,lead_order_randomize,lead_order_secondary,per_call_notes,my_callback_option,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment,auto_pause_precall,auto_resume_precall,auto_pause_precall_code,manual_dial_cid,post_phone_time_diff_alert,custom_3way_button_transfer,available_only_tally_threshold,available_only_tally_threshold_agents,dial_level_threshold,dial_level_threshold_agents,safe_harbor_audio,safe_harbor_menu_id,survey_menu_id,callback_days_limit,dl_diff_target_method,disable_dispo_screen,disable_dispo_status,screen_labels,status_display_fields,na_call_url,survey_recording,pllb_grouping,pllb_grouping_limit,call_count_limit,call_count_target,callback_hours_block,callback_list_calltime,user_group from vicidial_campaigns where campaign_id='$source_campaign_id';"; + $stmt="INSERT INTO vicidial_campaigns (campaign_name,campaign_id,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats,use_auto_hopper,auto_hopper_multi,auto_trim_hopper,api_manual_dial,manual_dial_call_time_check,display_leads_count,lead_order_randomize,lead_order_secondary,per_call_notes,my_callback_option,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment,auto_pause_precall,auto_resume_precall,auto_pause_precall_code,manual_dial_cid,post_phone_time_diff_alert,custom_3way_button_transfer,available_only_tally_threshold,available_only_tally_threshold_agents,dial_level_threshold,dial_level_threshold_agents,safe_harbor_audio,safe_harbor_menu_id,survey_menu_id,callback_days_limit,dl_diff_target_method,disable_dispo_screen,disable_dispo_status,screen_labels,status_display_fields,na_call_url,survey_recording,pllb_grouping,pllb_grouping_limit,call_count_limit,call_count_target,callback_hours_block,callback_list_calltime,user_group,hopper_vlc_dup_check) SELECT \"$campaign_name\",\"$campaign_id\",\"N\",dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,\"DISABLED\",campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats,use_auto_hopper,auto_hopper_multi,auto_trim_hopper,api_manual_dial,manual_dial_call_time_check,display_leads_count,lead_order_randomize,lead_order_secondary,per_call_notes,my_callback_option,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment,auto_pause_precall,auto_resume_precall,auto_pause_precall_code,manual_dial_cid,post_phone_time_diff_alert,custom_3way_button_transfer,available_only_tally_threshold,available_only_tally_threshold_agents,dial_level_threshold,dial_level_threshold_agents,safe_harbor_audio,safe_harbor_menu_id,survey_menu_id,callback_days_limit,dl_diff_target_method,disable_dispo_screen,disable_dispo_status,screen_labels,status_display_fields,na_call_url,survey_recording,pllb_grouping,pllb_grouping_limit,call_count_limit,call_count_target,callback_hours_block,callback_list_calltime,user_group,hopper_vlc_dup_check from vicidial_campaigns where campaign_id='$source_campaign_id';"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; @@ -14745,7 +14754,7 @@ if ($ADD==41) if (strlen($groups_value)>2) {$groups_value .= " -";} } - $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', auto_trim_hopper='$auto_trim_hopper', use_auto_hopper='$use_auto_hopper', auto_hopper_multi='$auto_hopper_multi', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns=$closer_campaignsSQL,use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_refresh='$campaign_stats_refresh',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count',manual_dial_filter='$manual_dial_filter',agent_clipboard_copy='$agent_clipboard_copy',agent_extended_alt_dial='$agent_extended_alt_dial',use_campaign_dnc='$use_campaign_dnc',three_way_call_cid='$three_way_call_cid',three_way_dial_prefix='$three_way_dial_prefix',web_form_target='$web_form_target',vtiger_search_category='$vtiger_search_category',vtiger_create_call_record='$vtiger_create_call_record',vtiger_create_lead_record='$vtiger_create_lead_record',vtiger_screen_login='$vtiger_screen_login',cpd_amd_action='$cpd_amd_action',agent_allow_group_alias='$agent_allow_group_alias',default_group_alias='$default_group_alias',vtiger_search_dead='$vtiger_search_dead',vtiger_status_call='$vtiger_status_call',drop_lockout_time='$drop_lockout_time',quick_transfer_button='$quick_transfer_button',prepopulate_transfer_preset='$prepopulate_transfer_preset',drop_rate_group='$drop_rate_group',view_calls_in_queue='$view_calls_in_queue',view_calls_in_queue_launch='$view_calls_in_queue_launch',grab_calls_in_queue='$grab_calls_in_queue',call_requeue_button='$call_requeue_button',pause_after_each_call='$pause_after_each_call',no_hopper_dialing='$no_hopper_dialing',agent_dial_owner_only='$agent_dial_owner_only',agent_display_dialable_leads='$agent_display_dialable_leads',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',waitforsilence_options='$waitforsilence_options',agent_select_territories='$agent_select_territories',crm_popup_login='$crm_popup_login',crm_login_address='" . mysql_real_escape_string($crm_login_address) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',use_custom_cid='$use_custom_cid',scheduled_callbacks_alert='$scheduled_callbacks_alert',queuemetrics_callstatus_override='$queuemetrics_callstatus',extension_appended_cidname='$extension_appended_cidname',scheduled_callbacks_count='$scheduled_callbacks_count',manual_dial_override='$manual_dial_override',blind_monitor_warning='$blind_monitor_warning',blind_monitor_message='" . mysql_real_escape_string($blind_monitor_message) . "',blind_monitor_filename='$blind_monitor_filename',inbound_queue_no_dial='$inbound_queue_no_dial',timer_action_destination='$timer_action_destination',enable_xfer_presets='$enable_xfer_presets',hide_xfer_number_to_dial='$hide_xfer_number_to_dial',manual_dial_prefix='$manual_dial_prefix',customer_3way_hangup_logging='$customer_3way_hangup_logging',customer_3way_hangup_seconds='$customer_3way_hangup_seconds',customer_3way_hangup_action='$customer_3way_hangup_action',ivr_park_call='$ivr_park_call',ivr_park_call_agi='$ivr_park_call_agi',manual_preview_dial='$manual_preview_dial',realtime_agent_time_stats='$realtime_agent_time_stats',api_manual_dial='$api_manual_dial',manual_dial_call_time_check='$manual_dial_call_time_check',lead_order_randomize='$lead_order_randomize',lead_order_secondary='$lead_order_secondary',per_call_notes='$per_call_notes',my_callback_option='$my_callback_option',agent_lead_search='$agent_lead_search',agent_lead_search_method='$agent_lead_search_method',queuemetrics_phone_environment='$queuemetrics_phone_environment',auto_pause_precall='$auto_pause_precall',auto_resume_precall='$auto_resume_precall',auto_pause_precall_code='$auto_pause_precall_code',manual_dial_cid='$manual_dial_cid',post_phone_time_diff_alert='$post_phone_time_diff_alert',custom_3way_button_transfer='$custom_3way_button_transfer',available_only_tally_threshold='$available_only_tally_threshold',available_only_tally_threshold_agents='$available_only_tally_threshold_agents',dial_level_threshold='$dial_level_threshold',dial_level_threshold_agents='$dial_level_threshold_agents',safe_harbor_audio='$safe_harbor_audio',safe_harbor_menu_id='$safe_harbor_menu_id',callback_days_limit='$callback_days_limit',dl_diff_target_method='$dl_diff_target_method',disable_dispo_screen='$disable_dispo_screen',disable_dispo_status='$disable_dispo_status',screen_labels='$screen_labels',status_display_fields='$status_display_fields',na_call_url='" . mysql_real_escape_string($na_call_url) . "',pllb_grouping='$pllb_grouping',pllb_grouping_limit='$pllb_grouping_limit',call_count_limit='$call_count_limit',call_count_target='$call_count_target',callback_hours_block='$callback_hours_block',callback_list_calltime='$callback_list_calltime',user_group='$user_group' where campaign_id='$campaign_id';"; + $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', auto_trim_hopper='$auto_trim_hopper', use_auto_hopper='$use_auto_hopper', auto_hopper_multi='$auto_hopper_multi', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns=$closer_campaignsSQL,use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_refresh='$campaign_stats_refresh',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count',manual_dial_filter='$manual_dial_filter',agent_clipboard_copy='$agent_clipboard_copy',agent_extended_alt_dial='$agent_extended_alt_dial',use_campaign_dnc='$use_campaign_dnc',three_way_call_cid='$three_way_call_cid',three_way_dial_prefix='$three_way_dial_prefix',web_form_target='$web_form_target',vtiger_search_category='$vtiger_search_category',vtiger_create_call_record='$vtiger_create_call_record',vtiger_create_lead_record='$vtiger_create_lead_record',vtiger_screen_login='$vtiger_screen_login',cpd_amd_action='$cpd_amd_action',agent_allow_group_alias='$agent_allow_group_alias',default_group_alias='$default_group_alias',vtiger_search_dead='$vtiger_search_dead',vtiger_status_call='$vtiger_status_call',drop_lockout_time='$drop_lockout_time',quick_transfer_button='$quick_transfer_button',prepopulate_transfer_preset='$prepopulate_transfer_preset',drop_rate_group='$drop_rate_group',view_calls_in_queue='$view_calls_in_queue',view_calls_in_queue_launch='$view_calls_in_queue_launch',grab_calls_in_queue='$grab_calls_in_queue',call_requeue_button='$call_requeue_button',pause_after_each_call='$pause_after_each_call',no_hopper_dialing='$no_hopper_dialing',agent_dial_owner_only='$agent_dial_owner_only',agent_display_dialable_leads='$agent_display_dialable_leads',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',waitforsilence_options='$waitforsilence_options',agent_select_territories='$agent_select_territories',crm_popup_login='$crm_popup_login',crm_login_address='" . mysql_real_escape_string($crm_login_address) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',use_custom_cid='$use_custom_cid',scheduled_callbacks_alert='$scheduled_callbacks_alert',queuemetrics_callstatus_override='$queuemetrics_callstatus',extension_appended_cidname='$extension_appended_cidname',scheduled_callbacks_count='$scheduled_callbacks_count',manual_dial_override='$manual_dial_override',blind_monitor_warning='$blind_monitor_warning',blind_monitor_message='" . mysql_real_escape_string($blind_monitor_message) . "',blind_monitor_filename='$blind_monitor_filename',inbound_queue_no_dial='$inbound_queue_no_dial',timer_action_destination='$timer_action_destination',enable_xfer_presets='$enable_xfer_presets',hide_xfer_number_to_dial='$hide_xfer_number_to_dial',manual_dial_prefix='$manual_dial_prefix',customer_3way_hangup_logging='$customer_3way_hangup_logging',customer_3way_hangup_seconds='$customer_3way_hangup_seconds',customer_3way_hangup_action='$customer_3way_hangup_action',ivr_park_call='$ivr_park_call',ivr_park_call_agi='$ivr_park_call_agi',manual_preview_dial='$manual_preview_dial',realtime_agent_time_stats='$realtime_agent_time_stats',api_manual_dial='$api_manual_dial',manual_dial_call_time_check='$manual_dial_call_time_check',lead_order_randomize='$lead_order_randomize',lead_order_secondary='$lead_order_secondary',per_call_notes='$per_call_notes',my_callback_option='$my_callback_option',agent_lead_search='$agent_lead_search',agent_lead_search_method='$agent_lead_search_method',queuemetrics_phone_environment='$queuemetrics_phone_environment',auto_pause_precall='$auto_pause_precall',auto_resume_precall='$auto_resume_precall',auto_pause_precall_code='$auto_pause_precall_code',manual_dial_cid='$manual_dial_cid',post_phone_time_diff_alert='$post_phone_time_diff_alert',custom_3way_button_transfer='$custom_3way_button_transfer',available_only_tally_threshold='$available_only_tally_threshold',available_only_tally_threshold_agents='$available_only_tally_threshold_agents',dial_level_threshold='$dial_level_threshold',dial_level_threshold_agents='$dial_level_threshold_agents',safe_harbor_audio='$safe_harbor_audio',safe_harbor_menu_id='$safe_harbor_menu_id',callback_days_limit='$callback_days_limit',dl_diff_target_method='$dl_diff_target_method',disable_dispo_screen='$disable_dispo_screen',disable_dispo_status='$disable_dispo_status',screen_labels='$screen_labels',status_display_fields='$status_display_fields',na_call_url='" . mysql_real_escape_string($na_call_url) . "',pllb_grouping='$pllb_grouping',pllb_grouping_limit='$pllb_grouping_limit',call_count_limit='$call_count_limit',call_count_target='$call_count_target',callback_hours_block='$callback_hours_block',callback_list_calltime='$callback_list_calltime',user_group='$user_group',hopper_vlc_dup_check='$hopper_vlc_dup_check' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmtA, $link); if ($reset_hopper == 'Y') @@ -20303,7 +20312,7 @@ if ($ADD==31) $enable_vtiger_integration_LU = $row[0]; $vtiger_url_LU = $row[1]; - $stmt="SELECT campaign_id,campaign_name,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_third_audio_file,survey_third_status,survey_third_exten,survey_fourth_digit,survey_fourth_audio_file,survey_fourth_status,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,campaign_calldate,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats,use_auto_hopper,auto_hopper_multi,auto_trim_hopper,api_manual_dial,manual_dial_call_time_check,display_leads_count,lead_order_randomize,lead_order_secondary,per_call_notes,my_callback_option,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment,auto_pause_precall,auto_resume_precall,auto_pause_precall_code,manual_dial_cid,post_phone_time_diff_alert,custom_3way_button_transfer,available_only_tally_threshold,available_only_tally_threshold_agents,dial_level_threshold,dial_level_threshold_agents,safe_harbor_audio,safe_harbor_menu_id,survey_menu_id,callback_days_limit,dl_diff_target_method,disable_dispo_screen,disable_dispo_status,screen_labels,status_display_fields,na_call_url,survey_recording,pllb_grouping,pllb_grouping_limit,call_count_limit,call_count_target,callback_hours_block,callback_list_calltime,user_group from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; + $stmt="SELECT campaign_id,campaign_name,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_third_audio_file,survey_third_status,survey_third_exten,survey_fourth_digit,survey_fourth_audio_file,survey_fourth_status,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,campaign_calldate,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats,use_auto_hopper,auto_hopper_multi,auto_trim_hopper,api_manual_dial,manual_dial_call_time_check,display_leads_count,lead_order_randomize,lead_order_secondary,per_call_notes,my_callback_option,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment,auto_pause_precall,auto_resume_precall,auto_pause_precall_code,manual_dial_cid,post_phone_time_diff_alert,custom_3way_button_transfer,available_only_tally_threshold,available_only_tally_threshold_agents,dial_level_threshold,dial_level_threshold_agents,safe_harbor_audio,safe_harbor_menu_id,survey_menu_id,callback_days_limit,dl_diff_target_method,disable_dispo_screen,disable_dispo_status,screen_labels,status_display_fields,na_call_url,survey_recording,pllb_grouping,pllb_grouping_limit,call_count_limit,call_count_target,callback_hours_block,callback_list_calltime,user_group,hopper_vlc_dup_check from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $campaign_name = $row[1]; @@ -20507,6 +20516,7 @@ if ($ADD==31) $callback_hours_block = $row[201]; $callback_list_calltime = $row[202]; $user_group = $row[203]; + $hopper_vlc_dup_check = $row[204]; if (ereg("DISABLED",$list_order_mix)) {$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;} @@ -21018,6 +21028,8 @@ if ($ADD==31) echo "Auto Trim Hopper: $NWB#vicidial_campaigns-auto_trim_hopper$NWE\n"; + echo "Hopper VLC Dup Check: $NWB#vicidial_campaigns-hopper_vlc_dup_check$NWE\n"; + echo "Force Reset of Hopper: $NWB#vicidial_campaigns-force_reset_hopper$NWE\n"; echo "Dial Method: $NWB#vicidial_campaigns-dial_method$NWE\n"; @@ -24428,6 +24440,7 @@ if ($ADD==311) if ($SSuser_territories_active > 0) { ### if territories are active in the system then allow for selected-territory called-since-last-reset resetting + echo "\n"; echo "
\n"; echo "\n"; echo "\n"; @@ -26795,9 +26808,14 @@ if ($ADD==31111) echo "Campaign: $NWB#vicidial_remote_agents-campaign_id$NWE\n"; echo "On-Hook Agent: $NWB#vicidial_remote_agents-on_hook_agent$NWE\n"; echo "On-Hook Ring Time: $NWB#vicidial_remote_agents-on_hook_ring_time$NWE\n"; - echo "$NWB#vicidial_remote_agents-campaign_id$NWE\n"; + + echo "\n"; + horizontal_bar_chart($user_start,'8','remote-agent',$link,'ra_total_calls','call count',1); + echo "\n"; + echo "Inbound Groups: \n"; echo "$groups_list"; echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE\n"; @@ -32929,6 +32947,22 @@ if ($ADD==999993) else {echo "Not found"; exit;} } + elseif ($stage == 'remote-agent') + { + $remote_agent_id=''; + $stmt="SELECT remote_agent_id from vicidial_remote_agents where user_start='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $rows_to_print = mysql_num_rows($rslt); + if ($rows_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $remote_agent_id = $rowx[0]; + } + else + {echo "Not found"; exit;} + $modify_link = ""; + $campaign_name=$campaign_id; + } else { $in_out = 'campaign'; @@ -32949,17 +32983,30 @@ if ($ADD==999993) echo "
Administration: Maximum Stats Detail for $stage $modify_link$campaign_id
- $campaign_name   $NWB#vicidial_max_stats$NWE

\n"; echo "
\n"; - echo "\n"; + if ($stage == 'remote-agent') + { + echo "\n"; - echo "\n"; + echo "\n"; + } + else + { + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + } } else {echo "You do not have permission to view this page";} diff --git a/agc_2-X/trunk/www/vicidial/functions.php b/agc_2-X/trunk/www/vicidial/functions.php index 25c8af0b..1dd9464c 100644 --- a/agc_2-X/trunk/www/vicidial/functions.php +++ b/agc_2-X/trunk/www/vicidial/functions.php @@ -12,6 +12,7 @@ # 110708-1723 - Added HF precision option # 111222-2124 - Added max stats bar chart function # 120125-1235 - Small changes to max stats function to allow for total system stats +# 120213-1417 - Changes to allow for ra stats # ##### reformat seconds into HH:MM:SS or MM:SS ##### @@ -119,6 +120,10 @@ function horizontal_bar_chart($campaign_id,$days_graph,$title,$link,$metric,$met {$stmt="SELECT stats_date,sum(total_calls) from vicidial_daily_max_stats where stats_type='INGROUP' and stats_flag='OPEN' group by stats_date;";} if ($metric=='total_calls_outbound_all') {$stmt="SELECT stats_date,sum(total_calls) from vicidial_daily_max_stats where stats_type='CAMPAIGN' and stats_flag='OPEN' group by stats_date;";} + if ($metric=='ra_total_calls') + {$stmt="SELECT stats_date,total_calls from vicidial_daily_ra_stats where stats_flag='OPEN' and user='$campaign_id';";} + if ($metric=='ra_concurrent_calls') + {$stmt="SELECT stats_date,max_calls from vicidial_daily_ra_stats where stats_flag='OPEN' and user='$campaign_id';";} $rslt=mysql_query($stmt, $link); $Xstats_to_print = mysql_num_rows($rslt); if ($Xstats_to_print > 0) @@ -141,6 +146,10 @@ function horizontal_bar_chart($campaign_id,$days_graph,$title,$link,$metric,$met {$stmt="SELECT stats_date,sum(total_calls) from vicidial_daily_max_stats where stats_date='$Bstats_date[$i]' and stats_type='INGROUP' group by stats_date;";} if ($metric=='total_calls_outbound_all') {$stmt="SELECT stats_date,sum(total_calls) from vicidial_daily_max_stats where stats_date='$Bstats_date[$i]' and stats_type='CAMPAIGN' group by stats_date;";} + if ($metric=='ra_total_calls') + {$stmt="SELECT stats_date,total_calls from vicidial_daily_ra_stats where stats_date='$Bstats_date[$i]' and user='$campaign_id';";} + if ($metric=='ra_concurrent_calls') + {$stmt="SELECT stats_date,max_calls from vicidial_daily_ra_stats where stats_date='$Bstats_date[$i]' and user='$campaign_id';";} $rslt=mysql_query($stmt, $link); $Ystats_to_print = mysql_num_rows($rslt); if ($Ystats_to_print > 0) diff --git a/agc_2-X/trunk/www/vicidial/non_agent_api.php b/agc_2-X/trunk/www/vicidial/non_agent_api.php index 610fdedf..c081c09d 100644 --- a/agc_2-X/trunk/www/vicidial/non_agent_api.php +++ b/agc_2-X/trunk/www/vicidial/non_agent_api.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # This script is designed as an API(Application Programming Interface) to allow # other programs to interact with all non-agent-screen VICIDIAL functions @@ -61,10 +61,13 @@ # 110928-2110 - Added callback options to add_lead and update_lead # 111106-0959 - Added user_group restrictions to some functions # 120127-1331 - Small fix for plus replacement in custom fields strings for add/update_lead functions +# 120210-1215 - Small change for hopper adding vendor_lead_code +# 120213-1613 - Added optional logging of all non-admin.php requests, enabled in options.php # -$version = '2.4-40'; -$build = '120127-1331'; +$version = '2.4-42'; +$build = '120213-1613'; +$api_url_log = 0; $startMS = microtime(); @@ -1314,6 +1317,162 @@ if ($function == 'agent_ingroup_info') +################################################################################ +### blind_monitor - sends call to phone from session from listening +################################################################################ +if ($function == 'blind_monitor') + { + if(strlen($source)<2) + { + $result = 'ERROR'; + $result_reason = "Invalid Source"; + echo "$result: $result_reason - $source\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + echo "ERROR: Invalid Source: |$source|\n"; + exit; + } + else + { + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and vdc_agent_api_access='1' and user_level > 6;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $allowed_user=$row[0]; + if ( ($allowed_user < 1) and ($source != 'queuemetrics') ) + { + $result = 'ERROR'; + $result_reason = "blind_monitor USER DOES NOT HAVE PERMISSION TO BLIND MONITOR"; + echo "$result: $result_reason: |$user|$allowed_user|\n"; + $data = "$allowed_user"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + else + { + $stmt="SELECT count(*) from vicidial_conferences where conf_exten='$session_id' and server_ip='$server_ip';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $session_exists=$row[0]; + + if ($session_exists < 1) + { + $result = 'ERROR'; + $result_reason = "blind_monitor INVALID SESSION ID"; + echo "$result: $result_reason - $session_id|$server_ip|$user\n"; + $data = "$session_id"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + else + { + $stmt="SELECT count(*) from phones where login='$phone_login';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $phone_exists=$row[0]; + + if ( ($phone_exists < 1) and ($source != 'queuemetrics') ) + { + $result = 'ERROR'; + $result_reason = "blind_monitor INVALID PHONE LOGIN"; + echo "$result: $result_reason - $phone_login|$user\n"; + $data = "$phone_login"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + else + { + if ($source == 'queuemetrics') + { + $stmt="SELECT active_voicemail_server from system_settings;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $monitor_server_ip = $row[0]; + $dialplan_number = $phone_login; + $outbound_cid = ''; + if (strlen($monitor_server_ip)<7) + {$monitor_server_ip = $server_ip;} + } + else + { + $stmt="SELECT dialplan_number,server_ip,outbound_cid from phones where login='$phone_login';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $dialplan_number = $row[0]; + $monitor_server_ip =$row[1]; + $outbound_cid = $row[2]; + } + + $S='*'; + $D_s_ip = explode('.', $server_ip); + if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} + if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} + if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} + if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} + if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} + if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} + if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} + if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} + $monitor_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S"; + + $PADuser = sprintf("%08s", $user); + while (strlen($PADuser) > 8) {$PADuser = substr("$PADuser", 0, -1);} + $BMquery = "BM$StarTtime$PADuser"; + + if ( (ereg('MONITOR',$stage)) or (strlen($stage)<1) ) {$stage = '0';} + if (ereg('BARGE',$stage)) {$stage = '';} + if (ereg('HIJACK',$stage)) {$stage = '';} + + ### insert a new lead in the system with this phone number + $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$monitor_server_ip','','Originate','$BMquery','Channel: Local/$monitor_dialstring$stage$session_id@default','Context; default','Exten: $dialplan_number','Priority: 1','Callerid: \"VC Blind Monitor\" <$outbound_cid>','','','','','');"; + if ($DB>0) {echo "DEBUG: blind_monitor query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($affected_rows > 0) + { + $man_id = mysql_insert_id($link); + + $result = 'SUCCESS'; + $result_reason = "blind_monitor HAS BEEN LAUNCHED"; + echo "$result: $result_reason - $phone_login|$monitor_dialstring$stage$session_id|$dialplan_number|$session_id|$man_id|$user\n"; + $data = "$phone_login|$monitor_dialstring|$session_id|$man_id"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + } + } + } + } + exit; + } +################################################################################ +### END blind_monitor +################################################################################ + + + +### BEGIN optional logging to vicidial_url_log for non-interface URL calls ### +if (file_exists('options.php')) + { + require('options.php'); + } + +if ($api_url_log > 0) + { + $ip = getenv("REMOTE_ADDR"); + $REQUEST_URI = getenv("REQUEST_URI"); + $POST_URI = ''; + foreach($_POST as $key=>$value) + {$POST_URI .= '&'.$key.'='.$value;} + $REQUEST_URI = ereg_replace("'|\"|\\\\|;","",$REQUEST_URI); + $POST_URI = ereg_replace("'|\"|\\\\|;","",$POST_URI); + $NOW_DATE = date("Y-m-d"); + $NOW_TIME = date("Y-m-d H:i:s"); + $stmt="INSERT INTO vicidial_url_log set uniqueid='$NOW_DATE',url_date='$NOW_TIME',url_type='non-agent',url='$REQUEST_URI$POST_URI',url_response='$ip';"; + $rslt=mysql_query($stmt, $link); + } +### END optional logging to vicidial_url_log for non-interface URL calls ### + + + + ################################################################################ ### add_user - adds user to the vicidial_users table ################################################################################ @@ -3261,139 +3420,6 @@ if ($function == 'did_log_export') -################################################################################ -### blind_monitor - sends call to phone from session from listening -################################################################################ -if ($function == 'blind_monitor') - { - if(strlen($source)<2) - { - $result = 'ERROR'; - $result_reason = "Invalid Source"; - echo "$result: $result_reason - $source\n"; - api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); - echo "ERROR: Invalid Source: |$source|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and vdc_agent_api_access='1' and user_level > 6;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $allowed_user=$row[0]; - if ( ($allowed_user < 1) and ($source != 'queuemetrics') ) - { - $result = 'ERROR'; - $result_reason = "blind_monitor USER DOES NOT HAVE PERMISSION TO BLIND MONITOR"; - echo "$result: $result_reason: |$user|$allowed_user|\n"; - $data = "$allowed_user"; - api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); - exit; - } - else - { - $stmt="SELECT count(*) from vicidial_conferences where conf_exten='$session_id' and server_ip='$server_ip';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $session_exists=$row[0]; - - if ($session_exists < 1) - { - $result = 'ERROR'; - $result_reason = "blind_monitor INVALID SESSION ID"; - echo "$result: $result_reason - $session_id|$server_ip|$user\n"; - $data = "$session_id"; - api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); - exit; - } - else - { - $stmt="SELECT count(*) from phones where login='$phone_login';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $phone_exists=$row[0]; - - if ( ($phone_exists < 1) and ($source != 'queuemetrics') ) - { - $result = 'ERROR'; - $result_reason = "blind_monitor INVALID PHONE LOGIN"; - echo "$result: $result_reason - $phone_login|$user\n"; - $data = "$phone_login"; - api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); - exit; - } - else - { - if ($source == 'queuemetrics') - { - $stmt="SELECT active_voicemail_server from system_settings;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $monitor_server_ip = $row[0]; - $dialplan_number = $phone_login; - $outbound_cid = ''; - if (strlen($monitor_server_ip)<7) - {$monitor_server_ip = $server_ip;} - } - else - { - $stmt="SELECT dialplan_number,server_ip,outbound_cid from phones where login='$phone_login';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $dialplan_number = $row[0]; - $monitor_server_ip =$row[1]; - $outbound_cid = $row[2]; - } - - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $monitor_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S"; - - $PADuser = sprintf("%08s", $user); - while (strlen($PADuser) > 8) {$PADuser = substr("$PADuser", 0, -1);} - $BMquery = "BM$StarTtime$PADuser"; - - if ( (ereg('MONITOR',$stage)) or (strlen($stage)<1) ) {$stage = '0';} - if (ereg('BARGE',$stage)) {$stage = '';} - if (ereg('HIJACK',$stage)) {$stage = '';} - - ### insert a new lead in the system with this phone number - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$monitor_server_ip','','Originate','$BMquery','Channel: Local/$monitor_dialstring$stage$session_id@default','Context; default','Exten: $dialplan_number','Priority: 1','Callerid: \"VC Blind Monitor\" <$outbound_cid>','','','','','');"; - if ($DB>0) {echo "DEBUG: blind_monitor query - $stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - if ($affected_rows > 0) - { - $man_id = mysql_insert_id($link); - - $result = 'SUCCESS'; - $result_reason = "blind_monitor HAS BEEN LAUNCHED"; - echo "$result: $result_reason - $phone_login|$monitor_dialstring$stage$session_id|$dialplan_number|$session_id|$man_id|$user\n"; - $data = "$phone_login|$monitor_dialstring|$session_id|$man_id"; - api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); - } - } - } - } - } - exit; - } -################################################################################ -### END blind_monitor -################################################################################ - - - - - ################################################################################ ### add_lead - inserts a lead into the vicidial_list table ################################################################################ @@ -3978,7 +4004,7 @@ if ($function == 'add_lead') ### code to insert into hopper goes here ### insert record into vicidial_hopper for alt_phone call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$VD_campaign_id',status='READY',list_id='$list_id',gmt_offset_now='$gmt_offset',state='$state',user='',priority='$hopper_priority',source='P';"; + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$VD_campaign_id',status='READY',list_id='$list_id',gmt_offset_now='$gmt_offset',state='$state',user='',priority='$hopper_priority',source='P',vendor_lead_code='$vendor_lead_code';"; if ($DB>0) {echo "DEBUG: add_lead query - $stmt\n";} $rslt=mysql_query($stmt, $link); $Haffected_rows = mysql_affected_rows($link); diff --git a/agc_2-X/trunk/www/vicidial/options-example.php b/agc_2-X/trunk/www/vicidial/options-example.php index f19eb411..c32d51f7 100644 --- a/agc_2-X/trunk/www/vicidial/options-example.php +++ b/agc_2-X/trunk/www/vicidial/options-example.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2 # # rename this file to options.php for the settings here to go into effect # @@ -10,6 +10,7 @@ # 110307-1039 - Added upper-case/lower-case user setting # 110708-1730 - Added precision time setting # 120102-2112 - Added inventory_allow_realtime option +# 120213-1500 - Added option to log non-agent-API calls # # used by the realtime_report.php script @@ -59,5 +60,8 @@ $TIME_agenttimedetail = 'H'; # H=hour, M=minute, S=second, HF=force hour # used by inventory report $inventory_allow_realtime = 0; # allow real-time report generation for inventory report +# used by non-agent-API for non-admin functions +$api_url_log = 0; # log non-agent-api calls to the vicidial_url_log + ?>
\n"; - horizontal_bar_chart($campaign_id,'30',$in_out,$link,'total_calls','call count',0); - echo "
\n"; + horizontal_bar_chart($campaign_id,'30',$stage,$link,'ra_total_calls','call count',0); + echo "
\n"; - horizontal_bar_chart($campaign_id,'30',$in_out,$link,$max_type,'most concurrent calls',0); - echo "
\n"; + horizontal_bar_chart($campaign_id,'30',$stage,$link,'ra_concurrent_calls','most concurrent calls',0); + echo "
\n"; + horizontal_bar_chart($campaign_id,'30',$in_out,$link,'total_calls','call count',0); + echo "
\n"; - horizontal_bar_chart($campaign_id,'30',$in_out,$link,'max_agents','most concurrent agents',0); - echo "
\n"; + horizontal_bar_chart($campaign_id,'30',$in_out,$link,$max_type,'most concurrent calls',0); + echo "
\n"; + horizontal_bar_chart($campaign_id,'30',$in_out,$link,'max_agents','most concurrent agents',0); + echo "