From ca4fcbfb19a166b04b22fc5914c7079f00d44470 Mon Sep 17 00:00:00 2001 From: mattf Date: Thu, 26 Oct 2017 14:27:27 +0000 Subject: [PATCH] Added --wipe-closer-log flag to ADMIN_archive_log_tables.pl Added queue_log logging to inbound email handling git-svn-id: svn://192.168.202.10@2847 3d104415-ff17-0410-8863-d5cf3c621b8a --- bin/ADMIN_archive_log_tables.pl | 15 +++- bin/AST_inbound_email_parser.pl | 128 ++++++++++++++++++++++++-------- docs/CALLER_ID_NAME_CODES.txt | 3 +- www/agc/vdc_db_query.php | 59 ++++++++++++++- www/agc/vicidial.php | 7 +- 5 files changed, 173 insertions(+), 39 deletions(-) diff --git a/bin/ADMIN_archive_log_tables.pl b/bin/ADMIN_archive_log_tables.pl index e8ab855d..baaf65d4 100644 --- a/bin/ADMIN_archive_log_tables.pl +++ b/bin/ADMIN_archive_log_tables.pl @@ -51,12 +51,14 @@ # 170809-1926 - Added rolling of user_call_log if over 1000000 records # 170817-1318 - Added rolling of vicidial_inbound_survey_log # 170825-2243 - Added rolling of vicidial_xfer_log +# 171026-0105 - Added --wipe-closer-log flag # $CALC_TEST=0; $T=0; $TEST=0; $only_trim_archive=0; $recording_log_archive=0; +$wipe_closer_log=0; ### begin parsing run-time options ### if (length($ARGV[0])>1) @@ -86,6 +88,7 @@ if (length($ARGV[0])>1) print " vicidial_log_archive, vicidial_agent_log_archive, vicidial_closer_log_archive, vicidial_xfer_log_archive\n"; print " [--recording-log-days=XX] = OPTIONAL, number of days to archive recording_log table only past\n"; print " [--cpd-log-purge-days=XX] = OPTIONAL, number of days to purge vicidial_cpd_log table only past\n"; + print " [--wipe-closer-log] = OPTIONAL, deletes all records from vicidial_closer_log after archiving\n"; print " [--quiet] = quiet\n"; print " [--calc-test] = date calculation test only\n"; print " [--test] = test\n\n"; @@ -107,6 +110,11 @@ if (length($ARGV[0])>1) $CALC_TEST=1; print "\n-----DATE CALCULATION TESTING ONLY-----\n\n"; } + if ($args =~ /--wipe-closer-log/i) + { + $wipe_closer_log=1; + print "\n----- WIPE CLOSER LOG: $wipe_closer_log -----\n\n"; + } if ($args =~ /--daily/i) { $daily=1; @@ -1341,8 +1349,11 @@ if (!$T) $rv = $sthA->err(); if (!$rv) - { - $stmtA = "DELETE FROM vicidial_closer_log WHERE call_date < '$del_time';"; + { + if ($wipe_closer_log > 0) + {$stmtA = "DELETE FROM vicidial_closer_log;";} + else + {$stmtA = "DELETE FROM vicidial_closer_log WHERE call_date < '$del_time';";} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows = $sthA->rows; diff --git a/bin/AST_inbound_email_parser.pl b/bin/AST_inbound_email_parser.pl index c01ad3ec..956adf71 100644 --- a/bin/AST_inbound_email_parser.pl +++ b/bin/AST_inbound_email_parser.pl @@ -65,6 +65,7 @@ use MIME::QuotedPrint; # 160414-0930 - Added missing phone_code field on vicidial_list insert # 161014-2200 - Bug patch for " " string in email message # 170523-1319 - file attachment patch, issue #1014 +# 171026-0106 - Added optional queue_log logging # # default path to astguiclient configuration file: @@ -217,7 +218,7 @@ $minutes=($hour*60)+$min; # $minutes=0; # Uncomment if you want to TEST ONLY, so you can test this at any time. ##### Get the settings from system_settings ##### -$stmtA = "SELECT allow_emails,default_phone_code FROM system_settings;"; +$stmtA = "SELECT allow_emails,default_phone_code,enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_eq_prepend FROM system_settings;"; # print "$stmtA\n"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -225,8 +226,15 @@ $sthArows=$sthA->rows; if ($sthArows > 0) { @aryA = $sthA->fetchrow_array; - $SSallow_emails = $aryA[0]; - $SSdefault_phone_code = $aryA[1]; + $SSallow_emails = $aryA[0]; + $SSdefault_phone_code = $aryA[1]; + $enable_queuemetrics_logging = $aryA[2]; + $queuemetrics_server_ip = $aryA[3]; + $queuemetrics_dbname = $aryA[4]; + $queuemetrics_login= $aryA[5]; + $queuemetrics_pass = $aryA[6]; + $queuemetrics_log_id = $aryA[7]; + $queuemetrics_eq_prepend = $aryA[8]; } $sthA->finish(); @@ -309,7 +317,8 @@ while (@row=$rslt->fetchrow_array) { #print "Folders:\n"; $new_messages=0; my @folder_array=$client->folders("INBOX"); - for (my $i=0; $imessage_count($folder_array[$i]); #print "+---+ Messages: ".$msgcount."\n"; @@ -608,16 +617,19 @@ while (@row=$rslt->fetchrow_array) { if ($DBX) {print $ins_stmt."\n";} my $ins_rslt=$dbhA->prepare($ins_stmt); - if ($ins_rslt->execute()) { - if ($attach_ct>0) { - $email_id=$dbhA->last_insert_id(undef, undef, 'vicidial_email_list', 'email_row_id'); + if ($ins_rslt->execute()) + { + $email_id=$dbhA->last_insert_id(undef, undef, 'vicidial_email_list', 'email_row_id'); + if ($attach_ct>0) + { $multistmt=""; - for ($k=0; $k<$attach_ct; $k++) { + for ($k=0; $k<$attach_ct; $k++) + { $ins_values[$k]="('$email_id',$ins_values[$k])"; $multistmt.="$ins_values[$k],"; $output_ins_values[$k]="('$email_id',$output_ins_values[$k])"; $output_multistmt.="$output_ins_values[$k],"; - } + } $attachment_ins_stmt="insert into inbound_email_attachments(email_row_id, filename, file_type, file_encoding, file_size, file_extension, file_contents) VALUES ".substr($multistmt,0,-1); $attachment_ins_rslt=$dbhA->prepare($attachment_ins_stmt); @@ -625,17 +637,42 @@ while (@row=$rslt->fetchrow_array) { $output_ins_stmt="insert into inbound_email_attachments(email_row_id, filename, file_type, file_encoding, file_size, file_extension, file_contents) VALUES ".substr($output_multistmt,0,-1); if ($DBX) {print $output_ins_stmt."\n";} - } + } if ($DB) {print "\n Found $attach_ct attachments in email\n";} - } else { - die "Email insert failed. Check SQL in:\n $ins_stmt\n"; - } + ## QM queue_log insert + if ($enable_queuemetrics_logging > 0) + { + $PADlead_id = sprintf("%010s", $lead_id); while (length($PADlead_id) > 10) {chop($PADlead_id);} + $PADemail_id = sprintf("%09s", $email_id); while (length($PADemail_id) > 9) {$PADemail_id = substr($PADemail_id,1);} + $caller_code = "E$PADemail_id$PADlead_id"; + + $dbhB = DBI->connect("DBI:mysql:$queuemetrics_dbname:$queuemetrics_server_ip:3306", "$queuemetrics_login", "$queuemetrics_pass") + or die "Couldn't connect to database: " . DBI->errstr; + + if ($DBX) {print "CONNECTED TO QueueMetrics DATABASE: $queuemetrics_server_ip|$queuemetrics_dbname\n";} + + $stmtB = "INSERT INTO queue_log SET `partition`='P01',time_id='$secX',call_id='$caller_code',queue='NONE',agent='NONE',verb='INFO',data1='DID',data2='$VARemail_ID',serverid='$queuemetrics_log_id';"; + $Baffected_rows = $dbhB->do($stmtB); + + $stmtB = "INSERT INTO queue_log SET `partition`='P01',time_id='$secX',call_id='$caller_code',queue='NONE',agent='NONE',verb='INFO',data1='IVRSTART',data2='$VARemail_groupid',data3='$VARemail_ID',serverid='$queuemetrics_log_id';"; + $Baffected_rows = $dbhB->do($stmtB); + + $stmtB = "INSERT INTO queue_log SET `partition`='P01',time_id='$secX',call_id='$caller_code',queue='NONE',agent='NONE',verb='INFO',data1='IVR',data2='$VARemail_groupid',serverid='$queuemetrics_log_id';"; + $Baffected_rows = $dbhB->do($stmtB); + + $dbhB->disconnect(); + } + } + else + { + die "Email insert failed. Check SQL in:\n $ins_stmt\n"; + } + } } - } close(STORAGE); + } } - } if ($DB) { if ($DBX) { print "Iteration #$q - found ".($new_messages+0)." new messages\n"; @@ -661,10 +698,13 @@ while (@row=$rslt->fetchrow_array) { or die "Cannot connect through POP3Client: $!"; if ($pop->Count()<0) {die "Error connecting to server. Please try again later.\n";} - for( $i = 1; $i <= $pop->Count(); $i++ ) { - foreach( $pop->Head( $i ) ) { + for( $i = 1; $i <= $pop->Count(); $i++ ) + { + foreach( $pop->Head( $i ) ) + { # print $_."\n"; - if ($_=~/^(To|From|Date|Subject|MIME-Version|Content-Type|Content-Transfer-Encoding|X-Mailer|Authentication-Results|Message|Body):\s+/i) { + if ($_=~/^(To|From|Date|Subject|MIME-Version|Content-Type|Content-Transfer-Encoding|X-Mailer|Authentication-Results|Message|Body):\s+/i) + { $value=$_; $ptn=$&; $value=~s/$ptn//i; @@ -673,11 +713,12 @@ while (@row=$rslt->fetchrow_array) { $ptn=~s/\-/_/gi; $varname=lc($ptn); $$varname=$value; - } - if ($_=~/boundary\=\"?[^\"]+\"?/i) { + } + if ($_=~/boundary\=\"?[^\"]+\"?/i) + { $bkup_boundary=$&; + } } - } #Rename variables so they aren't as vague. $email_to=$to; $email_from=$from; @@ -947,29 +988,58 @@ while (@row=$rslt->fetchrow_array) { my $ins_stmt="insert into vicidial_email_list(lead_id, protocol, email_date, email_to, email_from, email_from_name, subject, mime_type, content_type, content_transfer_encoding, x_mailer, sender_ip, message, email_account_id, group_id, status, direction) values('$lead_id', 'POP3', STR_TO_DATE('$date', '%d %b %Y %T'), '$email_to', '$email_from', '$email_from_name', '$subject', '$mime_type', '$content_type', '$content_transfer_encoding', '$x_mailer', '$sender_ip', trim('$message'), '$VARemail_ID', '$VARemail_groupid', '$status', 'INBOUND')"; if ($DBX) {print $ins_stmt."\n";} my $ins_rslt=$dbhA->prepare($ins_stmt); - if ($ins_rslt->execute()) { + if ($ins_rslt->execute()) + { + $email_id=$dbhA->last_insert_id(undef, undef, 'vicidial_email_list', 'email_row_id'); $pop->Delete($i); - if ($attach_ct>0) { - $email_id=$dbhA->last_insert_id(undef, undef, 'vicidial_email_list', 'email_row_id'); + if ($attach_ct>0) + { $multistmt=""; - for ($k=0; $k<$attach_ct; $k++) { + for ($k=0; $k<$attach_ct; $k++) + { $ins_values[$k]="('$email_id',$ins_values[$k])"; $multistmt.="$ins_values[$k],"; $output_ins_values[$k]="('$email_id',$output_ins_values[$k])"; $output_multistmt.="$output_ins_values[$k],"; - } + } $attachment_ins_stmt="insert into inbound_email_attachments(email_row_id, filename, file_type, file_encoding, file_size, file_extension, file_contents) VALUES ".substr($multistmt,0,-1); $attachment_ins_rslt=$dbhA->prepare($attachment_ins_stmt); $attachment_ins_rslt->execute(); $output_ins_stmt="insert into inbound_email_attachments(email_row_id, filename, file_type, file_encoding, file_size, file_extension, file_contents) VALUES ".substr($output_multistmt,0,-1); if ($DBX) {print $output_ins_stmt."\n";} - } + } if ($DB) {print "\n $attach_ct attachments in email\n";} - } else { + + ## QM queue_log insert + if ($enable_queuemetrics_logging > 0) + { + $PADlead_id = sprintf("%010s", $lead_id); while (length($PADlead_id) > 10) {chop($PADlead_id);} + $PADemail_id = sprintf("%09s", $email_id); while (length($PADemail_id) > 9) {$PADemail_id = substr($PADemail_id,1);} + $caller_code = "E$PADemail_id$PADlead_id"; + + $dbhB = DBI->connect("DBI:mysql:$queuemetrics_dbname:$queuemetrics_server_ip:3306", "$queuemetrics_login", "$queuemetrics_pass") + or die "Couldn't connect to database: " . DBI->errstr; + + if ($DBX) {print "CONNECTED TO QueueMetrics DATABASE: $queuemetrics_server_ip|$queuemetrics_dbname\n";} + + $stmtB = "INSERT INTO queue_log SET `partition`='P01',time_id='$secX',call_id='$caller_code',queue='NONE',agent='NONE',verb='INFO',data1='DID',data2='$VARemail_ID',serverid='$queuemetrics_log_id';"; + $Baffected_rows = $dbhB->do($stmtB); + + $stmtB = "INSERT INTO queue_log SET `partition`='P01',time_id='$secX',call_id='$caller_code',queue='NONE',agent='NONE',verb='INFO',data1='IVRSTART',data2='$VARemail_groupid',data3='$VARemail_ID',serverid='$queuemetrics_log_id';"; + $Baffected_rows = $dbhB->do($stmtB); + + $stmtB = "INSERT INTO queue_log SET `partition`='P01',time_id='$secX',call_id='$caller_code',queue='NONE',agent='NONE',verb='INFO',data1='IVR',data2='$VARemail_groupid',serverid='$queuemetrics_log_id';"; + $Baffected_rows = $dbhB->do($stmtB); + + $dbhB->disconnect(); + } + } + else + { die "Email insert failed. Check SQL in:\n $ins_stmt\n"; + } } - } #### END CYCLING THROUGH EMAILS if ($DB) { diff --git a/docs/CALLER_ID_NAME_CODES.txt b/docs/CALLER_ID_NAME_CODES.txt index 21a440df..19270913 100644 --- a/docs/CALLER_ID_NAME_CODES.txt +++ b/docs/CALLER_ID_NAME_CODES.txt @@ -1,4 +1,4 @@ -CALLER ID NAME CODES DOC Started: 2013-07-15 Updated: 2017-05-08 +CALLER ID NAME CODES DOC Started: 2013-07-15 Updated: 2017-10-26 This document is meant for reference only, and it does not contain all CID name codes possible, but more will be added over time. @@ -26,3 +26,4 @@ ULGC - Hangup of lone channel in left 3way session (ULGC3620170222100923) BM - Real-time screen blind monitor (BM149425456200006666) BB - Real-time screen blind barge (BB149425456200006666) BW - Real-time screen blind whisper (BW149425456200006666) +E - Inbound Email, tracking only (E0001797980001237995) diff --git a/www/agc/vdc_db_query.php b/www/agc/vdc_db_query.php index 6cafcb66..16d514a9 100644 --- a/www/agc/vdc_db_query.php +++ b/www/agc/vdc_db_query.php @@ -437,10 +437,11 @@ # 170816-2334 - Added ask post-call survey feature for in-group calls # 170912-1618 - Fix for no-hopper dnc dialing issue # 171018-1310 - Added code for campaign scheduled callback email alerts +# 171026-0107 - Added optional queue_log logging # -$version = '2.14-331'; -$build = '171018-1310'; +$version = '2.14-332'; +$build = '171026-0107'; $php_script = 'vdc_db_query.php'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=700; @@ -9248,6 +9249,11 @@ if ($ACTION == 'VDADcheckINCOMINGother') $email_row_id = $row[6]; $xfercallid = $row[7]; $uniqueid=date("U").".".rand(1, 9999); + $PADlead_id = sprintf("%010s", $lead_id); + while (strlen($PADlead_id) > 10) {$PADlead_id = substr("$PADlead_id", 1);} + $PADemail_row_id = sprintf("%010s", $email_row_id); + while (strlen($PADemail_row_id) > 9) {$PADemail_row_id = substr("$PADemail_row_id", 1);} + $caller_code = "E$PADemail_row_id$PADlead_id"; if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} @@ -9270,7 +9276,7 @@ if ($ACTION == 'VDADcheckINCOMINGother') $calls_today++; ### update the agent status to INCALL in vicidial_live_agents while handling email - $stmt = "UPDATE vicidial_live_agents set status='INCALL',comments='EMAIL',last_call_time='$NOW_TIME',lead_id='$lead_id',calls_today='$calls_today',external_hangup=0,external_status='',external_pause='',external_dial='',last_state_change='$NOW_TIME',pause_code='' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',comments='EMAIL',last_call_time='$NOW_TIME',lead_id='$lead_id',calls_today='$calls_today',external_hangup=0,external_status='',external_pause='',external_dial='',last_state_change='$NOW_TIME',pause_code='',callerid='$caller_code' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00490',$user,$server_ip,$session_name,$one_mysql_log);} @@ -9368,6 +9374,50 @@ if ($ACTION == 'VDADcheckINCOMINGother') if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00495',$user,$server_ip,$session_name,$one_mysql_log);} } + ############################################# + ##### START QUEUEMETRICS LOGGING LOOKUP ##### + $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_callstatus,queuemetrics_dispo_pause,queuemetrics_pe_phone_append,queuemetrics_socket,queuemetrics_socket_url FROM system_settings;"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $qm_conf_ct = mysqli_num_rows($rslt); + if ($qm_conf_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $enable_queuemetrics_logging = $row[0]; + $queuemetrics_server_ip = $row[1]; + $queuemetrics_dbname = $row[2]; + $queuemetrics_login = $row[3]; + $queuemetrics_pass = $row[4]; + $queuemetrics_log_id = $row[5]; + $queuemetrics_callstatus = $row[6]; + $queuemetrics_dispo_pause = $row[7]; + $queuemetrics_pe_phone_append = $row[8]; + $queuemetrics_socket = $row[9]; + $queuemetrics_socket_url = $row[10]; + } + ##### END QUEUEMETRICS LOGGING LOOKUP ##### + ########################################### + if ($enable_queuemetrics_logging > 0) + { + $linkB=mysqli_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); + if (!$linkB) {die(_QXZ("Could not connect: ")."$queuemetrics_server_ip|$queuemetrics_login" . mysqli_connect_error());} + mysqli_select_db($linkB, "$queuemetrics_dbname"); + + $stmt = "INSERT INTO queue_log SET `partition`='P01',time_id='$StarTtime',call_id='$caller_code',queue='$VDADchannel_group',agent='NONE',verb='ENTERQUEUE',data2='$email_row_id',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysqli_affected_rows($linkB); + + $stmt = "INSERT INTO queue_log SET `partition`='P01',time_id='$StarTtime',call_id='$caller_code',queue='$VDADchannel_group',agent='Agent/$user',verb='CONNECT',data1='0',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysqli_affected_rows($linkB); + + mysqli_close($linkB); + } } else if ($chat_ct>0) { @@ -9856,7 +9906,7 @@ if ($ACTION == 'VDADcheckINCOMINGother') $comments = preg_replace("/\r/i",'',$comments); $comments = preg_replace("/\n/i",'!N',$comments); - $LeaD_InfO = $callerid . "\n"; + $LeaD_InfO = $caller_code . "\n"; $LeaD_InfO .= $lead_id . "\n"; $LeaD_InfO .= $dispo . "\n"; $LeaD_InfO .= $tsr . "\n"; @@ -13729,6 +13779,7 @@ if ($ACTION == 'PauseCodeSubmit') { $pause_call_id='NONE'; if (strlen($campaign_cid) > 12) {$pause_call_id = $campaign_cid;} + if ( (preg_match("/^E/",$MDnextCID)) and (strlen($MDnextCID) > 19) ) {$pause_call_id = $MDnextCID;} $linkB=mysqli_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); if (!$linkB) {die(_QXZ("Could not connect: ")."$queuemetrics_server_ip|$queuemetrics_login" . mysqli_connect_error());} mysqli_select_db($linkB, "$queuemetrics_dbname"); diff --git a/www/agc/vicidial.php b/www/agc/vicidial.php index daaaf381..347ffa0b 100644 --- a/www/agc/vicidial.php +++ b/www/agc/vicidial.php @@ -567,10 +567,11 @@ # 170914-0708 - Fix for script tab issue # 170923-1336 - Small change to hangup customer process # 171011-1524 - Added webphone_layout options +# 171026-0109 - Small change for email queue_log logging # -$version = '2.14-537c'; -$build = '171011-1524'; +$version = '2.14-538c'; +$build = '171026-0109'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=87; $one_mysql_log=0; @@ -13633,7 +13634,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection) } if (xmlhttp) { - VMCpausecode_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=PauseCodeSubmit&format=text&status=" + newpausecode + "&agent_log_id=" + agent_log_id + "&campaign=" + campaign + "&extension=" + extension + "&protocol=" + protocol + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&stage=" + pause_code_counter + "&campaign_cid=" + LastCallCID + "&auto_dial_level=" + starting_dial_level; + VMCpausecode_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=PauseCodeSubmit&format=text&status=" + newpausecode + "&agent_log_id=" + agent_log_id + "&campaign=" + campaign + "&extension=" + extension + "&protocol=" + protocol + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&stage=" + pause_code_counter + "&campaign_cid=" + LastCallCID + "&auto_dial_level=" + starting_dial_level + "&MDnextCID=" + LasTCID; pause_code_counter++; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');