diff --git a/AST_CRON_mix_recordings.pl b/AST_CRON_mix_recordings.pl index 1c7557b..f14198e 100644 --- a/AST_CRON_mix_recordings.pl +++ b/AST_CRON_mix_recordings.pl @@ -29,6 +29,7 @@ # # 51021-1058 Added quotes around CLI executed commands # 51122-1458 Added soxmix binary path check +# 60318-0921 Added ability to mix gsm audio files # @@ -77,14 +78,15 @@ foreach(@FILES) $size2 = (-s "$dir1/$FILES[$i]"); if ($v) {print "$FILES[$i] $size2\n\n";} - - if ( ($FILES[$i] !~ /out\.wav/i) && ($size1 eq $size2) && (length($FILES[$i]) > 4)) + if ( ($FILES[$i] !~ /out\.wav|out\.gsm/i) && ($size1 eq $size2) && (length($FILES[$i]) > 4)) { $INfile = $FILES[$i]; $OUTfile = $FILES[$i]; $OUTfile =~ s/-in\.wav/-out.wav/gi; + $OUTfile =~ s/-in\.gsm/-out.gsm/gi; $ALLfile = $FILES[$i]; $ALLfile =~ s/-in\.wav/-all.wav/gi; + $ALLfile =~ s/-in\.gsm/-all.gsm/gi; if ($v) {print "|$INfile| |$OUTfile| |$ALLfile|\n\n";} diff --git a/AST_CRON_mix_recordings_BASIC.pl b/AST_CRON_mix_recordings_BASIC.pl index 4786e67..87dce18 100644 --- a/AST_CRON_mix_recordings_BASIC.pl +++ b/AST_CRON_mix_recordings_BASIC.pl @@ -29,6 +29,7 @@ # # 51021-1058 Added quotes around CLI executed commands # 51122-1456 Added soxmix binary path check +# 60318-0921 Added ability to mix gsm audio files # @@ -69,13 +70,15 @@ foreach(@FILES) if ($v) {print "$FILES[$i] $size2\n\n";} - if ( ($FILES[$i] !~ /out\.wav/i) && ($size1 eq $size2) && (length($FILES[$i]) > 4)) + if ( ($FILES[$i] !~ /out\.wav|out\.gsm/i) && ($size1 eq $size2) && (length($FILES[$i]) > 4)) { $INfile = $FILES[$i]; $OUTfile = $FILES[$i]; $OUTfile =~ s/-in\.wav/-out.wav/gi; + $OUTfile =~ s/-in\.gsm/-out.gsm/gi; $ALLfile = $FILES[$i]; $ALLfile =~ s/-in\.wav/-all.wav/gi; + $ALLfile =~ s/-in\.gsm/-all.gsm/gi; if ($v) {print "|$INfile| |$OUTfile| |$ALLfile|\n\n";} diff --git a/AST_VDhopper.pl b/AST_VDhopper.pl index baa5b92..965ad5b 100644 --- a/AST_VDhopper.pl +++ b/AST_VDhopper.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# AST_VDhopper.pl version 0.4 +# AST_VDhopper.pl version 0.5 # # DESCRIPTION: # uses Net::MySQL to update the VICIDIAL leads hopper for the new streamlined @@ -29,6 +29,8 @@ # 60215-1106 - Added Scheduled Callback release functionality # 60228-1623 - Change Callback activation to set the called_since_last_reset=N # 60228-1735 - Added hopper gmt validation to remove gmt outside of time range +# 60320-0932 - Added inactive lead list hopper deletion (Thanks Vic Jolin) +# 60322-1030 - Added super debug output # # constants @@ -60,7 +62,7 @@ if (length($ARGV[0])>1) if ($args =~ /--help/i) { - print "allowed run time options(must stay in this order):\n [--debug] = debug\n [--dbgmt] = show GMT offset of records as they are inserted into hopper\n [-t] = test\n [--level=XXX] = force a hopper_level of XXX\n [--campaign=XXX] = run for campaign XXX only\n\n"; + print "allowed run time options(must stay in this order):\n [--debug] = debug\n [--debugX] = super debug\n [--dbgmt] = show GMT offset of records as they are inserted into hopper\n [-t] = test\n [--level=XXX] = force a hopper_level of XXX\n [--campaign=XXX] = run for campaign XXX only\n\n"; } else { @@ -85,7 +87,12 @@ if (length($ARGV[0])>1) if ($args =~ /--debug/i) { $DB=1; - print "\n-----DEBUG -----\n\n"; + print "\n----- DEBUG -----\n\n"; + } + if ($args =~ /--debugX/i) + { + $DBX=1; + print "\n----- SUPER DEBUG -----\n\n"; } if ($args =~ /--dbgmt/i) { @@ -131,7 +138,7 @@ if ($dbhA->has_selected_record) while ( $record = $iter->each) { $DBSERVER_GMT = "$record->[0]"; - if ($DBSERVER_GMT) {$SERVER_GMT = $DBSERVER_GMT;} + if (length($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;} } } @@ -168,6 +175,34 @@ if ($wipe_hopper_clean) exit; } +### Delete leads from inactive lists if there are any +$stmtA = "SELECT * FROM vicidial_lists where active='N';"; +if ($DB) {print $stmtA;} +$inactive_lists=''; +$inactive_lists_count=0; +$dbhA->query("$stmtA"); +if ($dbhA->has_selected_record) + { + $iter=$dbhA->create_record_iterator; + while ( $record = $iter->each) + { + $inactive_list = $record->[0]; + $inactive_lists .= "'$inactive_list',"; + $inactive_lists_count++; + } + } +if ($DB) {print "Inactive Lists: $inactive_lists_count\n";} + +if ($inactive_lists_count > 0) + { + chop($inactive_lists); + $stmtA = "DELETE from vicidial_hopper where list_id IN($inactive_lists);"; + $dbhA->query("$stmtA"); + my $affected_rows = $dbhA->get_affected_rows_length; + if ($DB) {print "Inactive List Leads Deleted: $affected_rows |$stmtA|\n";} + $event_string = "|INACTIVE LIST DEL|$affected_rows|"; + &event_logger; + } ### BEGIN Change CBHOLD status leads to CALLBK if their vicidial_callbacks time has passed @@ -332,22 +367,26 @@ foreach(@campaign_id) $GMT_allowed .= "'99'"; - if ($DB) {print "Starting hopper run for $campaign_id[$i] campaign: GMT: $local_call_time[$1] $GMT_allowed HOPPER: $hopper_level[$i] \n";} + if ($DB) {print "Starting hopper run for $campaign_id[$i] campaign- GMT: $local_call_time[$1] $GMT_allowed HOPPER: $hopper_level[$i] \n";} ### Delete the DONE leads if there are any $stmtA = "DELETE from vicidial_hopper where campaign_id='$campaign_id[$i]' and status IN('DONE');"; $dbhA->query("$stmtA"); my $affected_rows = $dbhA->get_affected_rows_length; if ($DB) {print " hopper DONE cleared: $affected_rows\n";} + if ($DBX) {print " |$stmtA|\n";} ### Delete the leads that are out of GMT time range if there are any $stmtA = "DELETE from vicidial_hopper where campaign_id='$campaign_id[$i]' and gmt_offset_now NOT IN($GMT_allowed);"; $dbhA->query("$stmtA"); my $affected_rows = $dbhA->get_affected_rows_length; if ($DB) {print " hopper GMT BAD cleared: $affected_rows\n";} + if ($DBX) {print " |$stmtA|\n";} + ### Find out how many leads are in the hopper from a specific campaign $hopper_ready_count=0; - $dbhA->query("SELECT count(*) from vicidial_hopper where campaign_id='$campaign_id[$i]' and status='READY';"); + $stmtA = "SELECT count(*) from vicidial_hopper where campaign_id='$campaign_id[$i]' and status='READY';"; + $dbhA->query("$stmtA"); if ($dbhA->has_selected_record) { $iter=$dbhA->create_record_iterator; @@ -356,6 +395,7 @@ foreach(@campaign_id) { $hopper_ready_count = $record->[0]; if ($DB) {print " hopper READY count: $hopper_ready_count\n";} + if ($DBX) {print " |$stmtA|\n";} $rec_countA++; } } @@ -367,7 +407,8 @@ foreach(@campaign_id) { if ($DB) {print " hopper too low ($hopper_ready_count|$hopper_level[$i]) starting hopper dump\n";} - $dbhA->query("SELECT list_id FROM vicidial_lists where campaign_id='$campaign_id[$i]' and active='Y';"); + $stmtA = "SELECT list_id FROM vicidial_lists where campaign_id='$campaign_id[$i]' and active='Y';"; + $dbhA->query("$stmtA"); if ($dbhA->has_selected_record) { $iter=$dbhA->create_record_iterator; @@ -381,8 +422,10 @@ foreach(@campaign_id) chop($camp_lists); } if ($DB) {print " campaign lists count: $rec_countLISTS | $camp_lists\n";} + if ($DBX) {print " |$stmtA|\n";} - $dbhA->query("SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN('$dial_status_a[$i]','$dial_status_b[$i]','$dial_status_c[$i]','$dial_status_d[$i]','$dial_status_e[$i]') and list_id IN($camp_lists) and gmt_offset_now IN($GMT_allowed)"); + $stmtA = "SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN('$dial_status_a[$i]','$dial_status_b[$i]','$dial_status_c[$i]','$dial_status_d[$i]','$dial_status_e[$i]') and list_id IN($camp_lists) and gmt_offset_now IN($GMT_allowed);"; + $dbhA->query("$stmtA"); $campaign_leads_to_call=0; if ($dbhA->has_selected_record) { @@ -391,11 +434,13 @@ foreach(@campaign_id) { $campaign_leads_to_call = "$record->[0]"; if ($DB) {print " leads to call count: $campaign_leads_to_call\n";} + if ($DBX) {print " |$stmtA|\n";} } } if ( ($lead_order[$i] eq "DOWN COUNT 2nd NEW") or ($lead_order[$i] eq "DOWN COUNT 3rd NEW") or ($lead_order[$i] eq "DOWN COUNT 4th NEW") ) { - $dbhA->query("SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN('NEW') and list_id IN($camp_lists) and gmt_offset_now IN($GMT_allowed)"); + $stmtA = "SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN('NEW') and list_id IN($camp_lists) and gmt_offset_now IN($GMT_allowed);"; + $dbhA->query("$stmtA"); $NEW_campaign_leads_to_call=0; if ($dbhA->has_selected_record) { @@ -404,6 +449,7 @@ foreach(@campaign_id) { $NEW_campaign_leads_to_call = "$record->[0]"; if ($DB) {print " NEW leads to call count: $NEW_campaign_leads_to_call\n";} + if ($DBX) {print " |$stmtA|\n";} } } } @@ -423,7 +469,10 @@ foreach(@campaign_id) else { if ($DB) {print " Getting Leads to add to hopper\n";} - $dbhA->query("SELECT lead_id FROM vicidial_hopper where campaign_id='$campaign_id[$i]';"); + ### grab leads already in hopper so we don't duplicate + $stmtA = "SELECT lead_id FROM vicidial_hopper where campaign_id='$campaign_id[$i]';"; + if ($DBX) {print " |$stmtA|\n";} + $dbhA->query("$stmtA"); $rec_countLISTS=0; $lead_id_lists = ''; if ($dbhA->has_selected_record) @@ -461,7 +510,7 @@ foreach(@campaign_id) if ($DB) {print " looking for $NEW_level NEW leads mixed in with $OTHER_level other leads\n";} $stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state FROM vicidial_list where called_since_last_reset='N' and status IN('NEW') and list_id IN($camp_lists) and lead_id NOT IN($lead_id_lists) and gmt_offset_now IN($GMT_allowed) $order_stmt limit $NEW_level;"; - # if ($DB) {print " STMT |$stmtA|\n";} + if ($DBX) {print " |$stmtA|\n";} $dbhA->query("$stmtA"); if ($dbhA->has_selected_record) { @@ -487,7 +536,7 @@ foreach(@campaign_id) if ($DB) {print " lead call order: $order_stmt\n";} $stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state FROM vicidial_list where called_since_last_reset='N' and status IN('$dial_status_a[$i]','$dial_status_b[$i]','$dial_status_c[$i]','$dial_status_d[$i]','$dial_status_e[$i]') and list_id IN($camp_lists) and lead_id NOT IN($lead_id_lists) and gmt_offset_now IN($GMT_allowed) $order_stmt limit $OTHER_level;"; - # if ($DB) {print " STMT |$stmtA|\n";} + if ($DBX) {print " |$stmtA|\n";} $dbhA->query("$stmtA"); if ($dbhA->has_selected_record) { diff --git a/AST_manager_listen.pl b/AST_manager_listen.pl index 2a8945c..6d407cb 100644 --- a/AST_manager_listen.pl +++ b/AST_manager_listen.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# AST_manager_listen.pl version 1.1.9 build 51222-1553 +# AST_manager_listen.pl version 1.1.11 build 60403-1230 # # Part of the Asterisk Central Queue System (ACQS) # @@ -39,6 +39,7 @@ # 50824-1606 Altered CVS/1.2 support for different output # 50901-2359 Another CVS/1.2 output parsing fix # 51222-1553 fixed parentheses bug in manager output +# 60403-1230 Added SVN/1.2.6 support for different output # # constants @@ -257,7 +258,7 @@ while($one_day_interval > 0) if ($input_lines[$ILcount] =~ /Event: Hangup/) { - if ( ($command_line[2] =~ /^Channel: /i) && ($command_line[3] =~ /^Uniqueid: /i) ) ### post 2005-08-07 CVS + if ( ($command_line[2] =~ /^Channel: /i) && ($command_line[3] =~ /^Uniqueid: /i) ) ### post 2005-08-07 CVS -- added Privilege line { $channel = $command_line[2]; $channel =~ s/Channel: |\s*$//gi; @@ -272,16 +273,32 @@ while($one_day_interval > 0) } else { - $channel = $command_line[1]; - $channel =~ s/Channel: |\s*$//gi; - $uniqueid = $command_line[2]; - $uniqueid =~ s/Uniqueid: |\s*$//gi; - $stmtA = "UPDATE vicidial_manager set status='DEAD', channel='$channel' where server_ip = '$server_ip' and uniqueid = '$uniqueid'"; + if ( ($command_line[3] =~ /^Channel: /i) && ($command_line[4] =~ /^Uniqueid: /i) ) ### post 2006-03-20 SVN -- Added Timestamp line + { + $channel = $command_line[3]; + $channel =~ s/Channel: |\s*$//gi; + $uniqueid = $command_line[4]; + $uniqueid =~ s/Uniqueid: |\s*$//gi; + $stmtA = "UPDATE vicidial_manager set status='DEAD', channel='$channel' where server_ip = '$server_ip' and uniqueid = '$uniqueid'"; - print STDERR "|$stmtA|\n"; - $dbhA->query("$stmtA"); - my $affected_rows = $dbhA->get_affected_rows_length; - if($DB){print "|$affected_rows HANGUPS updated|\n";} + print STDERR "|$stmtA|\n"; + $dbhA->query("$stmtA"); + my $affected_rows = $dbhA->get_affected_rows_length; + if($DB){print "|$affected_rows HANGUPS updated|\n";} + } + else + { + $channel = $command_line[1]; + $channel =~ s/Channel: |\s*$//gi; + $uniqueid = $command_line[2]; + $uniqueid =~ s/Uniqueid: |\s*$//gi; + $stmtA = "UPDATE vicidial_manager set status='DEAD', channel='$channel' where server_ip = '$server_ip' and uniqueid = '$uniqueid'"; + + print STDERR "|$stmtA|\n"; + $dbhA->query("$stmtA"); + my $affected_rows = $dbhA->get_affected_rows_length; + if($DB){print "|$affected_rows HANGUPS updated|\n";} + } } } @@ -332,6 +349,21 @@ while($one_day_interval > 0) my $affected_rows = $dbhA->get_affected_rows_length; if($DB){print "|$affected_rows DIALINGs updated|\n";} } + if ( ($command_line[3] =~ /^Channel: /i) && ($command_line[6] =~ /^CalleridName: /i) ) ### post 2006-03-20 -- Added Timestamp line + { + $channel = $command_line[3]; + $channel =~ s/Channel: |\s*$//gi; + $callid = $command_line[6]; + $callid =~ s/CalleridName: |\s*$//gi; + $callid =~ s/^\"//gi; $callid =~ s/\".*$//gi; + $uniqueid = $command_line[7]; + $uniqueid =~ s/Uniqueid: |\s*$//gi; + $stmtA = "UPDATE vicidial_manager set status='SENT', channel='$channel', uniqueid = '$uniqueid' where server_ip = '$server_ip' and callerid = '$callid'"; + print STDERR "|$stmtA|\n"; + $dbhA->query("$stmtA"); + my $affected_rows = $dbhA->get_affected_rows_length; + if($DB){print "|$affected_rows DIALINGs updated|\n";} + } } if ($input_lines[$ILcount] =~ /State: Ringing|State: Up/) { @@ -389,6 +421,24 @@ while($one_day_interval > 0) if($DB){print "|$affected_rows RINGINGs updated|\n";} } } + if ( ($command_line[3] =~ /^Channel: /i) && ($command_line[6] =~ /^CalleridName: /i) ) ### post 2006-03-20 SVN -- Added Timestamp line + { + $channel = $command_line[3]; + $channel =~ s/Channel: |\s*$//gi; + $callid = $command_line[6]; + $callid =~ s/CalleridName: |\s*$//gi; + $callid =~ s/^\"//gi; $callid =~ s/\".*$//gi; + $uniqueid = $command_line[7]; + $uniqueid =~ s/Uniqueid: |\s*$//gi; + $stmtA = "UPDATE vicidial_manager set status='UPDATED', channel='$channel', uniqueid = '$uniqueid' where server_ip = '$server_ip' and callerid = '$callid'"; + if ($channel !~ /local/i) + { + print STDERR "|$stmtA|\n"; + $dbhA->query("$stmtA"); + my $affected_rows = $dbhA->get_affected_rows_length; + if($DB){print "|$affected_rows RINGINGs updated|\n";} + } + } } if ($input_lines[$ILcount] =~ /Event: Newcallerid/) @@ -411,6 +461,24 @@ while($one_day_interval > 0) if($DB){print "|$affected_rows RINGINGs updated|\n";} } } + if ( ($command_line[3] =~ /^Channel: /i) && ($command_line[6] =~ /^Uniqueid: /i) ) ### post 2006-03-20 SVN -- Added Timestamp line + { + $channel = $command_line[3]; + $channel =~ s/Channel: |\s*$//gi; + $callid = $command_line[5]; + $callid =~ s/Callerid: |\s*$//gi; + $callid =~ s/^\"//gi; $callid =~ s/\".*$//gi; + $uniqueid = $command_line[6]; + $uniqueid =~ s/Uniqueid: |\s*$//gi; + $stmtA = "UPDATE vicidial_manager set status='UPDATED', channel='$channel', uniqueid = '$uniqueid' where server_ip = '$server_ip' and callerid = '$callid'"; + if ($channel =~ /local/i) + { + print STDERR "|$stmtA|\n"; + $dbhA->query("$stmtA"); + my $affected_rows = $dbhA->get_affected_rows_length; + if($DB){print "|$affected_rows RINGINGs updated|\n";} + } + } } } diff --git a/AST_update.pl b/AST_update.pl index 2ec731e..12f0a05 100644 --- a/AST_update.pl +++ b/AST_update.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# AST_update.pl version 1.1.9 (build 60117-1202) +# AST_update.pl version 1.1.11 (build 60411-1032) # # DESCRIPTION: # uses the Asterisk Manager interface and Net::MySQL to update the live_channels @@ -47,9 +47,10 @@ # 50829-1134 - Added processor percentage usage to stat collection # 51229-1355 - Added ability to take ! as delimited for 1.2 show channels concise # 60117-1202 - Changed IAX2 client phone channel to reflect change to '-' iteration +# 60411-1032 - Fixed bug in test section that caused crash with ** in extension # -$build = '60117-1202'; +$build = '60411-1032'; # constants $SYSPERF=0; # system performance logging to MySQL server_performance table every 5 seconds @@ -326,7 +327,17 @@ if (!$telnet_port) {$telnet_port = '5038';} } else { - @test_chan_12 = split(/:/, $test_channels[$s]); + $EXcount = 0; + $EXcount = @{[$test_channels[$s] =~ /\!/g]}; + if ($EXcount > 10) + { + @test_chan_12 = split(/\!/, $test_channels[$s]); + } + else + { + @test_chan_12 = split(/:/, $test_channels[$s]); + } + # @test_chan_12 = split(/:/, $test_channels[$s]); if (length($test_chan_12[6])<2) {$test_chan_12[6] = 'SIP/ring';} $test_channels[$s] = "$test_chan_12[0] $test_chan_12[6]"; } diff --git a/MySQL_AST_CREATE_tables.sql b/MySQL_AST_CREATE_tables.sql index 225cf93..5897764 100644 --- a/MySQL_AST_CREATE_tables.sql +++ b/MySQL_AST_CREATE_tables.sql @@ -234,7 +234,7 @@ status VARCHAR(6), user VARCHAR(20), vendor_lead_code VARCHAR(20), source_id VARCHAR(6), -list_id INT(8) UNSIGNED, +list_id BIGINT(14) UNSIGNED, gmt_offset_now DECIMAL(4,2) DEFAULT '0.00', called_since_last_reset ENUM('Y','N'), phone_code VARCHAR(10), @@ -271,7 +271,7 @@ lead_id INT(9) UNSIGNED NOT NULL, campaign_id VARCHAR(8), status ENUM('READY','QUEUE','INCALL','DONE') default 'READY', user VARCHAR(20), -list_id INT(9) UNSIGNED NOT NULL, +list_id BIGINT(14) UNSIGNED NOT NULL, gmt_offset_now DECIMAL(4,2) DEFAULT '0.00', index (lead_id) ); @@ -321,7 +321,7 @@ index (call_time) CREATE TABLE vicidial_log ( uniqueid DOUBLE(18,7) PRIMARY KEY UNIQUE NOT NULL, lead_id INT(9) UNSIGNED NOT NULL, -list_id INT(8) UNSIGNED, +list_id BIGINT(14) UNSIGNED, campaign_id VARCHAR(8), call_date DATETIME, start_epoch INT(10) UNSIGNED, @@ -340,7 +340,7 @@ index (call_date) CREATE TABLE vicidial_closer_log ( closecallid INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY UNIQUE NOT NULL, lead_id INT(9) UNSIGNED NOT NULL, -list_id INT(8) UNSIGNED, +list_id BIGINT(14) UNSIGNED, campaign_id VARCHAR(20), call_date DATETIME, start_epoch INT(10) UNSIGNED, @@ -359,7 +359,7 @@ index (call_date) CREATE TABLE vicidial_xfer_log ( xfercallid INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY UNIQUE NOT NULL, lead_id INT(9) UNSIGNED NOT NULL, -list_id INT(8) UNSIGNED, +list_id BIGINT(14) UNSIGNED, campaign_id VARCHAR(20), call_date DATETIME, phone_code VARCHAR(10), @@ -450,7 +450,7 @@ xferconf_b_number VARCHAR(50) ); CREATE TABLE vicidial_lists ( -list_id INT(8) UNSIGNED PRIMARY KEY UNIQUE NOT NULL, +list_id BIGINT(14) UNSIGNED PRIMARY KEY UNIQUE NOT NULL, list_name VARCHAR(30), campaign_id VARCHAR(8), active ENUM('Y','N') @@ -618,7 +618,7 @@ extensions_list TEXT CREATE TABLE vicidial_callbacks ( callback_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL, lead_id INT(9) UNSIGNED, -list_id INT(8) UNSIGNED, +list_id BIGINT(14) UNSIGNED, campaign_id VARCHAR(8), status VARCHAR(10), entry_time DATETIME, @@ -631,3 +631,17 @@ index (lead_id), index (status), index (callback_time) ); + + CREATE TABLE vicidial_list_pins ( +pins_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL, +entry_time DATETIME, +phone_number VARCHAR(10), +lead_id INT(9) UNSIGNED, +campaign_id VARCHAR(20), +product_code VARCHAR(20), +user VARCHAR(20), +digits VARCHAR(20), +index (lead_id), +index (phone_number), +index (entry_time) +); diff --git a/VICIDIAL_web/AST_server_performance.php b/VICIDIAL_web/AST_server_performance.php index 1a65284..12e5687 100644 --- a/VICIDIAL_web/AST_server_performance.php +++ b/VICIDIAL_web/AST_server_performance.php @@ -132,7 +132,7 @@ if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); $USEDram = sprintf("%10s", $row[0]); -$stmt="select count(*),SUM(length_in_min) from call_log where extension NOT IN('8365') and start_time <= '$query_date_END' and start_time >= '$query_date_BEGIN' and server_ip='$group';"; +$stmt="select count(*),SUM(length_in_min) from call_log where extension NOT IN('8365','8366','8367') and start_time <= '$query_date_END' and start_time >= '$query_date_BEGIN' and server_ip='$group';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); diff --git a/VICIDIAL_web/AST_timeonVDADall.php b/VICIDIAL_web/AST_timeonVDADall.php index 8edd342..734fda0 100644 --- a/VICIDIAL_web/AST_timeonVDADall.php +++ b/VICIDIAL_web/AST_timeonVDADall.php @@ -30,7 +30,7 @@ $STARTtime = date("U"); $epochSIXhoursAGO = ($STARTtime - 21600); $timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); -$stmt="select campaign_id from vicidial_campaigns;"; +$stmt="select campaign_id from vicidial_campaigns where active='Y';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); diff --git a/VICIDIAL_web/admin.php b/VICIDIAL_web/admin.php index 9afeb39..269da19 100644 --- a/VICIDIAL_web/admin.php +++ b/VICIDIAL_web/admin.php @@ -131,11 +131,14 @@ $agent_choose_ingroups=$_GET["agent_choose_ingroups"]; if (!$agent_choose_ingrou ### 60213-1100 - Added several vicidial_users permissions fields ### 60215-1319 - Added On-hold CallBacks display and links ### 60227-1226 - Fixed vicidial_inbound_groups insert bug +### 60413-1308 - Fixed list display to have 1 row/status: count and time zone tables +### - Added status name in selected dial statuses in campaign screen +### ### 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 -$version = '1.1.10-5'; -$build = '60227-1226'; +$version = '1.1.10-6'; +$build = '60413-1308'; $STARTtime = date("U"); @@ -2697,6 +2700,7 @@ echo "Dial status 1: $o) { $rowx=mysql_fetch_row($rsltx); $statuses_list .= "\n"; + $statname_list["$rowx[0]"] = "$rowx[1]"; if (eregi("Y",$rowx[2])) {$HKstatuses_list .= "\n";} $o++; @@ -2710,29 +2714,29 @@ echo "Dial status 1: $o) { $rowx=mysql_fetch_row($rsltx); $statuses_list .= "\n"; + $statname_list["$rowx[0]"] = "$rowx[1]"; if (eregi("Y",$rowx[2])) {$HKstatuses_list .= "\n";} $o++; } echo "$statuses_list"; -echo "\n"; +echo "\n"; echo "$NWB#vicidial_campaigns-dial_status$NWE\n"; - echo "Dial status 2: $NWB#vicidial_campaigns-dial_status$NWE\n"; echo "Dial status 3: $NWB#vicidial_campaigns-dial_status$NWE\n"; echo "Dial status 4: $NWB#vicidial_campaigns-dial_status$NWE\n"; echo "Dial status 5: $NWB#vicidial_campaigns-dial_status$NWE\n"; echo "List Order: $NWB#vicidial_campaigns-lead_order$NWE\n"; @@ -3068,6 +3072,7 @@ echo "Dial status 1: $o) { $rowx=mysql_fetch_row($rsltx); $statuses_list .= "\n"; + $statname_list["$rowx[0]"] = "$rowx[1]"; $o++; } @@ -3079,27 +3084,27 @@ echo "Dial status 1: $o) { $rowx=mysql_fetch_row($rsltx); $statuses_list .= "\n"; + $statname_list["$rowx[0]"] = "$rowx[1]"; $o++; } echo "$statuses_list"; -echo "\n"; +echo "\n"; echo "$NWB#vicidial_campaigns-dial_status$NWE\n"; - echo "Dial status 2: $NWB#vicidial_campaigns-dial_status$NWE\n"; echo "Dial status 3: $NWB#vicidial_campaigns-dial_status$NWE\n"; echo "Dial status 4: $NWB#vicidial_campaigns-dial_status$NWE\n"; echo "Dial status 5: $NWB#vicidial_campaigns-dial_status$NWE\n"; echo "List Order: $NWB#vicidial_campaigns-lead_order$NWE\n"; @@ -3277,6 +3282,31 @@ if ($ADD==311) $campaign_id = $row[2]; $active = $row[3]; + # grab names of global statuses and statuses in the selected campaign + $stmt="SELECT * from vicidial_statuses order by status"; + $rsltx=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rsltx); + + $o=0; + while ($statuses_to_print > $o) { + $rowx=mysql_fetch_row($rsltx); + $statuses_list["$rowx[0]"] = "$rowx[1]"; + $o++; + } + + $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; + $rsltx=mysql_query($stmt, $link); + $Cstatuses_to_print = mysql_num_rows($rsltx); + + $o=0; + while ($Cstatuses_to_print > $o) { + $rowx=mysql_fetch_row($rsltx); + $statuses_list["$rowx[0]"] = "$rowx[1]"; + $o++; + } + # end grab status names + + echo "
MODIFY A LISTS RECORD: $row[0]
\n"; echo "\n"; echo "\n"; @@ -3307,8 +3337,8 @@ echo "\n"; echo "
\n"; echo "
STATUSES WITHIN THIS LIST:
\n"; -echo "\n"; -echo "\n"; +echo "
STATUSCALLEDNOT CALLED
\n"; +echo "\n"; $leads_in_list = 0; $leads_in_list_N = 0; @@ -3318,17 +3348,44 @@ echo "\n"; $statuses_to_print = mysql_num_rows($rsltx); $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; while ($statuses_to_print > $o) { - $rowx=mysql_fetch_row($rsltx); - $leads_in_list = ($leads_in_list + $rowx[2]); + $rowx=mysql_fetch_row($rsltx); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = $rowx[2]; + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } + + $o=0; + while (list($dispo,) = each($lead_list[$since_reset])) + { if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - if ($rowx[0] == 'CBHOLD') + if ($dispo == 'CBHOLD') { $CLB=""; $CLE=""; @@ -3339,25 +3396,15 @@ echo "\n"; $CLE=''; } - if ($rowx[1] == 'N') - { - $leads_in_list_N = ($leads_in_list_N + $rowx[2]); - echo "\n"; - } - else - { - $leads_in_list_Y = ($leads_in_list_Y + $rowx[2]); - echo "\n"; - - } - - $o++; + echo "\n"; + $o++; } -echo "\n"; -echo "\n"; +echo "\n"; +echo "\n"; echo "
STATUSSTATUS NAMECALLEDNOT CALLED
STATUSCALLEDNOT CALLED
STATUSCALLEDNOT CALLED
$CLB$rowx[0]$CLE $rowx[2]
$CLB$rowx[0]$CLE$rowx[2]
$CLB$dispo$CLE$statuses_list[$dispo]".$lead_list['Y'][$dispo]."".$lead_list['N'][$dispo]."
SUBTOTALS$leads_in_list_Y$leads_in_list_N
TOTAL$leads_in_list
SUBTOTALS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; +unset($lead_list); @@ -3368,47 +3415,59 @@ echo "
TIME ZONES WITHIN THIS LIST:
\n"; echo "\n"; echo "\n"; - $leads_in_list = 0; - $leads_in_list_N = 0; - $leads_in_list_Y = 0; $stmt="SELECT gmt_offset_now,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by gmt_offset_now,called_since_last_reset order by gmt_offset_now,called_since_last_reset"; $rsltx=mysql_query($stmt, $link); $statuses_to_print = mysql_num_rows($rsltx); $o=0; $plus='+'; - while ($statuses_to_print > $o) { - $rowx=mysql_fetch_row($rsltx); - $leads_in_list = ($leads_in_list + $rowx[2]); + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = $rowx[2]; + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } - $LOCALzone=3600 * $rowx[0]; + while (list($tzone,) = each($lead_list[$since_reset])) + { + $LOCALzone=3600 * $tzone; $LOCALdate=gmdate("D M Y H:i", time() + $LOCALzone); - if ($rowx[0] >= 0) {$rowx[0] = "$plus$rowx[0]";} + if ($tzone >= 0) {$tzone = "$plus$tzone";} if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - if ($rowx[1] == 'N') - { - $leads_in_list_N = ($leads_in_list_N + $rowx[2]); - echo "\n"; - } - else - { - $leads_in_list_Y = ($leads_in_list_Y + $rowx[2]); - echo "\n"; - - } - - $o++; + echo "\n"; } -echo "\n"; -echo "\n"; +echo "\n"; +echo "\n"; echo "
GMT OFFSET NOW (local time)CALLEDNOT CALLED
$rowx[0]     ($LOCALdate) $rowx[2]
$rowx[0]     ($LOCALdate)$rowx[2]
".$tzone."     ($LOCALdate)".$lead_list['Y'][$tzone]."".$lead_list['N'][$tzone]."
SUBTOTALS$leads_in_list_Y$leads_in_list_N
TOTAL$leads_in_list
SUBTOTALS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; +unset($lead_list); @@ -3458,11 +3517,13 @@ echo "
\n"; echo "
\n"; echo "
CALLED COUNTS WITHIN THIS LIST:
\n"; echo "\n"; -echo ""; +echo ""; $first = $all_called_first; while ($first <= $all_called_last) { - echo ""; + if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#AFEEEE"';} + else{$AB='bgcolor="#E0FFFF"';} + echo ""; $first++; } echo "\n"; @@ -3471,13 +3532,14 @@ echo "\n"; $statuses_called_to_print = count($status); while ($statuses_called_to_print > $sts) { + $Pstatus = $status[$sts]; if (eregi("1$|3$|5$|7$|9$", $sts)) {$bgcolor='bgcolor="#B9CBFD"'; $AB='bgcolor="#9BB9FB"';} else {$bgcolor='bgcolor="#9BB9FB"'; $AB='bgcolor="#B9CBFD"';} # echo "$status[$sts]|$status_called_first[$sts]|$status_called_last[$sts]|$leads_in_sts[$sts]|\n"; # echo "$status[$sts]|"; - echo ""; + echo ""; $first = $all_called_first; while ($first <= $all_called_last) @@ -3497,7 +3559,7 @@ echo "\n"; $o=0; while ($status_called_to_print > $o) { - if ( ($count_statuses[$o] == "$status[$sts]") and ($count_called[$o] == "$first") ) + if ( ($count_statuses[$o] == "$Pstatus") and ($count_called[$o] == "$first") ) { $called_printed++; echo ""; @@ -3515,11 +3577,13 @@ echo "\n"; $sts++; } -echo ""; +echo ""; $first = $all_called_first; while ($first <= $all_called_last) { - echo ""; + if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#AFEEEE"';} + else{$AB='bgcolor="#E0FFFF"';} + echo ""; $first++; } echo "\n"; diff --git a/agc/call_log_display.php b/agc/call_log_display.php index e2a578a..fe0b4cc 100644 --- a/agc/call_log_display.php +++ b/agc/call_log_display.php @@ -25,6 +25,7 @@ # 50503-1236 added session_name checking for extra security # 50610-1158 Added NULL check on MySQL results to reduced errors # 50711-1202 removed HTTP authentication in favor of user/pass vars +# 60323-1550 added option for showing different number dialed in log # @@ -45,9 +46,11 @@ $protocol=$_GET["protocol"]; if (!$protocol) {$protocol=$_POST["protocol"];} if (!$format) {$format="text";} if (!$in_limit) {$in_limit="100";} if (!$out_limit) {$out_limit="100";} +$number_dialed = 'number_dialed'; +#$number_dialed = 'extension'; -$version = '0.0.5'; -$build = '50711-1202'; +$version = '0.0.6'; +$build = '60323-1550'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -114,7 +117,7 @@ echo " else { ##### print outbound calls from the call_log table - $stmt="SELECT uniqueid,start_time,number_dialed,length_in_sec FROM call_log where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\" order by start_time desc limit $out_limit;"; + $stmt="SELECT uniqueid,start_time,$number_dialed,length_in_sec FROM call_log where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\" order by start_time desc limit $out_limit;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$out_calls_count = mysql_num_rows($rslt);} @@ -134,6 +137,7 @@ echo " if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} $call_time_MS = "$call_time_M_int:$call_time_SEC"; + if ($number_dialed == 'extension') {$row[2] = substr($row[2],-10);} echo "$row[0] ~$row[1] ~$row[2] ~$call_time_MS|"; } echo "\n"; diff --git a/agc/conf_exten_check.php b/agc/conf_exten_check.php index 0735b92..d6b4397 100644 --- a/agc/conf_exten_check.php +++ b/agc/conf_exten_check.php @@ -28,6 +28,7 @@ # 50706-1525 Added date-time display for vicidial client display # 50816-1500 Added random update to vicidial_live_agents table for vdc users # 51121-1353 Altered echo statements for several small PHP speed optimizations +# 60410-1424 Added ability to grab calls-being-placed and agent status # require("dbconnect.php"); @@ -45,6 +46,7 @@ $client=$_GET["client"]; if (!$client) {$client=$_POST["client"];} $conf_exten=$_GET["conf_exten"]; if (!$conf_exten) {$conf_exten=$_POST["conf_exten"];} $exten=$_GET["exten"]; if (!$exten) {$exten=$_POST["exten"];} $auto_dial_level=$_GET["auto_dial_level"]; if (!$auto_dial_level) {$auto_dial_level=$_POST["auto_dial_level"];} +$campagentstdisp=$_GET["campagentstdisp"]; if (!$campagentstdisp) {$campagentstdisp=$_POST["campagentstdisp"];} # default optional vars if not set if (!$format) {$format="text";} @@ -132,9 +134,39 @@ echo " $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); + + + + if ($campagentstdisp == 'YES') + { + ### grab the status of this agent to display + $stmt="SELECT status,campaign_id from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $Astatus=$row[0]; + $Acampaign=$row[1]; + + ### grab the number of calls being placed from this server and campaign + $stmt="SELECT count(*) from vicidial_auto_calls where server_ip='$server_ip' and status NOT IN('XFER') and campaign_id='$Acampaign';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $RingCalls=$row[0]; + } + else + { + $Astatus='N'; + $RingCalls='N'; + } + } + else + { + $Astatus='N'; + $RingCalls='N'; } - echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . "|\n"; + echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Status: ' . $Astatus . '|CampCalls: ' . $RingCalls . "|\n"; } $total_conf=0; diff --git a/agc/vdc_db_query.php b/agc/vdc_db_query.php index 7fbc2fd..f68ef1c 100644 --- a/agc/vdc_db_query.php +++ b/agc/vdc_db_query.php @@ -13,7 +13,7 @@ ### - $pass ### optional variables: ### - $format - ('text','debug') -### - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs') +### - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT') ### - $stage - ('start','finish') ### - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') ### - $conf_exten - ('8600011',...) @@ -92,10 +92,13 @@ # 60208-1617 Added dtmf buttons output per call # 60213-1521 Added closer_campaigns update to vicidial_users # 60215-1036 Added Callback date-time entry into vicidial_callbacks table +# 60413-1541 Added USERONLY Callback listings output - CalLBacKLisT +# Added USERONLY Callback count output - CalLBacKCounT +# 60414-1140 Added Callback lead lookup for manual dialing # -$version = '0.0.26'; -$build = '60215-1036'; +$version = '0.0.28'; +$build = '60414-1140'; require("dbconnect.php"); @@ -161,6 +164,7 @@ $agent_log=$_GET["agent_log"]; if (!$agent_log) {$agent_log=$_POST["agent_log" $favorites_list=$_GET["favorites_list"]; if (!$favorites_list) {$favorites_list=$_POST["favorites_list"];} $CallBackDatETimE=$_GET["CallBackDatETimE"]; if (!$CallBackDatETimE) {$CallBackDatETimE=$_POST["CallBackDatETimE"];} $recipient=$_GET["recipient"]; if (!$recipient) {$recipient=$_POST["recipient"];} +$callback_id=$_GET["callback_id"]; if (!$callback_id) {$callback_id=$_POST["callback_id"];} # default optional vars if not set @@ -172,6 +176,7 @@ $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $CIDdate = date("mdHis"); +$ENTRYdate = date("YmdHis"); if (!$query_date) {$query_date = $NOW_DATE;} $MT[0]=''; @@ -287,14 +292,42 @@ if ($ACTION == 'manDiaLnextCaLL') } else { - ### grab the next lead in the hopper for this campaign and reserve it for the user - $stmt = "UPDATE vicidial_hopper set status='QUEUE', user='$user' where campaign_id='$campaign' and status='READY' order by hopper_id LIMIT 1"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); + ### check if this is a callback, if it is, skip the grabbing of a new lead and mark the callback as INACTIVE + if ( (strlen($callback_id)>0) && (strlen($lead_id)>0) ) + { + $affected_rows=1; + $CBleadIDset=1; + + $stmt = "UPDATE vicidial_callbacks set status='INACTIVE' where callback_id='$callback_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + } + else + { + if (strlen($phone_number)>3) + { + ### grab the next lead in the hopper for this campaign and reserve it for the user + $stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id(); + $CBleadIDset=1; + } + else + { + ### grab the next lead in the hopper for this campaign and reserve it for the user + $stmt = "UPDATE vicidial_hopper set status='QUEUE', user='$user' where campaign_id='$campaign' and status='READY' order by hopper_id LIMIT 1"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + } + } if ($affected_rows > 0) { + if (!$CBleadIDset) + { ##### grab the lead_id of the reserved user in vicidial_hopper $stmt="SELECT lead_id FROM vicidial_hopper where campaign_id='$campaign' and status='QUEUE' and user='$user' LIMIT 1;"; $rslt=mysql_query($stmt, $link); @@ -305,6 +338,7 @@ if ($ACTION == 'manDiaLnextCaLL') $row=mysql_fetch_row($rslt); $lead_id =$row[0]; } + } ##### grab the data from vicidial_list for the lead_id $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; @@ -350,10 +384,13 @@ if ($ACTION == 'manDiaLnextCaLL') if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - ### delete the lead from the hopper - $stmt = "DELETE FROM vicidial_hopper where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); + if (!$CBleadIDset) + { + ### delete the lead from the hopper + $stmt = "DELETE FROM vicidial_hopper where lead_id='$lead_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + } $stmt="UPDATE vicidial_agent_log set lead_id='$lead_id' where agent_log_id='$agent_log_id';"; if ($format=='debug') {echo "\n";} @@ -1274,6 +1311,59 @@ if ($ACTION == 'UpdatEFavoritEs') } +################################################################################ +### CalLBacKLisT - List the USERONLY callbacks for an agent +################################################################################ +if ($ACTION == 'CalLBacKLisT') +{ +$stmt = "select callback_id,lead_id,campaign_id,status,entry_time,callback_time,comments from vicidial_callbacks where recipient='USERONLY' and user='$user' and status NOT IN('INACTIVE','DEAD') order by callback_time;"; +if ($DB) {echo "$stmt\n";} +$rslt=mysql_query($stmt, $link); +if ($rslt) {$callbacks_count = mysql_num_rows($rslt);} +echo "$callbacks_count\n"; +$loop_count=0; + while ($callbacks_count>$loop_count) + { + $row=mysql_fetch_row($rslt); + $callback_id[$loop_count] = $row[0]; + $lead_id[$loop_count] = $row[1]; + $campaign_id[$loop_count] = $row[2]; + $status[$loop_count] = $row[3]; + $entry_time[$loop_count] = $row[4]; + $callback_time[$loop_count] = $row[5]; + $comments[$loop_count] = $row[6]; + $loop_count++; + } +$loop_count=0; + while ($callbacks_count>$loop_count) + { + $stmt = "select first_name,last_name,phone_number from vicidial_list where lead_id='$lead_id[$loop_count]';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + + echo "$row[0] ~$row[1] ~$row[2] ~$callback_id[$loop_count] ~$lead_id[$loop_count] ~$campaign_id[$loop_count] ~$status[$loop_count] ~$entry_time[$loop_count] ~$callback_time[$loop_count] ~$comments[$loop_count]\n"; + $loop_count++; + } + +} + + +################################################################################ +### CalLBacKCounT - send the count of the USERONLY callbacks for an agent +################################################################################ +if ($ACTION == 'CalLBacKCounT') +{ +$stmt = "select count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' and status NOT IN('INACTIVE','DEAD');"; +if ($DB) {echo "$stmt\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$cbcount=$row[0]; + +echo "$cbcount"; +} + + if ($format=='debug') diff --git a/agc/vicidial.php b/agc/vicidial.php index afafb6e..25bd9b7 100644 --- a/agc/vicidial.php +++ b/agc/vicidial.php @@ -83,6 +83,18 @@ ### 60214-0932 - Initial Callback calendar display framework ### 60214-1407 - Added ability to minimize the dispo screen to see info below ### 60215-1104 - Added ANYONE scheduled callbacks functionality +### 60410-1116 - Added persistant pause after dispo option and change dispo text +### - Added web form submit that opens new window with dispo on submit +### - Added PREVIOUS CALLBACK in customer info to flag callbacks +### - Added link to try to hangup the call again in the dispo screen +### - Added link noone-in-session screen to call agent phone again +### - Added link customer-hungup screen to go straight to dispo screen +### 60410-1532 - Added agent status and campaign calls dialing display option +### 60411-1547 - Add ability to set callback as USERONLY and some basic formatting +### 60413-1752 - Add basic USERONLY callback frame and listings +### 60414-1039 - Changed manual dial preview and alt dial checkboxes to spans +### - Added beta-level USERONLY callback functionality +### - Added beta-level manual dialing with lead insertion functionality ### require("dbconnect.php"); @@ -101,8 +113,8 @@ $relogin=$_GET['relogin']; if (!$relogin) {$relogin=$_POST["relogin"];} $forever_stop=0; -$version = '1.1.66'; -$build = '60215-1104'; +$version = '1.1.71'; +$build = '60414-1039'; if ($force_logout) { @@ -121,14 +133,19 @@ $CIDdate = date("ymdHis"); $random = (rand(1000000, 9999999) + 10000000); $conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently -$manual_dial_preview = '1'; # Allow preview lead option when manual dial $HKuser_level = '5'; # minimum vicidial user_level for HotKeys $campaign_login_list = '1'; # show drop-down list of campaigns at login +$manual_dial_preview = '1'; # allow preview lead option when manual dial $manual_dial_alt_phone = '1'; # allow manual dial users to call alt phone number $multi_line_comments = '1'; # set to 1 to allow multi-line comment box $user_login_first = '0'; # set to 1 to have the vicidial_user login before the phone login $view_scripts = '1'; # set to 1 to show the SCRIPTS tab $scheduled_callbacks = '1'; # set to 1 to allow agent to choose scheduled callbacks + $agentonly_callbacks = '1'; # set to 1 to allow agent to choose agent-only scheduled callbacks +$agentcall_manual = '1'; # set to 1 to allow agent to make manual calls during autodial session +$dispo_check_all_pause = '0'; # set to 1 to allow for persistent pause after dispo +$agentcallsstatus = '1'; # set to 1 to show agent status and call count + $campagentstatctmax = '0'; # Number of seconds for campaign call and agent stats $TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen @@ -1056,6 +1073,7 @@ $CCAL_OUT .= "
STATUS
STATUSSTATUS NAME$first$firstSUBTOTAL
SUBTOTAL
$status[$sts]
$Pstatus$statuses_list[$Pstatus]SUBTOTAL
$count_count[$o]SUBTOTAL
TOTAL
TOTAL$all_called_count[$first]$all_called_count[$first]$leads_in_list
"; var CallBackrecipient = ''; var CallBackCommenTs = ''; var scheduled_callbacks = ''; + var dispo_check_all_pause = ''; VARstatuses = new Array(); VARstatusnames = new Array(); var VD_statuses_ct = ''; @@ -1152,12 +1170,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var CalL_ScripT_id = ''; var CalL_AutO_LauncH = ''; var panel_bgcolor = '#E0C2D6'; + var CusTCB_bgcolor = '#FFFF66'; var status_A = ''; var status_B = ''; var status_C = ''; var status_D = ''; var status_E = ''; var auto_dial_level = ''; + var starting_dial_level = ''; var dial_timeout = ''; var dial_prefix = ''; var campaign_cid = ''; @@ -1222,6 +1242,20 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var previous_called_count = ''; var hot_keys_active = 0; var all_record = 'NO'; + var LeaDDispO = ''; + var LeaDPreVDispO = ''; + var AgaiNHanguPChanneL = ''; + var AgaiNHanguPServeR = ''; + var AgainCalLSecondS = ''; + var AgaiNCalLCID = ''; + var CB_count_check = 60; + var agentcallsstatus = '' + var campagentstatctmax = '' + var campagentstatct = '0' + var callback_in_progress = 0; + var mdnLisT_id = '999'; + var agentonly_callbacks = '' + var agentcall_manual = '' var manual_dial_preview = '' var manual_dial_alt_phone = '' var DiaLControl_auto_HTML = "\"Pause\"\"Resume\""; @@ -1426,7 +1460,17 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else { var dialnum = tasknum; - var originatevalue = protocol + "/" + extension; + if (protocol == 'EXTERNAL') + { + var protodial = 'Local'; + var extendial = extension + "@" + ext_context; + } + else + { + var protodial = protocol; + var extendial = extension; + } + var originatevalue = protodial + "/" + extendial; } var queryCID = "DVagcW" + epoch_sec + user_abb; @@ -1505,6 +1549,23 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function check_for_conf_calls(taskconfnum,taskforce) { custchannellive--; + if (agentcallsstatus == '1') + { + campagentstatct++; + if (campagentstatct > campagentstatctmax) + { + campagentstatct=0; + var campagentstdisp = 'YES'; + } + else + { + var campagentstdisp = 'NO'; + } + } + else + { + var campagentstdisp = 'NO'; + } var xmlhttp=false; /*@cc_on @*/ /*@if (@_jscript_version >= 5) @@ -1526,7 +1587,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - checkconf_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&client=vdc&conf_exten=" + taskconfnum + "&auto_dial_level=" + auto_dial_level; + checkconf_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&client=vdc&conf_exten=" + taskconfnum + "&auto_dial_level=" + auto_dial_level + "&campagentstdisp=" + campagentstdisp; xmlhttp.open('POST', 'conf_exten_check.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(checkconf_query); @@ -1546,6 +1607,21 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} UnixTime = parseInt(UnixTime); UnixTimeMS = (UnixTime * 1000); t.setTime(UnixTimeMS); + if (agentcallsstatus == '1') + { + var Astatus_array = check_time_array[2].split("Status: "); + var AGStatuS = Astatus_array[1]; + var CamPCalLs_array = check_time_array[3].split("CampCalls: "); + var CamPCalLs = CamPCalLs_array[1]; + if (AGStatuS != 'N') + { + document.getElementById("AgentStatusStatus").innerHTML = AGStatuS; + } + if (CamPCalLs != 'N') + { + document.getElementById("AgentStatusCalls").innerHTML = CamPCalLs; + } + } var check_conf_array=check_ALL_array[1].split("|"); var live_conf_calls = check_conf_array[0]; var conf_chan_array = check_conf_array[1].split(" ~"); @@ -1990,6 +2066,206 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } + +// ################################################################################ +// Request number of USERONLY callbacks for this agent + function CalLBacKsCounTCheck() + { + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); + } + if (xmlhttp) + { + CBcount_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKCounT&format=text"; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(CBcount_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + var CBcounT = xmlhttp.responseText; + if (CBcounT == 0) {var CBprint = "NO";} + else {var CBprint = CBcounT;} + document.getElementById("CBstatusSpan").innerHTML ="" + CBprint + " ACTIVE CALLBACKS"; + + } + } + delete xmlhttp; + } + } + + +// ################################################################################ +// Request list of USERONLY callbacks for this agent + function CalLBacKsLisTCheck() + { + if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) ) + { + alert("YOU MUST BE PAUSED TO CHECK CALLBACKS IN AUTO-DIAL MODE"); + } + else + { + showDiv('CallBacKsLisTBox'); + + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); + } + if (xmlhttp) + { + var CBlist_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKLisT&format=text"; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(CBlist_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + var all_CBs = null; + all_CBs = xmlhttp.responseText; + var all_CBs_array=all_CBs.split("\n"); + var CB_calls = all_CBs_array[0]; + var loop_ct=0; + var conv_start=0; + var CB_HTML = "" + while (loop_ct < CB_calls) + { + loop_ct++; + loop_s = loop_ct.toString(); + if (loop_s.match(/1$|3$|5$|7$|9$/)) + {var row_color = '#DDDDFF';} + else + {var row_color = '#CCCCFF';} + var conv_ct = (loop_ct + conv_start); + var call_array = all_CBs_array[conv_ct].split(" ~"); + var CB_name = call_array[0] + " " + call_array[1]; + var CB_phone = call_array[2]; + var CB_id = call_array[3]; + var CB_lead_id = call_array[4]; + var CB_campaign = call_array[5]; + var CB_status = call_array[6]; + var CB_lastcall_time = call_array[7]; + var CB_callback_time = call_array[8]; + var CB_comments = call_array[9]; + CB_HTML = CB_HTML + ""; + + } + CB_HTML = CB_HTML + "
#CALLBACK DATE/TIMENUMBERNAMESTATUSCAMPAIGNLAST CALL DATE/TIME COMMENTS
" + loop_ct + "" + CB_callback_time + "" + CB_phone + "" + CB_name + "" + CB_status + "" + CB_campaign + "" + CB_lastcall_time + " " + CB_comments + " 
"; + document.getElementById("CallBacKsLisT").innerHTML = CB_HTML; + } + } + delete xmlhttp; + } + } + } + + +// ################################################################################ +// Open up a callback customer record as manual dial preview mode + function new_callback_call(taskCBid,taskLEADid) + { + auto_dial_level=0; + callback_in_progress=1; + MainPanelToFront(); + buildDiv('DiaLLeaDPrevieW'); + buildDiv('DiaLDiaLAltPhonE'); + document.vicidial_form.LeadPreview.checked=true; + document.vicidial_form.DiaLAltPhonE.checked=true; + hideDiv('CallBacKsLisTBox'); + ManualDialNext(taskCBid,taskLEADid); + } + + +// ################################################################################ +// Finish Callback and go back to original screen + function callback_finished() + { + auto_dial_level=starting_dial_level; + MainPanelToFront(); + CalLBacKsCounTCheck(); + callback_in_progress=0; + } + + +// ################################################################################ +// Open page to enter details for a new manual dial lead + function NeWManuaLDiaLCalL() + { + if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) ) + { + alert("YOU MUST BE PAUSED TO MANUAL DIAL A NEW LEAD IN AUTO-DIAL MODE"); + } + else + { + showDiv('NeWManuaLDiaLBox'); + } + } + + +// ################################################################################ +// Insert the new manual dial as a lead and go to manual dial screen + function NeWManuaLDiaLCalLSubmiT() + { + hideDiv('NeWManuaLDiaLBox'); + var MDDiaLCodEform = document.vicidial_form.MDDiaLCodE.value; + var MDPhonENumbeRform = document.vicidial_form.MDPhonENumbeR.value; + var MDDiaLOverridEform = document.vicidial_form.MDDiaLOverridE.value; + + if (MDDiaLOverridEform.length > 0) + { + basic_originate_call(session_id,'NO','YES',MDDiaLOverridEform); + } + else + { + auto_dial_level=0; + callback_in_progress=1; + MainPanelToFront(); + buildDiv('DiaLLeaDPrevieW'); + buildDiv('DiaLDiaLAltPhonE'); + document.vicidial_form.LeadPreview.checked=true; + document.vicidial_form.DiaLAltPhonE.checked=true; + ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform); + } + + document.vicidial_form.MDPhonENumbeR.value = ''; + document.vicidial_form.MDDiaLOverridE.value = ''; + } + + // ################################################################################ // Request lookup of manual dial channel function ManualDialCheckChanneL(taskCheckOR) @@ -2144,7 +2420,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Send the Manual Dial Next Number request - function ManualDialNext() + function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR) { all_record = 'NO'; document.getElementById("DiaLControl").innerHTML = "\"Dial"; @@ -2180,7 +2456,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id; + manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLnext_query); @@ -2202,6 +2478,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { fronter = user; document.vicidial_form.lead_id.value = MDnextResponse_array[1]; + LeaDPreVDispO = MDnextResponse_array[2]; document.vicidial_form.vendor_lead_code.value = MDnextResponse_array[4]; document.vicidial_form.list_id.value = MDnextResponse_array[5]; document.vicidial_form.gmt_offset_now.value = MDnextResponse_array[6]; @@ -2276,8 +2553,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&SIPexten=" + extension + "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value; - + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO; // $VICIDIAL_web_QUERY_STRING =~ s/ /+/gi; // $VICIDIAL_web_QUERY_STRING =~ s/\`|\~|\:|\;|\#|\'|\"|\{|\}|\(|\)|\*|\^|\%|\$|\!|\%|\r|\t|\n//gi; @@ -2290,6 +2567,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} VDIC_web_form_address = VICIDiaL_web_form_address; + if (LeaDPreVDispO == 'CALLBK') + { + document.getElementById("CusTInfOSpaN").innerHTML = " PREVIOUS CALLBACK "; + document.getElementById("CusTInfOSpaN").style.background = CusTCB_bgcolor; + } + var regWFAvars = new RegExp("\\?","ig"); if (VDIC_web_form_address.match(regWFAvars)) {web_form_vars = '&' + web_form_vars} @@ -2348,88 +2631,95 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Send the Manual Dial Skip function ManualDialSkip() { - document.getElementById("DiaLControl").innerHTML = "\"Dial"; - - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') + if (callback_in_progress==1) { - xmlhttp = new XMLHttpRequest(); + alert('YOU CANNOT SKIP A CALLBACK OR MANUAL DIAL, YOU MUST DIAL THE LEAD'); } - if (xmlhttp) - { - manDiaLskip_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLskip&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&stage=" + previous_dispo + "&called_count=" + previous_called_count; - xmlhttp.open('POST', 'vdc_db_query.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(manDiaLskip_query); - xmlhttp.onreadystatechange = function() + else + { + document.getElementById("DiaLControl").innerHTML = "\"Dial"; + + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); + } + if (xmlhttp) { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - var MDSnextResponse = null; - // alert(manDiaLskip_query); - // alert(xmlhttp.responseText); - MDSnextResponse = xmlhttp.responseText; - - var MDSnextResponse_array=MDSnextResponse.split("\n"); - MDSnextCID = MDSnextResponse_array[0]; - if (MDSnextCID == "LEAD NOT REVERTED") + manDiaLskip_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLskip&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&stage=" + previous_dispo + "&called_count=" + previous_called_count; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(manDiaLskip_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { - alert("Lead was not reverted, there was an error:\n" + MDSnextResponse); - } - else - { - document.vicidial_form.lead_id.value =''; - document.vicidial_form.vendor_lead_code.value=''; - document.vicidial_form.list_id.value =''; - document.vicidial_form.gmt_offset_now.value =''; - document.vicidial_form.phone_code.value =''; - document.vicidial_form.phone_number.value =''; - document.vicidial_form.title.value =''; - document.vicidial_form.first_name.value =''; - document.vicidial_form.middle_initial.value =''; - document.vicidial_form.last_name.value =''; - document.vicidial_form.address1.value =''; - document.vicidial_form.address2.value =''; - document.vicidial_form.address3.value =''; - document.vicidial_form.city.value =''; - document.vicidial_form.state.value =''; - document.vicidial_form.province.value =''; - document.vicidial_form.postal_code.value =''; - document.vicidial_form.country_code.value =''; - document.vicidial_form.gender.value =''; - document.vicidial_form.date_of_birth.value =''; - document.vicidial_form.alt_phone.value =''; - document.vicidial_form.email.value =''; - document.vicidial_form.security_phrase.value=''; - document.vicidial_form.comments.value =''; - document.vicidial_form.called_count.value =''; - VDCL_group_id = ''; - fronter = ''; - previous_called_count = ''; - previous_dispo = ''; - custchannellive=1; + var MDSnextResponse = null; + // alert(manDiaLskip_query); + // alert(xmlhttp.responseText); + MDSnextResponse = xmlhttp.responseText; - document.getElementById("MainStatuSSpan").innerHTML = " Lead skipped, go on to next lead"; + var MDSnextResponse_array=MDSnextResponse.split("\n"); + MDSnextCID = MDSnextResponse_array[0]; + if (MDSnextCID == "LEAD NOT REVERTED") + { + alert("Lead was not reverted, there was an error:\n" + MDSnextResponse); + } + else + { + document.vicidial_form.lead_id.value =''; + document.vicidial_form.vendor_lead_code.value=''; + document.vicidial_form.list_id.value =''; + document.vicidial_form.gmt_offset_now.value =''; + document.vicidial_form.phone_code.value =''; + document.vicidial_form.phone_number.value =''; + document.vicidial_form.title.value =''; + document.vicidial_form.first_name.value =''; + document.vicidial_form.middle_initial.value =''; + document.vicidial_form.last_name.value =''; + document.vicidial_form.address1.value =''; + document.vicidial_form.address2.value =''; + document.vicidial_form.address3.value =''; + document.vicidial_form.city.value =''; + document.vicidial_form.state.value =''; + document.vicidial_form.province.value =''; + document.vicidial_form.postal_code.value =''; + document.vicidial_form.country_code.value =''; + document.vicidial_form.gender.value =''; + document.vicidial_form.date_of_birth.value =''; + document.vicidial_form.alt_phone.value =''; + document.vicidial_form.email.value =''; + document.vicidial_form.security_phrase.value=''; + document.vicidial_form.comments.value =''; + document.vicidial_form.called_count.value =''; + VDCL_group_id = ''; + fronter = ''; + previous_called_count = ''; + previous_dispo = ''; + custchannellive=1; - document.getElementById("DiaLControl").innerHTML = "\"Dial"; + document.getElementById("MainStatuSSpan").innerHTML = " Lead skipped, go on to next lead"; + + document.getElementById("DiaLControl").innerHTML = "\"Dial"; + } } } + delete xmlhttp; } - delete xmlhttp; } } @@ -2687,6 +2977,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} custchannellive=1; + LeaDPreVDispO = check_VDIC_array[6]; fronter = check_VDIC_array[7]; document.vicidial_form.vendor_lead_code.value = check_VDIC_array[8]; document.vicidial_form.list_id.value = check_VDIC_array[9]; @@ -2718,6 +3009,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} lead_dial_number = document.vicidial_form.phone_number.value; document.getElementById("MainStatuSSpan").innerHTML = " Incoming: " + document.vicidial_form.phone_number.value + " UID: " + CIDcheck + "   " + VDIC_fronter; + if (LeaDPreVDispO == 'CALLBK') + { + document.getElementById("CusTInfOSpaN").innerHTML = " PREVIOUS CALLBACK "; + document.getElementById("CusTInfOSpaN").style.background = CusTCB_bgcolor; + } + if (VDIC_data_VDIG[1].length > 0) { if (VDIC_data_VDIG[2].length > 2) @@ -2791,7 +3088,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&SIPexten=" + extension + "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value; + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO; var regWFspace = new RegExp(" ","ig"); web_form_vars = web_form_vars.replace(regWF, ''); @@ -2896,7 +3194,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&SIPexten=" + extension + "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value; + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO; var regWFspace = new RegExp(" ","ig"); web_form_vars = web_form_vars.replace(regWF, ''); @@ -2922,6 +3221,24 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Send hangup a second time from the dispo screen + function DispoHanguPAgaiN() + { + form_cust_channel = AgaiNHanguPChanneL; + document.vicidial_form.callchannel.value = AgaiNHanguPChanneL; + document.vicidial_form.callserverip.value = AgaiNHanguPServeR; + lastcustchannel = AgaiNHanguPChanneL; + lastcustserverip = AgaiNHanguPServeR; + VD_live_call_secondS = AgainCalLSecondS; + CalLCID = AgaiNCalLCID; + + document.getElementById("DispoSelectHAspan").innerHTML = ""; + + dialedcall_send_hangup(); + } + + // ################################################################################ // Start Hangup Functions for both function bothcall_send_hangup() @@ -2940,6 +3257,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var form_cust_serverip = document.vicidial_form.callserverip.value; var customer_channel = lastcustchannel; var customer_server_ip = lastcustserverip; + AgaiNHanguPChanneL = lastcustchannel; + AgaiNHanguPServeR = lastcustserverip; + AgainCalLSecondS = VD_live_call_secondS; + AgaiNCalLCID = CalLCID; var process_post_hangup=0; if (MD_channel_look==1) { @@ -3284,6 +3605,30 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("DispoSelectContent").innerHTML = dispo_HTML; } + +// ################################################################################ +// open web form, then submit disposition + function WeBForMDispoSelect_submit() + { + var DispoChoice = document.vicidial_form.DispoSelection.value; + + if (DispoChoice.length < 1) {alert("You Must Select a Disposition");} + else + { + document.getElementById("CusTInfOSpaN").innerHTML = ""; + document.getElementById("CusTInfOSpaN").style.background = panel_bgcolor; + + LeaDDispO = DispoChoice; + + WebFormRefresH(); + + window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + + DispoSelect_submit(); + } + } + + // ################################################################################ // Update vicidial_list lead record with disposition selection function DispoSelect_submit() @@ -3294,6 +3639,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (DispoChoice.length < 1) {alert("You Must Select a Disposition");} else { + document.getElementById("CusTInfOSpaN").innerHTML = ""; + document.getElementById("CusTInfOSpaN").style.background = panel_bgcolor; + if ( (DispoChoice == 'CALLBK') && (scheduled_callbacks > 0) ) {showDiv('CallBackSelectBox');} else { @@ -3367,12 +3715,17 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} VDCL_group_id = ''; fronter = ''; + if (callback_in_progress==1) + { + callback_finished(); + } hideDiv('DispoSelectBox'); hideDiv('DispoButtonHideA'); hideDiv('DispoButtonHideB'); hideDiv('DispoButtonHideC'); document.getElementById("DispoSelectBox").style.top = 1; - document.getElementById("DispoSelectMaxMin").innerHTML = "minimize"; + document.getElementById("DispoSelectMaxMin").innerHTML = "minimize"; + document.getElementById("DispoSelectHAspan").innerHTML = "Hangup Again"; AgentDispoing = 0; @@ -3385,6 +3738,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; } VICIDiaL_pause_calling = 1; + if (dispo_check_all_pause != '1') + { + document.vicidial_form.DispoSelectStop.checked=false; + } } else { @@ -3429,6 +3786,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} WaitingForNextStep=0; custchannellive=0; } + function CustomerGoneHangup() + { + hideDiv('CustomerGoneBox'); + WaitingForNextStep=0; + custchannellive=0; + + dialedcall_send_hangup(); + } // ################################################################################ // Show message that there are no voice channels in the VICIDIAL session function NoneInSession() @@ -3444,6 +3809,62 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} WaitingForNextStep=0; nochannelinsession=0; } + function NoneInSessionCalL() + { + hideDiv('NoneInSessionBox'); + WaitingForNextStep=0; + nochannelinsession=0; + + if (protocol == 'EXTERNAL') + { + var protodial = 'Local'; + var extendial = extension + "@" + ext_context; + } + else + { + var protodial = protocol; + var extendial = extension; + } + var originatevalue = protodial + "/" + extendial; + var queryCID = "ACagcW" + epoch_sec + user_abb; + + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); + } + if (xmlhttp) + { + VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Originate&format=text&channel=" + originatevalue + "&queryCID=" + queryCID + "&exten=" + session_id + "&ext_context=" + ext_context + "&ext_priority=1"; + xmlhttp.open('POST', 'manager_send.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(VMCoriginate_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + } + } + delete xmlhttp; + } + AutoDial_ReSume_PauSe("VDADpause","NO"); + } + // ################################################################################ // Generate the Closer In Group Chooser panel @@ -3854,7 +4275,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.CBT_minute.value = '00'; document.vicidial_form.CBT_ampm.value = 'PM'; - CallBackrecipient = 'ANYONE'; + if (document.vicidial_form.CallBackOnlyMe.checked==true) + { + CallBackrecipient = 'USERONLY'; + } + else + { + CallBackrecipient = 'ANYONE'; + } + document.vicidial_form.CallBackOnlyMe.checked=false; // alert(CallBackDatETimE + "|" + CallBackCommenTs); @@ -3893,6 +4322,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} hideDiv('DispoButtonHideA'); hideDiv('DispoButtonHideB'); hideDiv('DispoButtonHideC'); + hideDiv('CallBacKsLisTBox'); + hideDiv('NeWManuaLDiaLBox'); + if (agentonly_callbacks != '1') + {hideDiv('CallbacksButtons');} + if ( (agentcall_manual != '1') && (starting_dial_level > 0) ) + {hideDiv('ManuaLDiaLButtons');} + if (agentcallsstatus != '1') + {hideDiv('AgentStatusSpan');} + if ( (auto_dial_level != 0) || (manual_dial_preview != 1) ) + {clearDiv('DiaLLeaDPrevieW');} + if ( (auto_dial_level != 0) || (manual_dial_alt_phone != 1) ) + {clearDiv('DiaLDiaLAltPhonE');} + document.getElementById("sessionIDspan").innerHTML = session_id; if (campaign_recording == 'NEVER') { @@ -3947,6 +4389,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { // check for live channels in conference room and get current datetime check_for_conf_calls(session_id, '0'); + if (agentonly_callbacks == '1') + {CB_count_check++;} if (AutoDialWaiting == 1) { @@ -3957,6 +4401,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { ManualDialCheckChanneL(XDcheck); } + if ( (CB_count_check > 19) && (agentonly_callbacks == '1') ) + { + CalLBacKsCounTCheck(); + CB_count_check=0; + } if (VD_live_customer_call==1) { VD_live_call_secondS++; @@ -4162,6 +4611,29 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} divref.visibility = 'hidden'; } } + function clearDiv(divvar) + { + if (document.getElementById(divvar)) + { + document.getElementById(divvar).innerHTML = ''; + } + } + function buildDiv(divvar) + { + if (document.getElementById(divvar)) + { + var buildDivHTML = ""; + if (divvar == 'DiaLLeaDPrevieW') + { + var buildDivHTML = " LEAD PREVIEW
"; + } + if (divvar == 'DiaLDiaLAltPhonE') + { + var buildDivHTML = " ALT PHONE DIAL
"; + } + document.getElementById(divvar).innerHTML = buildDivHTML; + } + } function showMainXfeR(divvar,taskxferchan,taskxferchanmain) { @@ -4244,9 +4716,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (resumevar != 'NO') { if (auto_dial_level == 0) - {document.getElementById("DiaLControl").innerHTML = DiaLControl_manual_HTML;} + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_manual_HTML; + if (manual_dial_preview == 1) + {buildDiv('DiaLLeaDPrevieW');} + if (manual_dial_alt_phone != 1) + {buildDiv('DiaLDiaLAltPhonE');} + } else - {document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML;} + { + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; + clearDiv('DiaLLeaDPrevieW'); + clearDiv('DiaLDiaLAltPhonE'); + } } panel_bgcolor='#E0C2D6'; document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; @@ -4269,6 +4751,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}