Added DID fields to Extended format for Export Calls Report
Added reset of calls counters for two tables to keepalive script Removed unneeded records in create MYSQL tables SQL file git-svn-id: svn://192.168.202.10@1720 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -64,6 +64,7 @@
|
||||
# 110705-2023 - Added agents_calls_reset option
|
||||
# 110725-2356 - Added new voicemail time zone option and menu gather
|
||||
# 110829-1601 - Added multiple invalid option to Call Menus
|
||||
# 110911-1452 - Added resets for extension groups and areacode cid tables
|
||||
#
|
||||
|
||||
$DB=0; # Debug flag
|
||||
@@ -786,6 +787,35 @@ if ($timeclock_end_of_day_NOW > 0)
|
||||
if ($DB) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
|
||||
$sthA->finish();
|
||||
|
||||
$stmtA = "update vicidial_campaign_cid_areacodes SET call_count_today=0;";
|
||||
if($DBX){print STDERR "\n|$stmtA|\n";}
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if($DB){print STDERR "\n|$affected_rows vicidial_campaign_cid_areacodes call counts reset|\n";}
|
||||
|
||||
$stmtA = "optimize table vicidial_campaign_cid_areacodes;";
|
||||
if($DBX){print STDERR "\n|$stmtA|\n";}
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
if ($DB) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
|
||||
$sthA->finish();
|
||||
|
||||
$stmtA = "update vicidial_extension_groups SET call_count_today=0;";
|
||||
if($DBX){print STDERR "\n|$stmtA|\n";}
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if($DB){print STDERR "\n|$affected_rows vicidial_extension_groups call counts reset|\n";}
|
||||
|
||||
$stmtA = "optimize table vicidial_extension_groups;";
|
||||
if($DBX){print STDERR "\n|$stmtA|\n";}
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
if ($DB) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
|
||||
$sthA->finish();
|
||||
|
||||
|
||||
$stmtA = "update vicidial_campaign_agents SET calls_today=0;";
|
||||
if($DBX){print STDERR "\n|$stmtA|\n";}
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
|
||||
@@ -2547,19 +2547,6 @@ INSERT INTO vicidial_state_call_times SET state_call_time_id='wyoming',state_cal
|
||||
|
||||
INSERT INTO vicidial_shifts SET shift_id='24HRMIDNIGHT',shift_name='24 hours 7 days a week',shift_start_time='0000',shift_length='24:00',shift_weekdays='0123456';
|
||||
|
||||
INSERT INTO vicidial_phone_codes (country_code, country, areacode, state, GMT_offset, DST, DST_range, geographic_description) VALUES ('1','USA','227','MD','-5','Y','SSM-FSN','');
|
||||
INSERT INTO vicidial_phone_codes (country_code, country, areacode, state, GMT_offset, DST, DST_range, geographic_description) VALUES ('1','CAN','343','ON','-5','Y','SSM-FSN','');
|
||||
INSERT INTO vicidial_phone_codes (country_code, country, areacode, state, GMT_offset, DST, DST_range, geographic_description) VALUES ('1','USA','364','KY','-6','Y','SSM-FSN','');
|
||||
INSERT INTO vicidial_phone_codes (country_code, country, areacode, state, GMT_offset, DST, DST_range, geographic_description) VALUES ('1','USA','447','IL','-6','Y','SSM-FSN','');
|
||||
INSERT INTO vicidial_phone_codes (country_code, country, areacode, state, GMT_offset, DST, DST_range, geographic_description) VALUES ('1','USA','575','NM','-7','Y','SSM-FSN','');
|
||||
INSERT INTO vicidial_phone_codes (country_code, country, areacode, state, GMT_offset, DST, DST_range, geographic_description) VALUES ('1','CAN','581','QC','-5','Y','SSM-FSN','');
|
||||
INSERT INTO vicidial_phone_codes (country_code, country, areacode, state, GMT_offset, DST, DST_range, geographic_description) VALUES ('1','CAN','587','AB','-7','Y','SSM-FSN','');
|
||||
INSERT INTO vicidial_phone_codes (country_code, country, areacode, state, GMT_offset, DST, DST_range, geographic_description) VALUES ('1','USA','659','AL','-6','Y','SSM-FSN','');
|
||||
INSERT INTO vicidial_phone_codes (country_code, country, areacode, state, GMT_offset, DST, DST_range, geographic_description) VALUES ('1','USA','667','MD','-5','Y','SSM-FSN','');
|
||||
INSERT INTO vicidial_phone_codes (country_code, country, areacode, state, GMT_offset, DST, DST_range, geographic_description) VALUES ('1','USA','681','WV','-5','Y','SSM-FSN','');
|
||||
INSERT INTO vicidial_phone_codes (country_code, country, areacode, state, GMT_offset, DST, DST_range, geographic_description) VALUES ('1','USA','730','IL','-6','Y','SSM-FSN','');
|
||||
INSERT INTO vicidial_phone_codes (country_code, country, areacode, state, GMT_offset, DST, DST_range, geographic_description) VALUES ('1','DOM','829','','-4','N','','Dominican Republic');
|
||||
|
||||
INSERT INTO vicidial_conf_templates SET template_id='SIP_generic',template_name='SIP phone generic',template_contents="type=friend\nhost=dynamic\ncanreinvite=no\ncontext=default";
|
||||
INSERT INTO vicidial_conf_templates SET template_id='IAX_generic',template_name='IAX phone generic',template_contents="type=friend\nhost=dynamic\nmaxauthreq=10\nauth=md5,plaintext,rsa\ncontext=default";
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
# 110329-1330 - Added more fields to EXTENDED option
|
||||
# 110531-1945 - Changed first phone_number field to phone_number_dialed, issue #495
|
||||
# 110721-2027 - Added IVR export options
|
||||
# 110911-1445 - Added did fields to the EXTENDED format
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -419,7 +420,7 @@ if ($run_export > 0)
|
||||
if ($rec_fields=='ALL')
|
||||
{$RFheader = "\trecording_id\trecording_filename\trecording_location";}
|
||||
if ($export_fields=='EXTENDED')
|
||||
{$EXheader = "\tuniqueid\tcaller_code\tserver_ip\thangup_cause\tdialstatus\tchannel\tdial_time\tanswered_time\tcpd_result";}
|
||||
{$EXheader = "\tuniqueid\tcaller_code\tserver_ip\thangup_cause\tdialstatus\tchannel\tdial_time\tanswered_time\tcpd_result\tdid_pattern\tdid_id\tdid_description";}
|
||||
if ($call_notes=='YES')
|
||||
{$NFheader = "\tcall_notes";}
|
||||
if ($ivr_export=='YES')
|
||||
@@ -545,6 +546,28 @@ if ($run_export > 0)
|
||||
$extended_data_c = "\t$row[0]";
|
||||
}
|
||||
|
||||
$stmt = "SELECT extension,did_id from vicidial_did_log where uniqueid='$export_uniqueid[$i]' LIMIT 1;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$vcdid_ct = mysql_num_rows($rslt);
|
||||
if ($vcdid_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$extended_data_d = "\t$row[0]\t$row[1]";
|
||||
|
||||
$stmt = "SELECT did_description from vicidial_inbound_dids where did_id='$row[1]' LIMIT 1;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$vcdidx_ct = mysql_num_rows($rslt);
|
||||
if ($vcdidx_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$extended_data_d .= "\t$row[0]";
|
||||
}
|
||||
else
|
||||
{$extended_data_d .= "\t";}
|
||||
}
|
||||
|
||||
}
|
||||
if (strlen($extended_data_a)<1)
|
||||
{$extended_data_a = "\t\t";}
|
||||
@@ -552,7 +575,9 @@ if ($run_export > 0)
|
||||
{$extended_data_b = "\t\t\t\t\t";}
|
||||
if (strlen($extended_data_c)<1)
|
||||
{$extended_data_c = "\t";}
|
||||
$extended_data .= "$extended_data_a$extended_data_b$extended_data_c";
|
||||
if (strlen($extended_data_d)<1)
|
||||
{$extended_data_d = "\t\t\t";}
|
||||
$extended_data .= "$extended_data_a$extended_data_b$extended_data_c$extended_data_d";
|
||||
}
|
||||
|
||||
$notes_data='';
|
||||
|
||||
Reference in New Issue
Block a user